diff --git a/src/test/common_badblock.sh b/src/test/common_badblock.sh index a5357430e9583311a04549e7c1c189a3c639e0c0..abb72ee9c3ae9f01c6ceac8e904633913bc87228 100644 --- a/src/test/common_badblock.sh +++ b/src/test/common_badblock.sh @@ -72,17 +72,15 @@ function badblock_test_init() { usage "bad device type: $1" ;; esac + DEVTYPE=$1 if [ "$BADBLOCK_TEST_TYPE" == "nfit_test" ]; then ndctl_nfit_test_init - else - echo "Invalid BADBLOCK_TEST_TYPE value: "$BADBLOCK_TEST_TYPE"" &>> $PREP_LOG_FILE - exit 1 fi - if [ "$1" == "dax_device" ]; then + if [ "$DEVTYPE" == "dax_device" ]; then DEVICE=$(badblock_test_get_dax_device) - elif [ "$1" == "block_device" ]; then + elif [ "$DEVTYPE" == "block_device" ]; then DEVICE=$(badblock_test_get_block_device) prepare_mount_dir $DEVICE $2 fi @@ -97,7 +95,8 @@ function badblock_test_init() { # Input arguments: # 1) remote node number # 2) device type (dax_device|block_device) -# 3) mount directory (in case of block device type) +# 3) for block device: mount directory +# for dax device on real pmem: dax device index on a given node # function badblock_test_init_node() { case "$2" @@ -108,17 +107,15 @@ function badblock_test_init_node() { usage "bad device type: $2" ;; esac + DEVTYPE=$2 if [ "$BADBLOCK_TEST_TYPE" == "nfit_test" ]; then ndctl_nfit_test_init_node $1 - else - echo "Invalid BADBLOCK_TEST_TYPE value: "$BADBLOCK_TEST_TYPE"" &>> $PREP_LOG_FILE - exit 1 fi - if [ "$2" == "dax_device" ]; then - DEVICE=$(badblock_test_get_dax_device_node $1) - elif [ "$2" == "block_device" ]; then + if [ "$DEVTYPE" == "dax_device" ]; then + DEVICE=$(badblock_test_get_dax_device_node $1 $3) + elif [ "$DEVTYPE" == "block_device" ]; then DEVICE=$(badblock_test_get_block_device_node $1) prepare_mount_dir_node $1 $DEVICE $3 fi @@ -133,6 +130,8 @@ function badblock_test_get_dax_device() { DEVICE="" if [ "$BADBLOCK_TEST_TYPE" == "nfit_test" ]; then DEVICE=$(ndctl_nfit_test_get_dax_device) + elif [ "$BADBLOCK_TEST_TYPE" == "real_pmem" ]; then + DEVICE=$(real_pmem_get_dax_device) fi echo $DEVICE } @@ -140,11 +139,16 @@ function badblock_test_get_dax_device() { # # badblock_test_get_dax_device_node -- get name of the dax device on a given # remote node +# Input arguments: +# 1) remote node number +# 2) For real pmem: device dax index on a given node # function badblock_test_get_dax_device_node() { DEVICE="" if [ "$BADBLOCK_TEST_TYPE" == "nfit_test" ]; then DEVICE=$(ndctl_nfit_test_get_dax_device_node $1) + elif [ "$BADBLOCK_TEST_TYPE" == "real_pmem" ]; then + DEVICE=$(real_pmem_get_dax_device_node $1 $2) fi echo $DEVICE } @@ -156,6 +160,8 @@ function badblock_test_get_block_device() { DEVICE="" if [ "$BADBLOCK_TEST_TYPE" == "nfit_test" ]; then DEVICE=$(ndctl_nfit_test_get_block_device) + elif [ "$BADBLOCK_TEST_TYPE" == "real_pmem" ]; then + DEVICE=$(real_pmem_get_block_device) fi echo "$DEVICE" } @@ -168,6 +174,8 @@ function badblock_test_get_block_device_node() { DEVICE="" if [ "$BADBLOCK_TEST_TYPE" == "nfit_test" ]; then DEVICE=$(ndctl_nfit_test_get_block_device_node $1) + elif [ "$BADBLOCK_TEST_TYPE" == "real_pmem" ]; then + DEVICE=$(real_pmem_get_block_device_node $1) fi echo "$DEVICE" } @@ -183,6 +191,10 @@ function prepare_mount_dir() { if [ "$BADBLOCK_TEST_TYPE" == "nfit_test" ]; then local FULLDEV="/dev/$1" ndctl_nfit_test_mount_pmem $FULLDEV $2 + elif [ "$BADBLOCK_TEST_TYPE" == "real_pmem" ]; then + if [ ! -d $2 ]; then + mkdir -p $2 + fi fi } @@ -199,7 +211,60 @@ function prepare_mount_dir_node() { if [ "$BADBLOCK_TEST_TYPE" == "nfit_test" ]; then local FULLDEV="/dev/$2" ndctl_nfit_test_mount_pmem_node $1 $FULLDEV $3 - fi + elif [ "$BADBLOCK_TEST_TYPE" == "real_pmem" ]; then + if [ ! -d $3 ]; then + run_on_node $1 "mkdir -p $3" + fi + fi +} + + +# +# real_pmem_get_dax_device -- get real pmem dax device name +# +function real_pmem_get_dax_device() { + local FULLDEV=${DEVICE_DAX_PATH[0]} + DEVICE=${FULLDEV##*/} + echo $DEVICE +} + +# +# real_pmem_get_dax_device_node -- get real pmem dax device name on a given +# remote node +# +# Input arguments: +# 1) remote node number +# 2) device dax index number +# +function real_pmem_get_dax_device_node() { + local node=$1 + local devdax_index=$2 + + local device_dax_path=(${NODE_DEVICE_DAX_PATH[$node]}) + + local FULLDEV=${device_dax_path[$devdax_index]} + + DEVICE=${FULLDEV##*/} + echo $DEVICE +} + +# +# real_pmem_get_block_device -- get real pmem block device name +# +function real_pmem_get_block_device() { + local FULL_DEV=$(mount | grep $PMEM_FS_DIR | cut -f 1 -d" ") + DEVICE=${FULL_DEV##*/} + echo $DEVICE +} + +# +# real_pmem_get_block_device_node -- get real pmem block device name on a given +# remote node +# +function real_pmem_get_block_device_node() { + local FULL_DEV=$(expect_normal_exit run_on_node $1 mount | grep $PMEM_FS_DIR | cut -f 1 -d" ") + DEVICE=${FULL_DEV##*/} + echo $DEVICE } # @@ -246,6 +311,7 @@ function badblock_test_fini() { # # badblock_test_fini_node() -- clean badblock test based on underlying hardware +# on a given remote node # # Input arguments: # 1) node number @@ -498,22 +564,107 @@ function ndctl_get_namespace_of_device_node() { # 3) number of bad blocks # function ndctl_inject_error() { - local NAMESPACE=$1 - local BLOCK=$2 - local COUNT=$3 + local namespace=$1 + local block=$2 + local count=$3 - echo "# sudo ndctl inject-error --block=$BLOCK --count=$COUNT $NAMESPACE" >> $PREP_LOG_FILE - sudo ndctl inject-error --block=$BLOCK --count=$COUNT $NAMESPACE &>> $PREP_LOG_FILE + echo "# sudo ndctl inject-error --block=$block --count=$count $namespace" >> $PREP_LOG_FILE + expect_normal_exit "sudo ndctl inject-error --block=$block --count=$count $namespace" &>> $PREP_LOG_FILE echo "# sudo ndctl start-scrub" >> $PREP_LOG_FILE - sudo ndctl start-scrub &>> $PREP_LOG_FILE + expect_normal_exit "sudo ndctl start-scrub" &>> $PREP_LOG_FILE echo "# sudo ndctl wait-scrub" >> $PREP_LOG_FILE - sudo ndctl wait-scrub &>> $PREP_LOG_FILE + expect_normal_exit "sudo ndctl wait-scrub" &>> $PREP_LOG_FILE echo "(done: ndctl wait-scrub)" >> $PREP_LOG_FILE } +# +# ndctl_inject_error_node -- inject error (bad blocks) to the namespace on +# a given remote node +# +# Input arguments: +# 1) node +# 2) namespace +# 3) the first bad block +# 4) number of bad blocks +# +function ndctl_inject_error_node() { + local node=$1 + local namespace=$2 + local block=$3 + local count=$4 + + echo "# sudo ndctl inject-error --block=$block --count=$count $namespace" >> $PREP_LOG_FILE + expect_normal_exit run_on_node $node "sudo ndctl inject-error --block=$block --count=$count $namespace" &>> $PREP_LOG_FILE + + echo "# sudo ndctl start-scrub" >> $PREP_LOG_FILE + expect_normal_exit run_on_node $node "sudo ndctl start-scrub" &>> $PREP_LOG_FILE + + echo "# sudo ndctl wait-scrub" >> $PREP_LOG_FILE + expect_normal_exit run_on_node $node "sudo ndctl wait-scrub" &>> $PREP_LOG_FILE + + echo "(done: ndctl wait-scrub)" >> $PREP_LOG_FILE +} + +# +# ndctl_uninject_error -- clear bad block error present in the namespace +# +# Input arguments: +# 1) full device name (error clearing process requires writing to device) +# 2) namespace +# 3) the first bad block +# 4) number of bad blocks +# +function ndctl_uninject_error() { + # explicit uninjection is not required on nfit_test since any error + # injections made during the tests are eventually cleaned up in _fini + # function by reloading the whole namespace + if [ "$BADBLOCK_TEST_TYPE" == "real_pmem" ]; then + local fulldev=$1 + local namespace=$2 + local block=$3 + local count=$4 + expect_normal_exit "sudo ndctl inject-error --uninject --block=$block --count=$count $namespace &>/dev/null" + if [ "$DEVTYPE" == "block_device" ]; then + expect_normal_exit "sudo dd if=/dev/zero of="$fulldev" bs=512 seek="$block" count="$count" oflag=direct &>/dev/null" + elif [ "$DEVTYPE" == "dax_device" ]; then + expect_normal_exit "$DAXIO$EXESUFFIX -i /dev/zero -o "$fulldev" -s "$block" -l "$count" &>/dev/null" + fi + fi +} + +# +# ndctl_uninject_error_node -- clear bad block error present in the +# namespace on a given remote node +# +# Input arguments: +# 1) node +# 2) full device name (error clearing process requires writing to device) +# 3) namespace +# 4) the first bad block +# 5) number of bad blocks +# +function ndctl_uninject_error_node() { + # explicit uninjection is not required on nfit_test since any error + # injections made during the tests are eventually cleaned up in _fini + # function by reloading the whole namespace + if [ "$BADBLOCK_TEST_TYPE" == "real_pmem" ]; then + local node=$1 + local fulldev=$2 + local namespace=$3 + local block=$4 + local count=$5 + expect_normal_exit run_on_node $node "sudo ndctl inject-error --uninject --block=$block --count=$count $namespace &>/dev/null" + if [ "$DEVTYPE" == "block_device" ]; then + expect_normal_exit run_on_node $node "sudo dd if=/dev/zero of="$fulldev" bs=512 seek="$block" count="$count" oflag=direct &>/dev/null" + elif [ "$DEVTYPE" == "dax_device" ]; then + expect_normal_exit run_on_node $node "$DAXIO$EXESUFFIX -i /dev/zero -o "$fulldev" -s "$block" -l "$count" &>/dev/null" + fi + fi +} + # # print_bad_blocks -- print all bad blocks (count, offset and length) # or "No bad blocks found" if there are no bad blocks diff --git a/src/test/pmempool_check/TEST31 b/src/test/pmempool_check/TEST31 index fb8cc327d66e4a58584091009da55b0631f711ab..66be7cb6f95008105c94b49dcd9d54b2cfb463d7 100755 --- a/src/test/pmempool_check/TEST31 +++ b/src/test/pmempool_check/TEST31 @@ -39,10 +39,9 @@ . ../unittest/unittest.sh require_test_type medium -require_fs_type non-pmem require_build_type debug nondebug -require_badblock_tests_enabled +require_badblock_tests_enabled block_device require_linked_with_ndctl $PMEMPOOL$EXESUFFIX setup @@ -82,6 +81,8 @@ expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" expect_bad_blocks +ndctl_uninject_error $FULLDEV $NAMESPACE $FIRST_SECTOR 1 + badblock_test_fini $MOUNT_DIR check diff --git a/src/test/pmempool_check/TEST32 b/src/test/pmempool_check/TEST32 index 72fbee9f9339592c4df8183826b02d17646bc39e..44f62a0bc83e962a922fc5e83a236785163e76eb 100755 --- a/src/test/pmempool_check/TEST32 +++ b/src/test/pmempool_check/TEST32 @@ -39,10 +39,9 @@ . ../unittest/unittest.sh require_test_type medium -require_fs_type non-pmem require_build_type debug nondebug -require_badblock_tests_enabled +require_badblock_tests_enabled dax_device require_linked_with_ndctl $PMEMPOOL$EXESUFFIX setup @@ -80,6 +79,8 @@ expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" expect_bad_blocks +ndctl_uninject_error $FULLDEV $NAMESPACE 11 1 + badblock_test_fini check diff --git a/src/test/pmempool_create/TEST10 b/src/test/pmempool_create/TEST10 index 83a308d7e0067c60192e8ec6ef0a3ebecf65ece8..74ec7aa0599fe285b3adf9bd0377d212699a136b 100755 --- a/src/test/pmempool_create/TEST10 +++ b/src/test/pmempool_create/TEST10 @@ -39,10 +39,9 @@ . ../unittest/unittest.sh require_test_type medium -require_fs_type non-pmem require_build_type debug nondebug -require_badblock_tests_enabled +require_badblock_tests_enabled dax_device require_linked_with_ndctl $PMEMPOOL$EXESUFFIX setup @@ -70,6 +69,7 @@ expect_bad_blocks # expect_normal_exit "$PMEMPOOL$EXESUFFIX create obj --layout pmempool$SUFFIX $POOLSET &>> $LOG" +ndctl_uninject_error $FULLDEV $NAMESPACE 11 1 badblock_test_fini check diff --git a/src/test/pmempool_create/TEST11 b/src/test/pmempool_create/TEST11 index c8aa8b5603e753fded23a3aa810e38bb05c7702b..80a2a05103fb94331eeb647e50cfe636b42a54b8 100755 --- a/src/test/pmempool_create/TEST11 +++ b/src/test/pmempool_create/TEST11 @@ -39,10 +39,9 @@ . ../unittest/unittest.sh require_test_type medium -require_fs_type non-pmem require_build_type debug nondebug -require_badblock_tests_enabled +require_badblock_tests_enabled block_device require_linked_with_ndctl $PMEMPOOL$EXESUFFIX setup @@ -76,6 +75,7 @@ expect_bad_blocks # expect_normal_exit "$PMEMPOOL$EXESUFFIX create obj --layout pmempool$SUFFIX $POOLSET &>> $LOG" +ndctl_uninject_error $FULLDEV $NAMESPACE $SECTOR 1 badblock_test_fini $MOUNT_DIR check diff --git a/src/test/pmempool_create/TEST12 b/src/test/pmempool_create/TEST12 index 34ab2df0ac4af8a968b8448abc9f279423bd2c66..a5dbdf530002f6756c4048ff0d25cb4c46fadfce 100755 --- a/src/test/pmempool_create/TEST12 +++ b/src/test/pmempool_create/TEST12 @@ -40,10 +40,9 @@ . ../unittest/unittest.sh require_test_type medium -require_fs_type non-pmem require_build_type debug nondebug -require_badblock_tests_enabled +require_badblock_tests_enabled dax_device require_linked_with_ndctl $PMEMPOOL$EXESUFFIX setup @@ -67,6 +66,7 @@ expect_bad_blocks expect_normal_exit "$PMEMPOOL$EXESUFFIX create obj -b --layout pmempool$SUFFIX $POOLSET >> $LOG" +ndctl_uninject_error $FULLDEV $NAMESPACE 11 1 badblock_test_fini check diff --git a/src/test/pmempool_info/TEST24 b/src/test/pmempool_info/TEST24 index de18668b187f00344cb5dbc3c1fab2af3d5e9c57..528f0f9dcd88511c0617c72bc6cfeb6b873aa550 100755 --- a/src/test/pmempool_info/TEST24 +++ b/src/test/pmempool_info/TEST24 @@ -39,10 +39,9 @@ . ../unittest/unittest.sh require_test_type medium -require_fs_type non-pmem require_build_type debug nondebug -require_badblock_tests_enabled +require_badblock_tests_enabled dax_device require_linked_with_ndctl $PMEMPOOL$EXESUFFIX setup diff --git a/src/test/pmempool_info/TEST25 b/src/test/pmempool_info/TEST25 index 0545306792c540045a901f0602fe3e9904a2463a..99a6537acc13d86d27cc446e95c270c8666a3f04 100755 --- a/src/test/pmempool_info/TEST25 +++ b/src/test/pmempool_info/TEST25 @@ -39,10 +39,9 @@ . ../unittest/unittest.sh require_test_type medium -require_fs_type non-pmem require_build_type debug nondebug -require_badblock_tests_enabled +require_badblock_tests_enabled block_device require_linked_with_ndctl $PMEMPOOL$EXESUFFIX setup @@ -69,6 +68,7 @@ expect_bad_blocks expect_normal_exit $PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG +ndctl_uninject_error $FULLDEV $NAMESPACE $FIRST_SECTOR 1 badblock_test_fini $MOUNT_DIR check diff --git a/src/test/pmempool_sync/TEST27 b/src/test/pmempool_sync/TEST27 index a14688edffecfc7d1e428ac668276e9c7e38c088..753cba0cce11db64f300d834613a5fcbe77d2e87 100755 --- a/src/test/pmempool_sync/TEST27 +++ b/src/test/pmempool_sync/TEST27 @@ -40,10 +40,9 @@ . ../unittest/unittest.sh require_test_type medium -require_fs_type non-pmem require_build_type debug nondebug -require_badblock_tests_enabled +require_badblock_tests_enabled block_device require_linked_with_ndctl $PMEMPOOL$EXESUFFIX setup @@ -91,6 +90,7 @@ expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" +ndctl_uninject_error $FULLDEV $NAMESPACE $FIRST_SECTOR 1 badblock_test_fini $MOUNT_DIR check diff --git a/src/test/pmempool_sync/TEST28 b/src/test/pmempool_sync/TEST28 index 1a84e7a5d1b14ba9bc92c0c329541f5fd33609d7..a87aed6faae91903325d8914c6e11a3294286aae 100755 --- a/src/test/pmempool_sync/TEST28 +++ b/src/test/pmempool_sync/TEST28 @@ -40,10 +40,9 @@ . ../unittest/unittest.sh require_test_type medium -require_fs_type non-pmem require_build_type debug nondebug -require_badblock_tests_enabled +require_badblock_tests_enabled dax_device require_linked_with_ndctl $PMEMPOOL$EXESUFFIX setup @@ -94,6 +93,7 @@ print_bad_blocks expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" +ndctl_uninject_error $FULLDEV $NAMESPACE 0 1 badblock_test_fini check diff --git a/src/test/pmempool_sync/TEST30 b/src/test/pmempool_sync/TEST30 index 658c2851770f97670f2308f9346e8ab62490b950..4c944fddb64961714a0265e304196ef3a3f337f0 100755 --- a/src/test/pmempool_sync/TEST30 +++ b/src/test/pmempool_sync/TEST30 @@ -40,10 +40,9 @@ . ../unittest/unittest.sh require_test_type medium -require_fs_type non-pmem require_build_type debug nondebug -require_badblock_tests_enabled +require_badblock_tests_enabled block_device require_linked_with_ndctl $PMEMPOOL$EXESUFFIX setup @@ -91,6 +90,7 @@ expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" +ndctl_uninject_error $FULLDEV $NAMESPACE $FIRST_SECTOR 1 badblock_test_fini $MOUNT_DIR check diff --git a/src/test/pmempool_sync/TEST31 b/src/test/pmempool_sync/TEST31 index 5f646790aca052e64970e8583b1e199ceb18f616..af2adb7c40baef831a61c86ce8a7e57e433095f2 100755 --- a/src/test/pmempool_sync/TEST31 +++ b/src/test/pmempool_sync/TEST31 @@ -40,10 +40,9 @@ . ../unittest/unittest.sh require_test_type medium -require_fs_type non-pmem require_build_type debug nondebug -require_badblock_tests_enabled +require_badblock_tests_enabled dax_device require_linked_with_ndctl $PMEMPOOL$EXESUFFIX setup @@ -94,6 +93,8 @@ print_bad_blocks expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" +ndctl_uninject_error $FULLDEV $NAMESPACE 1000 1 + badblock_test_fini check diff --git a/src/test/pmempool_sync/TEST38 b/src/test/pmempool_sync/TEST38 index f76cb382e2261f39be31b152f2f52e8c3a4c30bc..7492292c464f76d2f5ca9decb32c89a94ef6475c 100755 --- a/src/test/pmempool_sync/TEST38 +++ b/src/test/pmempool_sync/TEST38 @@ -45,7 +45,6 @@ . ../unittest/unittest.sh require_test_type medium -require_fs_type non-pmem # must be non-static debug release of the binary because the test relies on the # gdb ability to interrupt the program at a static method inside @@ -53,7 +52,7 @@ require_fs_type non-pmem require_build_type debug require_command gdb -require_badblock_tests_enabled +require_badblock_tests_enabled block_device require_linked_with_ndctl $PMEMPOOL$EXESUFFIX setup @@ -111,6 +110,7 @@ expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" +ndctl_uninject_error $FULLDEV $NAMESPACE $FIRST_SECTOR 1 badblock_test_fini $MOUNT_DIR check diff --git a/src/test/pmempool_sync/TEST39 b/src/test/pmempool_sync/TEST39 index 35c87c10067fc395456117c20e178728c5abc880..66aa7771cfdfb540945c73f01bc223524cd336a7 100755 --- a/src/test/pmempool_sync/TEST39 +++ b/src/test/pmempool_sync/TEST39 @@ -45,7 +45,6 @@ . ../unittest/unittest.sh require_test_type medium -require_fs_type non-pmem # must be non-static debug release of the binary because the test relies on the # gdb ability to interrupt the program at a static method inside @@ -53,7 +52,7 @@ require_fs_type non-pmem require_build_type debug require_command gdb -require_badblock_tests_enabled +require_badblock_tests_enabled block_device require_linked_with_ndctl $PMEMPOOL$EXESUFFIX setup @@ -111,6 +110,7 @@ expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" +ndctl_uninject_error $FULLDEV $NAMESPACE $FIRST_SECTOR 1 badblock_test_fini $MOUNT_DIR check diff --git a/src/test/pmempool_sync/TEST40 b/src/test/pmempool_sync/TEST40 index 620f6327f5c454efaab812f98982b17ea265a0b7..8f6e9b7df10c388ee09221437250878c2e231e2b 100755 --- a/src/test/pmempool_sync/TEST40 +++ b/src/test/pmempool_sync/TEST40 @@ -45,7 +45,6 @@ . ../unittest/unittest.sh require_test_type medium -require_fs_type non-pmem # must be non-static debug release of the binary because the test relies on the # gdb ability to interrupt the program at a static method inside @@ -53,7 +52,7 @@ require_fs_type non-pmem require_build_type debug require_command gdb -require_badblock_tests_enabled +require_badblock_tests_enabled block_device require_linked_with_ndctl $PMEMPOOL$EXESUFFIX setup @@ -111,6 +110,7 @@ expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" +ndctl_uninject_error $FULLDEV $NAMESPACE $FIRST_SECTOR 1 badblock_test_fini $MOUNT_DIR check diff --git a/src/test/pmempool_sync/TEST41 b/src/test/pmempool_sync/TEST41 index e2fb4ce8ca4583f631d4f45d320449eda48286be..a434c9d34c46e830d6dd32823a43d2664ce17286 100755 --- a/src/test/pmempool_sync/TEST41 +++ b/src/test/pmempool_sync/TEST41 @@ -45,7 +45,6 @@ . ../unittest/unittest.sh require_test_type medium -require_fs_type non-pmem # must be non-static debug release of the binary because the test relies on the # gdb ability to interrupt the program at a static method inside @@ -53,7 +52,7 @@ require_fs_type non-pmem require_build_type debug require_command gdb -require_badblock_tests_enabled +require_badblock_tests_enabled block_device require_linked_with_ndctl $PMEMPOOL$EXESUFFIX setup @@ -111,6 +110,7 @@ expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" +ndctl_uninject_error $FULLDEV $NAMESPACE $FIRST_SECTOR 1 badblock_test_fini $MOUNT_DIR check diff --git a/src/test/pmempool_sync_remote/TEST22 b/src/test/pmempool_sync_remote/TEST22 index 78de114d23440e19c2c40e783589108d6a7e5319..c464fca88fe715f8dd6ba3f40b82c2e4b1dbb9d8 100755 --- a/src/test/pmempool_sync_remote/TEST22 +++ b/src/test/pmempool_sync_remote/TEST22 @@ -105,10 +105,7 @@ turn_on_checking_bad_blocks_node 1 ${NODE_DIR[1]}/${POOLSET_REMOTE} # inject bad block: FILE=${MOUNT_DIR}/pool.local FIRST_SECTOR=$(expect_normal_exit run_on_node 0 ../extents $FILE -l 0) - -expect_normal_exit run_on_node 0 "sudo ndctl inject-error --block=$FIRST_SECTOR --count=1 $NAMESPACE &>> $PREP_LOG_FILE" -expect_normal_exit run_on_node 0 "sudo ndctl start-scrub &>> $PREP_LOG_FILE" -expect_normal_exit run_on_node 0 "sudo ndctl wait-scrub &>> $PREP_LOG_FILE" +ndctl_inject_error_node 0 $NAMESPACE $FIRST_SECTOR 1 expect_bad_blocks_node 0 @@ -119,6 +116,7 @@ expect_bad_blocks_node 0 expect_normal_exit run_on_node 0 "../pmempool sync -b -v ${NODE_DIR[0]}$POOLSET_LOCAL &>> $LOG" expect_normal_exit run_on_node 0 "../obj_verify ${NODE_DIR[0]}$POOLSET_LOCAL $LAYOUT v &>> $LOG" +ndctl_uninject_error_node 0 $FULLDEV $NAMESPACE $FIRST_SECTOR 1 badblock_test_fini_node 0 $MOUNT_DIR pass diff --git a/src/test/pmempool_sync_remote/TEST23 b/src/test/pmempool_sync_remote/TEST23 index 3293cf191f23ecb01bfd9fa8b5172ca7bc6245e2..69a16111f433dafae81c0928dc5f27e3fbd71372 100755 --- a/src/test/pmempool_sync_remote/TEST23 +++ b/src/test/pmempool_sync_remote/TEST23 @@ -105,10 +105,7 @@ turn_on_checking_bad_blocks_node 1 ${NODE_DIR[1]}/${POOLSET_REMOTE} # inject bad block: FILE=${MOUNT_DIR}/pool.local FIRST_SECTOR=$(expect_normal_exit run_on_node 0 ../extents $FILE -l 1000) - -expect_normal_exit run_on_node 0 "sudo ndctl inject-error --block=$FIRST_SECTOR --count=1 $NAMESPACE &>> $PREP_LOG_FILE" -expect_normal_exit run_on_node 0 "sudo ndctl start-scrub &>> $PREP_LOG_FILE" -expect_normal_exit run_on_node 0 "sudo ndctl wait-scrub &>> $PREP_LOG_FILE" +ndctl_inject_error_node 0 $NAMESPACE $FIRST_SECTOR 1 expect_bad_blocks_node 0 @@ -119,6 +116,7 @@ expect_bad_blocks_node 0 expect_normal_exit run_on_node 0 "../pmempool sync -b -v ${NODE_DIR[0]}$POOLSET_LOCAL &>> $LOG" expect_normal_exit run_on_node 0 "../obj_verify ${NODE_DIR[0]}$POOLSET_LOCAL $LAYOUT v &>> $LOG" +ndctl_uninject_error_node 0 $FULLDEV $NAMESPACE $FIRST_SECTOR 1 badblock_test_fini_node 0 $MOUNT_DIR pass diff --git a/src/test/pmempool_sync_remote/TEST24 b/src/test/pmempool_sync_remote/TEST24 index 57b6026735ddd2d1477868a6e28c13d9dab30f45..d6b8df934735d60908953eb9ed620dee61c2d2f7 100755 --- a/src/test/pmempool_sync_remote/TEST24 +++ b/src/test/pmempool_sync_remote/TEST24 @@ -110,9 +110,7 @@ turn_on_checking_bad_blocks_node 1 ${NODE_DIR[1]}/${POOLSET_REMOTE} FILE=${MOUNT_DIR}/pool.local.part.1 FIRST_SECTOR=$(expect_normal_exit run_on_node 0 ../extents $FILE -l 0) -expect_normal_exit run_on_node 0 "sudo ndctl inject-error --block=$FIRST_SECTOR --count=1 $NAMESPACE &>> $PREP_LOG_FILE" -expect_normal_exit run_on_node 0 "sudo ndctl start-scrub &>> $PREP_LOG_FILE" -expect_normal_exit run_on_node 0 "sudo ndctl wait-scrub &>> $PREP_LOG_FILE" +ndctl_inject_error_node 0 $NAMESPACE $FIRST_SECTOR 1 expect_bad_blocks_node 0 @@ -123,6 +121,7 @@ expect_bad_blocks_node 0 expect_normal_exit run_on_node 0 "../pmempool sync -b -v ${NODE_DIR[0]}$POOLSET_LOCAL &>> $LOG" expect_normal_exit run_on_node 0 "../obj_verify ${NODE_DIR[0]}$POOLSET_LOCAL $LAYOUT v &>> $LOG" +ndctl_uninject_error_node 0 $FULLDEV $NAMESPACE $FIRST_SECTOR 1 badblock_test_fini_node 0 $MOUNT_DIR pass diff --git a/src/test/pmempool_sync_remote/TEST25 b/src/test/pmempool_sync_remote/TEST25 index c57e7c1a66dc6db51c9d8d59d210c7dbe3a802c0..890488c1de38e5406ea16a5aaf37e62031d9f560 100755 --- a/src/test/pmempool_sync_remote/TEST25 +++ b/src/test/pmempool_sync_remote/TEST25 @@ -109,9 +109,7 @@ turn_on_checking_bad_blocks_node 1 ${NODE_DIR[1]}/${POOLSET_REMOTE} FILE=${MOUNT_DIR}/pool.local.part.1 FIRST_SECTOR=$(expect_normal_exit run_on_node 0 ../extents $FILE -l 1000) -expect_normal_exit run_on_node 0 "sudo ndctl inject-error --block=$FIRST_SECTOR --count=1 $NAMESPACE &>> $PREP_LOG_FILE" -expect_normal_exit run_on_node 0 "sudo ndctl start-scrub &>> $PREP_LOG_FILE" -expect_normal_exit run_on_node 0 "sudo ndctl wait-scrub &>> $PREP_LOG_FILE" +ndctl_inject_error_node 0 $NAMESPACE $FIRST_SECTOR 1 expect_bad_blocks_node 0 @@ -122,6 +120,7 @@ expect_bad_blocks_node 0 expect_normal_exit run_on_node 0 "../pmempool sync -b -v ${NODE_DIR[0]}$POOLSET_LOCAL &>> $LOG" expect_normal_exit run_on_node 0 "../obj_verify ${NODE_DIR[0]}$POOLSET_LOCAL $LAYOUT v &>> $LOG" +ndctl_uninject_error_node 0 $FULLDEV $NAMESPACE $FIRST_SECTOR 1 badblock_test_fini_node 0 $MOUNT_DIR pass diff --git a/src/test/pmempool_sync_remote/TEST32 b/src/test/pmempool_sync_remote/TEST32 index f56050f6b1100bff4946c927be1f8c5fae876155..c93ee2773ed65f54ebda11aa46e178361b32fc95 100755 --- a/src/test/pmempool_sync_remote/TEST32 +++ b/src/test/pmempool_sync_remote/TEST32 @@ -112,17 +112,14 @@ turn_on_checking_bad_blocks_node 1 ${NODE_DIR[1]}/${POOLSET_REMOTE} ############################################################################### # inject bad block in the part #0 -FILE=${MOUNT_DIR}/pool.local.part.0 -FIRST_SECTOR=$(expect_normal_exit run_on_node 0 ../extents $FILE -l 0) -expect_normal_exit run_on_node 0 "sudo ndctl inject-error --block=$FIRST_SECTOR --count=1 $NAMESPACE &>> $PREP_LOG_FILE" +FILE_0=${MOUNT_DIR}/pool.local.part.0 +FIRST_SECTOR_0=$(expect_normal_exit run_on_node 0 ../extents $FILE_0 -l 0) +ndctl_inject_error_node 0 $NAMESPACE $FIRST_SECTOR_0 1 # inject bad block in the part #1 -FILE=${MOUNT_DIR}/pool.local.part.1 -FIRST_SECTOR=$(expect_normal_exit run_on_node 0 ../extents $FILE -l 0) -expect_normal_exit run_on_node 0 "sudo ndctl inject-error --block=$FIRST_SECTOR --count=1 $NAMESPACE &>> $PREP_LOG_FILE" - -expect_normal_exit run_on_node 0 "sudo ndctl start-scrub &>> $PREP_LOG_FILE" -expect_normal_exit run_on_node 0 "sudo ndctl wait-scrub &>> $PREP_LOG_FILE" +FILE_1=${MOUNT_DIR}/pool.local.part.1 +FIRST_SECTOR_1=$(expect_normal_exit run_on_node 0 ../extents $FILE_1 -l 0) +ndctl_inject_error_node 0 $NAMESPACE $FIRST_SECTOR_1 1 expect_bad_blocks_node 0 @@ -133,6 +130,8 @@ expect_bad_blocks_node 0 expect_normal_exit run_on_node 0 "../pmempool sync -b -v ${NODE_DIR[0]}$POOLSET_LOCAL &>> $LOG" expect_normal_exit run_on_node 0 "../obj_verify ${NODE_DIR[0]}$POOLSET_LOCAL $LAYOUT v &>> $LOG" +ndctl_uninject_error_node 0 $FULLDEV $NAMESPACE $FIRST_SECTOR_0 1 +ndctl_uninject_error_node 0 $FULLDEV $NAMESPACE $FIRST_SECTOR_1 1 badblock_test_fini_node 0 $MOUNT_DIR pass diff --git a/src/test/pmempool_sync_remote/TEST33 b/src/test/pmempool_sync_remote/TEST33 index 60bd28a709225cd4b625840a27d53632b5bf6600..a7d00edd70bef46c84ae5f1f7b5d81153fbc732a 100755 --- a/src/test/pmempool_sync_remote/TEST33 +++ b/src/test/pmempool_sync_remote/TEST33 @@ -112,17 +112,14 @@ turn_on_checking_bad_blocks_node 1 ${NODE_DIR[1]}/${POOLSET_REMOTE} ############################################################################### # inject bad block in the part #0 -FILE=${MOUNT_DIR}/pool.local.part.0 -FIRST_SECTOR=$(expect_normal_exit run_on_node 0 ../extents $FILE -l 1000) -expect_normal_exit run_on_node 0 "sudo ndctl inject-error --block=$FIRST_SECTOR --count=1 $NAMESPACE &>> $PREP_LOG_FILE" +FILE_0=${MOUNT_DIR}/pool.local.part.0 +FIRST_SECTOR_0=$(expect_normal_exit run_on_node 0 ../extents $FILE_0 -l 1000) +ndctl_inject_error_node 0 $NAMESPACE $FIRST_SECTOR_0 1 # inject bad block in the part #1 -FILE=${MOUNT_DIR}/pool.local.part.1 -FIRST_SECTOR=$(expect_normal_exit run_on_node 0 ../extents $FILE -l 1000) -expect_normal_exit run_on_node 0 "sudo ndctl inject-error --block=$FIRST_SECTOR --count=1 $NAMESPACE &>> $PREP_LOG_FILE" - -expect_normal_exit run_on_node 0 "sudo ndctl start-scrub &>> $PREP_LOG_FILE" -expect_normal_exit run_on_node 0 "sudo ndctl wait-scrub &>> $PREP_LOG_FILE" +FILE_1=${MOUNT_DIR}/pool.local.part.1 +FIRST_SECTOR_1=$(expect_normal_exit run_on_node 0 ../extents $FILE_1 -l 1000) +ndctl_inject_error_node 0 $NAMESPACE $FIRST_SECTOR_1 1 expect_bad_blocks_node 0 @@ -133,6 +130,8 @@ expect_bad_blocks_node 0 expect_normal_exit run_on_node 0 "../pmempool sync -b -v ${NODE_DIR[0]}$POOLSET_LOCAL &>> $LOG" expect_normal_exit run_on_node 0 "../obj_verify ${NODE_DIR[0]}$POOLSET_LOCAL $LAYOUT v &>> $LOG" +ndctl_uninject_error_node 0 $NAMESPACE $FIRST_SECTOR_0 1 +ndctl_uninject_error_node 0 $NAMESPACE $FIRST_SECTOR_1 1 badblock_test_fini_node 0 $MOUNT_DIR pass diff --git a/src/test/pmempool_sync_remote/TEST34 b/src/test/pmempool_sync_remote/TEST34 index 9dbea65bfcb108dc0700af9819b26815245792be..d64e142424f57642f8f7f082d255bf8f8dfef2e7 100755 --- a/src/test/pmempool_sync_remote/TEST34 +++ b/src/test/pmempool_sync_remote/TEST34 @@ -41,7 +41,6 @@ . ../unittest/unittest.sh require_test_type medium -require_fs_type non-pmem require_build_type debug nondebug require_linked_with_ndctl $PMEMPOOL$EXESUFFIX @@ -110,9 +109,7 @@ turn_on_checking_bad_blocks_node 1 ${NODE_DIR[1]}/${POOLSET_REMOTE} FILE=$MOUNT_DIR/pool.remote FIRST_SECTOR=$(expect_normal_exit run_on_node 1 ../extents $FILE -l 0) -expect_normal_exit run_on_node 1 "sudo ndctl inject-error --block=$FIRST_SECTOR --count=1 $NAMESPACE &>> $PREP_LOG_FILE" -expect_normal_exit run_on_node 1 "sudo ndctl start-scrub &>> $PREP_LOG_FILE" -expect_normal_exit run_on_node 1 "sudo ndctl wait-scrub &>> $PREP_LOG_FILE" +ndctl_inject_error_node 1 $NAMESPACE $FIRST_SECTOR 1 expect_bad_blocks_node 1 @@ -127,6 +124,7 @@ expect_normal_exit run_on_node 0 "../pmempool sync -b -v ${NODE_DIR[0]}/$POOLSET # verification should succeed expect_normal_exit run_on_node 0 "../obj_verify ${NODE_DIR[0]}/$POOLSET_LOCAL $LAYOUT v &>> $LOG" +ndctl_uninject_error_node 1 $NAMESPACE $FIRST_SECTOR 1 badblock_test_fini_node 1 $MOUNT_DIR pass diff --git a/src/test/pmempool_sync_remote/TEST35 b/src/test/pmempool_sync_remote/TEST35 index f1a02b7fd33cffe6c3395a5e4d8022305f3f3f55..180e0c15958059a9f7bb09a001e4be1705d7fd38 100755 --- a/src/test/pmempool_sync_remote/TEST35 +++ b/src/test/pmempool_sync_remote/TEST35 @@ -41,7 +41,6 @@ . ../unittest/unittest.sh require_test_type medium -require_fs_type non-pmem require_build_type debug nondebug require_linked_with_ndctl $PMEMPOOL$EXESUFFIX @@ -110,9 +109,7 @@ turn_on_checking_bad_blocks_node 1 ${NODE_DIR[1]}/${POOLSET_REMOTE} FILE=$MOUNT_DIR/pool.remote FIRST_SECTOR=$(expect_normal_exit run_on_node 1 ../extents $FILE -l 1000) -expect_normal_exit run_on_node 1 "sudo ndctl inject-error --block=$FIRST_SECTOR --count=1 $NAMESPACE &>> $PREP_LOG_FILE" -expect_normal_exit run_on_node 1 "sudo ndctl start-scrub &>> $PREP_LOG_FILE" -expect_normal_exit run_on_node 1 "sudo ndctl wait-scrub &>> $PREP_LOG_FILE" +ndctl_inject_error_node 1 $NAMESPACE $FIRST_SECTOR 1 expect_bad_blocks_node 1 @@ -127,6 +124,7 @@ expect_normal_exit run_on_node 0 "../pmempool sync -b -v ${NODE_DIR[0]}/$POOLSET # verification should succeed expect_normal_exit run_on_node 0 "../obj_verify ${NODE_DIR[0]}/$POOLSET_LOCAL $LAYOUT v &>> $LOG" +ndctl_uninject_error_node 1 $FULLDEV $NAMESPACE $FIRST_SECTOR 1 badblock_test_fini_node 1 $MOUNT_DIR pass diff --git a/src/test/testconfig.sh.example b/src/test/testconfig.sh.example index aaf62f41c7af4fa1a6cb3db76da92ebd1db9f8b3..1712e15f626c95d5621bd2f60b8b54ce9a32df46 100644 --- a/src/test/testconfig.sh.example +++ b/src/test/testconfig.sh.example @@ -140,14 +140,18 @@ TM=1 # # Enable and select the type of tests for code handling bad blocks. -# Options: nfit_test, none (do not run, default) +# Options: nfit_test, real_pmem, none (do not run, default). # -# Running tests on emulated memory requires 'nfit_test' kernel module to be -# present in the system: see https://github.com/pmem/ndctl#unit-tests +# Running tests on emulated memory ('nfit test' option) requires 'nfit_test' +# kernel module to be present in the system. +# See https://github.com/pmem/ndctl#unit-tests # -# The tests use 'sudo' command many times and insert the 'nfit_test' -# kernel module, so they can be considered as POTENTIALLY DANGEROUS -# and have to be explicitly enabled. +# If the 'real_pmem' option is enabled, tests are run on real hardware +# provided through PMEM_FS_DIR or DEVICE_DAX_PATH config fields. +# +# The tests use 'sudo' command many times and, in case of tests on +# emulated memory, insert the 'nfit_test' kernel module, so they can be +# considered as POTENTIALLY DANGEROUS and have to be explicitly enabled. # Enable them ONLY IF you are sure you know what you are doing. # # As of kernel 4.20, the nfit-test module causes kernel oops whenever a devdax diff --git a/src/test/unittest/unittest.sh b/src/test/unittest/unittest.sh index 510ff2328150a1786bbd487e4707aed41a020342..eb88101c029aed961605b0a0a4f34c6ceb8c10b7 100644 --- a/src/test/unittest/unittest.sh +++ b/src/test/unittest/unittest.sh @@ -3608,12 +3608,40 @@ function require_max_devdax_size() { # # require_badblock_tests_enabled - check if tests for bad block support are not enabled +# Input arguments: +# 1) test device type # function require_badblock_tests_enabled() { require_sudo_allowed require_command ndctl + if [ "$BADBLOCK_TEST_TYPE" == "nfit_test" ]; then + require_kernel_module nfit_test + + # nfit_test dax device is created by the test and is + # used directly - no file system path nor device dax path + # needs to be provided by the user + if [ $1 == "dax_device" ]; then + require_fs_type none + + # nfit_test block device is created by the test and mounted on + # a filesystem of any type provided by the user + elif [ $1 == "block_device" ]; then + require_fs_type any + fi + + elif [ "$BADBLOCK_TEST_TYPE" == "real_pmem" ]; then + + if [ $1 == "dax_device" ]; then + require fs_type none + require_dax_devices 1 + require_binary $DAXIO$EXESUFFIX + + elif [ $1 == "block_device" ]; then + require_fs_type pmem + fi + else msg "$UNITTEST_NAME: SKIP: bad block tests are not enabled in testconfig.sh" exit 0 @@ -3629,6 +3657,8 @@ function require_badblock_tests_enabled_node() { require_command_node $1 ndctl if [ "$BADBLOCK_TEST_TYPE" == "nfit_test" ]; then require_kernel_module_node $1 nfit_test + elif [ "$BADBLOCK_TEST_TYPE" == "real_pmem" ]; then + : else msg "$UNITTEST_NAME: SKIP: bad block tests are not enabled in testconfig.sh" exit 0 diff --git a/src/test/util_badblock/TEST2 b/src/test/util_badblock/TEST2 index 759723ebe18698ef895ee1669a88e8266bf90610..666294f2f2311876faae3ee48c03337db335b57c 100755 --- a/src/test/util_badblock/TEST2 +++ b/src/test/util_badblock/TEST2 @@ -41,9 +41,8 @@ . ../unittest/unittest.sh require_test_type medium -require_fs_type non-pmem -require_badblock_tests_enabled +require_badblock_tests_enabled dax_device require_linked_with_ndctl ./util_badblock$EXESUFFIX setup diff --git a/src/test/util_badblock/TEST3 b/src/test/util_badblock/TEST3 index 58533c4856dbe6bc672a8acf98c1ab73ad53849d..fecf34868fe9827d04dafee686922ae4fc2342db 100755 --- a/src/test/util_badblock/TEST3 +++ b/src/test/util_badblock/TEST3 @@ -41,9 +41,8 @@ . ../unittest/unittest.sh require_test_type medium -require_fs_type none -require_badblock_tests_enabled +require_badblock_tests_enabled dax_device require_linked_with_ndctl ./util_badblock$EXESUFFIX setup @@ -59,6 +58,8 @@ expect_bad_blocks expect_normal_exit ./util_badblock$EXESUFFIX $FULLDEV l +ndctl_uninject_error $FULLDEV $NAMESPACE 11 1 + badblock_test_fini check diff --git a/src/test/util_badblock/TEST4 b/src/test/util_badblock/TEST4 index 70d3227d56f1d5e8def16e2c4a52cbd06649ff57..36158374fc4341c481f37f0c69dc52258bfd547e 100755 --- a/src/test/util_badblock/TEST4 +++ b/src/test/util_badblock/TEST4 @@ -42,9 +42,8 @@ . ../unittest/unittest.sh require_test_type medium -require_fs_type none -require_badblock_tests_enabled +require_badblock_tests_enabled dax_device require_linked_with_ndctl ./util_badblock$EXESUFFIX setup diff --git a/src/test/util_badblock/TEST5 b/src/test/util_badblock/TEST5 index 125e38d1a7a6acada09603ec1e459a90814bc6a2..7adc9232c82d3ede68d9d00d82b6d8e2d9cabace 100755 --- a/src/test/util_badblock/TEST5 +++ b/src/test/util_badblock/TEST5 @@ -41,9 +41,8 @@ . ../unittest/unittest.sh require_test_type medium -require_fs_type non-pmem -require_badblock_tests_enabled +require_badblock_tests_enabled block_device require_linked_with_ndctl ./util_badblock$EXESUFFIX setup diff --git a/src/test/util_badblock/TEST6 b/src/test/util_badblock/TEST6 index ceaaf32f16e84dc5ddf90e5514e47b8591727384..941571dc32903f386068603b7fb4cfcc1d7229e9 100755 --- a/src/test/util_badblock/TEST6 +++ b/src/test/util_badblock/TEST6 @@ -41,9 +41,8 @@ . ../unittest/unittest.sh require_test_type medium -require_fs_type non-pmem -require_badblock_tests_enabled +require_badblock_tests_enabled block_device require_linked_with_ndctl ./util_badblock$EXESUFFIX setup @@ -64,6 +63,7 @@ expect_bad_blocks expect_normal_exit ./util_badblock$EXESUFFIX $FILE l +ndctl_uninject_error $FULLDEV $NAMESPACE $FIRST_SECTOR 1 badblock_test_fini $MOUNT_DIR check diff --git a/src/test/util_badblock/TEST7 b/src/test/util_badblock/TEST7 index 2565bbf0b5a60a8bd7539f11653d12be2691ecd8..a5dd847b452aeb15fa5f2a07a7a97b5d886ba588 100755 --- a/src/test/util_badblock/TEST7 +++ b/src/test/util_badblock/TEST7 @@ -42,9 +42,8 @@ . ../unittest/unittest.sh require_test_type medium -require_fs_type non-pmem -require_badblock_tests_enabled +require_badblock_tests_enabled block_device require_linked_with_ndctl ./util_badblock$EXESUFFIX setup diff --git a/src/test/util_badblock/TEST8 b/src/test/util_badblock/TEST8 index ceec3a604739411cb137a14aebedd338594d35b7..ae4c2d3b75f33b7f28766fd47ae949f9c00599c7 100755 --- a/src/test/util_badblock/TEST8 +++ b/src/test/util_badblock/TEST8 @@ -41,9 +41,8 @@ . ../unittest/unittest.sh require_test_type medium -require_fs_type non-pmem -require_badblock_tests_enabled +require_badblock_tests_enabled dax_device require_linked_with_ndctl ./util_badblock$EXESUFFIX setup @@ -65,6 +64,8 @@ expect_bad_blocks # open a pool with bad blocks expect_abnormal_exit ./util_badblock$EXESUFFIX $FULLDEV o +ndctl_uninject_error $FULLDEV $NAMESPACE 11 1 + badblock_test_fini check diff --git a/src/test/util_badblock/TEST9 b/src/test/util_badblock/TEST9 index ec00d57912b415d7aafdefe424b8ada92ba5f646..ad43d4c4acdbf6e762823750bb71f1c14b1aa7ab 100755 --- a/src/test/util_badblock/TEST9 +++ b/src/test/util_badblock/TEST9 @@ -41,9 +41,8 @@ . ../unittest/unittest.sh require_test_type medium -require_fs_type non-pmem -require_badblock_tests_enabled +require_badblock_tests_enabled block_device require_linked_with_ndctl ./util_badblock$EXESUFFIX setup @@ -70,6 +69,7 @@ expect_bad_blocks # open a pool with bad blocks expect_abnormal_exit ./util_badblock$EXESUFFIX $FILE o +ndctl_uninject_error $FULLDEV $NAMESPACE $FIRST_SECTOR 1 badblock_test_fini $MOUNT_DIR check