Fix dmpd_functions test

Related: #2175198
This commit is contained in:
Filip Suba 2023-05-18 15:00:27 +02:00
parent a517fa496c
commit 6daf341749
3 changed files with 25 additions and 22 deletions

View File

@ -40,7 +40,7 @@ export TEST=/$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH)
BUILT_FILES=
# 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
./runtest.sh
@ -62,7 +62,7 @@ include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@touch $(METADATA)
# 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 "Path: $(TEST_DIR)" >> $(METADATA)
@echo "License: GPL" >> $(METADATA)
@ -71,6 +71,5 @@ $(METADATA): Makefile
@echo "TestTime: 1h" >> $(METADATA)
@echo "RunFor: $(PACKAGE_NAME)" >> $(METADATA)
@echo "Requires: $(PACKAGE_NAME)" >> $(METADATA)
@echo "RhtsRequires: kernel-kernel-storage-misc-env_setup" >> $(METADATA)
rhts-lint $(METADATA)
rhts-lint $(METADATA)

View File

@ -39,7 +39,7 @@ def thin_init(args):
atomic_run("Creating thin pool",
vg_name=args["group"],
lv_name=args["pool"],
options=["-T", "-L 500"],
options=["-T", "-L 1500"],
command=lvm.lv_create,
errors=errors)
@ -48,7 +48,7 @@ def thin_init(args):
atomic_run("Creating thin LV No. %s" % i,
vg_name=args["group"] + "/" + args["pool"],
lv_name=args["vol"] + str(i),
options=["-T", "-V 100"],
options=["-T", "-V 300"],
command=lvm.lv_create,
errors=errors)
@ -58,28 +58,16 @@ def thin_init(args):
command=create_filesystem,
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",
lv_name=args["pool"],
vg_name=args["group"],
command=metadata_snapshot,
errors=errors)
atomic_run("Deactivating pool",
lv_name=args["pool"],
vg_name=args["group"],
command=lvm.lv_deactivate,
errors=errors)
atomic_run("Creating swap LV",
vg_name=args["group"],
lv_name=args["swap"],
options=["-L 100"],
options=["-L 300"],
command=lvm.lv_create,
errors=errors)
@ -89,6 +77,19 @@ def thin_init(args):
command=lvm.lv_deactivate,
errors=errors)
atomic_run("Deactivating pool",
lv_name=args["pool"],
vg_name=args["group"],
command=lvm.lv_deactivate,
errors=errors)
for i in range(args["number of vols"]):
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("Swapping metadata",
vg_name=args["group"],
lv_name=args["swap"],
@ -1111,6 +1112,7 @@ def cache_errors_test(args):
# errors=errors)
#FIXME: Find other way to corrupt metadata, this exploits a bug
"""
atomic_run("Corrupting mappings on metadata device",
False,
source_file="Makefile",
@ -1139,7 +1141,7 @@ def cache_errors_test(args):
source_lv=args['swap'],
target_file="/tmp/metadata_repair",
command=dmpd.cache_repair,
errors=errors)
errors=errors)"""
atomic_run("Corrupting metadata on device",
cmd="echo 'nothing' >> /dev/mapper/%s-%s" % (args['group'], args['swap']),
@ -1208,6 +1210,7 @@ def main():
"swap": "swapvol"}
# Initialization
install_package("lvm2")
install_package("device-mapper-persistent-data")
# Tests for thin tools provided by device-mapper-persistent-data

View File

@ -195,7 +195,8 @@ def show_sys_info():
if run("rpm -q device-mapper-multipath") == 0:
#Abort test execution if multipath is not working well
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
run("multipath -F")
run("multipath -r")
@ -606,7 +607,7 @@ class LogChecker:
_print("WARN: Could not open %s" % log_msg_file)
return True
log_file = open(log_msg_file)
log_file = open(log_msg_file, encoding="utf-8", errors="ignore")
log = log_file.read()
begin_tag = "\\[ cut here \\]"