Fix dmpd_functions test
Related: #2175198
(cherry picked from commit 6daf341749
)
This commit is contained in:
parent
b76b7df037
commit
e3c64593c6
@ -40,7 +40,7 @@ export TEST=/$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH)
|
|||||||
BUILT_FILES=
|
BUILT_FILES=
|
||||||
|
|
||||||
# data files, .c files, scripts anything needed to either compile the test and/or run it.
|
# data files, .c files, scripts anything needed to either compile the test and/or run it.
|
||||||
FILES=$(METADATA) runtest.sh PURPOSE
|
FILES=$(METADATA) runtest.sh PURPOSE testinfo.desc dmpd_functions.py dmpd_library.py Makefile
|
||||||
|
|
||||||
run: $(FILES) build
|
run: $(FILES) build
|
||||||
./runtest.sh
|
./runtest.sh
|
||||||
@ -62,7 +62,7 @@ include /usr/share/rhts/lib/rhts-make.include
|
|||||||
$(METADATA): Makefile
|
$(METADATA): Makefile
|
||||||
@touch $(METADATA)
|
@touch $(METADATA)
|
||||||
# Change to the test owner's name
|
# Change to the test owner's name
|
||||||
@echo "Owner: Jakub Krysl <jkrysl@redhat.com>" > $(METADATA)
|
@echo "Owner: Filip Suba <fsuba@redhat.com>" > $(METADATA)
|
||||||
@echo "Name: $(TEST)" >> $(METADATA)
|
@echo "Name: $(TEST)" >> $(METADATA)
|
||||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||||
@echo "License: GPL" >> $(METADATA)
|
@echo "License: GPL" >> $(METADATA)
|
||||||
@ -71,6 +71,5 @@ $(METADATA): Makefile
|
|||||||
@echo "TestTime: 1h" >> $(METADATA)
|
@echo "TestTime: 1h" >> $(METADATA)
|
||||||
@echo "RunFor: $(PACKAGE_NAME)" >> $(METADATA)
|
@echo "RunFor: $(PACKAGE_NAME)" >> $(METADATA)
|
||||||
@echo "Requires: $(PACKAGE_NAME)" >> $(METADATA)
|
@echo "Requires: $(PACKAGE_NAME)" >> $(METADATA)
|
||||||
@echo "RhtsRequires: kernel-kernel-storage-misc-env_setup" >> $(METADATA)
|
|
||||||
|
|
||||||
rhts-lint $(METADATA)
|
rhts-lint $(METADATA)
|
@ -39,7 +39,7 @@ def thin_init(args):
|
|||||||
atomic_run("Creating thin pool",
|
atomic_run("Creating thin pool",
|
||||||
vg_name=args["group"],
|
vg_name=args["group"],
|
||||||
lv_name=args["pool"],
|
lv_name=args["pool"],
|
||||||
options=["-T", "-L 500"],
|
options=["-T", "-L 1500"],
|
||||||
command=lvm.lv_create,
|
command=lvm.lv_create,
|
||||||
errors=errors)
|
errors=errors)
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ def thin_init(args):
|
|||||||
atomic_run("Creating thin LV No. %s" % i,
|
atomic_run("Creating thin LV No. %s" % i,
|
||||||
vg_name=args["group"] + "/" + args["pool"],
|
vg_name=args["group"] + "/" + args["pool"],
|
||||||
lv_name=args["vol"] + str(i),
|
lv_name=args["vol"] + str(i),
|
||||||
options=["-T", "-V 100"],
|
options=["-T", "-V 300"],
|
||||||
command=lvm.lv_create,
|
command=lvm.lv_create,
|
||||||
errors=errors)
|
errors=errors)
|
||||||
|
|
||||||
@ -58,33 +58,34 @@ def thin_init(args):
|
|||||||
command=create_filesystem,
|
command=create_filesystem,
|
||||||
errors=errors)
|
errors=errors)
|
||||||
|
|
||||||
atomic_run("Deactivating thin LV No. %s" % i,
|
|
||||||
lv_name=args["vol"] + str(i),
|
|
||||||
vg_name=args["group"],
|
|
||||||
command=lvm.lv_deactivate,
|
|
||||||
errors=errors)
|
|
||||||
|
|
||||||
atomic_run("Creating metadata snapshot",
|
atomic_run("Creating metadata snapshot",
|
||||||
lv_name=args["pool"],
|
lv_name=args["pool"],
|
||||||
vg_name=args["group"],
|
vg_name=args["group"],
|
||||||
command=metadata_snapshot,
|
command=metadata_snapshot,
|
||||||
errors=errors)
|
errors=errors)
|
||||||
|
|
||||||
|
atomic_run("Creating swap LV",
|
||||||
|
vg_name=args["group"],
|
||||||
|
lv_name=args["swap"],
|
||||||
|
options=["-L 300"],
|
||||||
|
command=lvm.lv_create,
|
||||||
|
errors=errors)
|
||||||
|
|
||||||
|
atomic_run("Deactivating swap",
|
||||||
|
lv_name=args["swap"],
|
||||||
|
vg_name=args["group"],
|
||||||
|
command=lvm.lv_deactivate,
|
||||||
|
errors=errors)
|
||||||
|
|
||||||
atomic_run("Deactivating pool",
|
atomic_run("Deactivating pool",
|
||||||
lv_name=args["pool"],
|
lv_name=args["pool"],
|
||||||
vg_name=args["group"],
|
vg_name=args["group"],
|
||||||
command=lvm.lv_deactivate,
|
command=lvm.lv_deactivate,
|
||||||
errors=errors)
|
errors=errors)
|
||||||
|
|
||||||
atomic_run("Creating swap LV",
|
for i in range(args["number of vols"]):
|
||||||
vg_name=args["group"],
|
atomic_run("Deactivating thin LV No. %s" % i,
|
||||||
lv_name=args["swap"],
|
lv_name=args["vol"] + str(i),
|
||||||
options=["-L 100"],
|
|
||||||
command=lvm.lv_create,
|
|
||||||
errors=errors)
|
|
||||||
|
|
||||||
atomic_run("Deactivating swap",
|
|
||||||
lv_name=args["swap"],
|
|
||||||
vg_name=args["group"],
|
vg_name=args["group"],
|
||||||
command=lvm.lv_deactivate,
|
command=lvm.lv_deactivate,
|
||||||
errors=errors)
|
errors=errors)
|
||||||
@ -1111,6 +1112,7 @@ def cache_errors_test(args):
|
|||||||
# errors=errors)
|
# errors=errors)
|
||||||
|
|
||||||
#FIXME: Find other way to corrupt metadata, this exploits a bug
|
#FIXME: Find other way to corrupt metadata, this exploits a bug
|
||||||
|
"""
|
||||||
atomic_run("Corrupting mappings on metadata device",
|
atomic_run("Corrupting mappings on metadata device",
|
||||||
False,
|
False,
|
||||||
source_file="Makefile",
|
source_file="Makefile",
|
||||||
@ -1139,7 +1141,7 @@ def cache_errors_test(args):
|
|||||||
source_lv=args['swap'],
|
source_lv=args['swap'],
|
||||||
target_file="/tmp/metadata_repair",
|
target_file="/tmp/metadata_repair",
|
||||||
command=dmpd.cache_repair,
|
command=dmpd.cache_repair,
|
||||||
errors=errors)
|
errors=errors)"""
|
||||||
|
|
||||||
atomic_run("Corrupting metadata on device",
|
atomic_run("Corrupting metadata on device",
|
||||||
cmd="echo 'nothing' >> /dev/mapper/%s-%s" % (args['group'], args['swap']),
|
cmd="echo 'nothing' >> /dev/mapper/%s-%s" % (args['group'], args['swap']),
|
||||||
@ -1208,6 +1210,7 @@ def main():
|
|||||||
"swap": "swapvol"}
|
"swap": "swapvol"}
|
||||||
|
|
||||||
# Initialization
|
# Initialization
|
||||||
|
install_package("lvm2")
|
||||||
install_package("device-mapper-persistent-data")
|
install_package("device-mapper-persistent-data")
|
||||||
|
|
||||||
# Tests for thin tools provided by device-mapper-persistent-data
|
# Tests for thin tools provided by device-mapper-persistent-data
|
||||||
|
@ -194,7 +194,8 @@ def show_sys_info():
|
|||||||
if run("rpm -q device-mapper-multipath") == 0:
|
if run("rpm -q device-mapper-multipath") == 0:
|
||||||
#Abort test execution if multipath is not working well
|
#Abort test execution if multipath is not working well
|
||||||
if run("multipath -l 2>/dev/null") != 0:
|
if run("multipath -l 2>/dev/null") != 0:
|
||||||
sys.exit(1)
|
print("WARN: Multipath is not configured correctly")
|
||||||
|
return
|
||||||
#Flush all unused multipath devices before starting the test
|
#Flush all unused multipath devices before starting the test
|
||||||
run("multipath -F")
|
run("multipath -F")
|
||||||
run("multipath -r")
|
run("multipath -r")
|
||||||
@ -605,7 +606,7 @@ class LogChecker:
|
|||||||
_print("WARN: Could not open %s" % log_msg_file)
|
_print("WARN: Could not open %s" % log_msg_file)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
log_file = open(log_msg_file)
|
log_file = open(log_msg_file, encoding="utf-8", errors="ignore")
|
||||||
log = log_file.read()
|
log = log_file.read()
|
||||||
|
|
||||||
begin_tag = "\\[ cut here \\]"
|
begin_tag = "\\[ cut here \\]"
|
||||||
|
Loading…
Reference in New Issue
Block a user