diff --git a/src/libpmemobj/tx.c b/src/libpmemobj/tx.c index d768f53732d817c51aee338e0cce41fe04bb635b..32e3864a5cfaacc262b0895d4c180ff24fb87e2f 100644 --- a/src/libpmemobj/tx.c +++ b/src/libpmemobj/tx.c @@ -583,7 +583,7 @@ tx_lane_ranges_insert_def(PMEMobjpool *pop, struct tx *tx, rdef->offset, rdef->size); int ret = ravl_emplace_copy(tx->ranges, rdef); - if (ret == EEXIST) + if (ret && errno == EEXIST) FATAL("invalid state of ranges tree"); return ret; diff --git a/src/libpmempool/replica.c b/src/libpmempool/replica.c index ceef09c883656d55b90a3dc137127a6c98785b4d..bbb4ccfd37ac24d1291e8584e37ed509ae6940ce 100644 --- a/src/libpmempool/replica.c +++ b/src/libpmempool/replica.c @@ -2022,24 +2022,45 @@ replica_check_poolset_health(struct pool_set *set, } features_t features; + int check_bad_blks; + int fix_bad_blks = called_from_sync && fix_bad_blocks(flags); - if (replica_read_features(set, set_hs, &features)) { - LOG(1, "reading features failed"); - goto err; + if (fix_bad_blks) { + /* + * We will fix bad blocks, so we cannot read features here, + * because reading could fail, because of bad blocks. + * We will read features after having bad blocks fixed. + * + * Fixing bad blocks implies checking bad blocks. + */ + check_bad_blks = 1; + } else { + /* + * We will not fix bad blocks, so we have to read features here. + */ + if (replica_read_features(set, set_hs, &features)) { + LOG(1, "reading features failed"); + goto err; + } + check_bad_blks = features.compat & POOL_FEAT_CHECK_BAD_BLOCKS; } - /* set ignore_sds flag basing on features read from the header */ - set->ignore_sds = !(features.incompat & POOL_FEAT_SDS); - /* check for bad blocks when in dry run or clear them otherwise */ if (replica_badblocks_check_or_clear(set, set_hs, is_dry_run(flags), - called_from_sync, - features.compat & POOL_FEAT_CHECK_BAD_BLOCKS, - called_from_sync && fix_bad_blocks(flags))) { + called_from_sync, check_bad_blks, fix_bad_blks)) { LOG(1, "replica bad_blocks check failed"); goto err; } + /* read features after fixing bad blocks */ + if (fix_bad_blks && replica_read_features(set, set_hs, &features)) { + LOG(1, "reading features failed"); + goto err; + } + + /* set ignore_sds flag basing on features read from the header */ + set->ignore_sds = !(features.incompat & POOL_FEAT_SDS); + /* map all headers */ map_all_unbroken_headers(set, set_hs); diff --git a/src/test/common_badblock.sh b/src/test/common_badblock.sh index abb72ee9c3ae9f01c6ceac8e904633913bc87228..06e0b1d70f1afa2cf3f45d97478bd5fd616d1bcf 100644 --- a/src/test/common_badblock.sh +++ b/src/test/common_badblock.sh @@ -86,6 +86,8 @@ function badblock_test_init() { fi NAMESPACE=$(ndctl_get_namespace_of_device $DEVICE) FULLDEV="/dev/$DEVICE" + # current unit tests support only block sizes less or equal 4096 bytes + require_max_block_size $FULLDEV 4096 } # @@ -667,22 +669,29 @@ function ndctl_uninject_error_node() { # # print_bad_blocks -- print all bad blocks (count, offset and length) -# or "No bad blocks found" if there are no bad blocks +# in the given namespace or "No bad blocks found" +# if there are no bad blocks +# +# Input arguments: +# 1) namespace # function print_bad_blocks { # XXX sudo should be removed when it is not needed - sudo ndctl list -M | \ + sudo ndctl list -M -n $1 | \ grep -e "badblock_count" -e "offset" -e "length" >> $LOG \ || echo "No bad blocks found" >> $LOG } # # expect_bad_blocks -- verify if there are required bad blocks -# and fail if they are not there +# in the given namespace and fail if they are not there +# +# Input arguments: +# 1) namespace # function expect_bad_blocks { # XXX sudo should be removed when it is not needed - sudo ndctl list -M | grep -e "badblock_count" -e "offset" -e "length" >> $LOG && true + sudo ndctl list -M -n $1 | grep -e "badblock_count" -e "offset" -e "length" >> $LOG && true if [ $? -ne 0 ]; then # XXX sudo should be removed when it is not needed sudo ndctl list -M &>> $PREP_LOG_FILE && true @@ -697,12 +706,17 @@ function expect_bad_blocks { } # -# expect_bad_blocks -- verify if there are required bad blocks -# and fail if they are not there +# expect_bad_blocks_node -- verify if there are required bad blocks +# in the given namespace on the given node +# and fail if they are not there +# +# Input arguments: +# 1) node number +# 2) namespace # function expect_bad_blocks_node { # XXX sudo should be removed when it is not needed - expect_normal_exit run_on_node $1 sudo ndctl list -M | \ + expect_normal_exit run_on_node $1 sudo ndctl list -M -n $2 | \ grep -e "badblock_count" -e "offset" -e "length" >> $LOG \ || fatal "Error: ndctl failed to inject or retain bad blocks (node $1)" } diff --git a/src/test/daxio/TEST0 b/src/test/daxio/TEST0 index 5ecba5632177a647c9a2a371b423320c41b57b84..af0c7c3cdf1cb71dc7f18f1bbc9d0f811bee993b 100755 --- a/src/test/daxio/TEST0 +++ b/src/test/daxio/TEST0 @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright 2018, Intel Corporation +# Copyright 2018-2019, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -61,50 +61,50 @@ dd if=/dev/zero bs=1k count=2 2>> prep$UNITTEST_NUM.log | tr '\0' '1' > $DATA2 dd if=/dev/zero bs=1k count=2 2>> prep$UNITTEST_NUM.log | tr '\0' '2' >> $DATA2 # fill up Device DAX with some random data (len in hex) -expect_normal_exit $DAXIO$EXESUFFIX -o ${DEVICE_DAX_PATH[0]} -l 16384 < /dev/urandom 2>$LOG +expect_normal_exit "$DAXIO$EXESUFFIX -o ${DEVICE_DAX_PATH[0]} -l 16384 < /dev/urandom 2>$LOG" # check if not zeroed -expect_abnormal_exit $CMPMAP$EXESUFFIX -z -l 16384 ${DEVICE_DAX_PATH[0]} &>>$LOG +expect_abnormal_exit "$CMPMAP$EXESUFFIX -z -l 16384 ${DEVICE_DAX_PATH[0]} &>>$LOG" # zero device (len in dec) -expect_normal_exit $DAXIO$EXESUFFIX -z -o ${DEVICE_DAX_PATH[0]} -l 16384 2>>$LOG +expect_normal_exit "$DAXIO$EXESUFFIX -z -o ${DEVICE_DAX_PATH[0]} -l 16384 2>>$LOG" # check if zeroed -expect_normal_exit $CMPMAP$EXESUFFIX -z -l 16384 ${DEVICE_DAX_PATH[0]} &>>$LOG +expect_normal_exit "$CMPMAP$EXESUFFIX -z -l 16384 ${DEVICE_DAX_PATH[0]} &>>$LOG" # write data from files to Device DAX with various offsets/lengths # offset = 0 (default), len = length of input (4K) # 2K * 'x' + 2K * 'o' -expect_normal_exit $DAXIO$EXESUFFIX -i $DATA1 -o ${DEVICE_DAX_PATH[0]} 2>>$LOG +expect_normal_exit "$DAXIO$EXESUFFIX -i $DATA1 -o ${DEVICE_DAX_PATH[0]} 2>>$LOG" # offset = 4K, skip = 2K, len = length of remaining part of input (2K) # 2K * '2' + 2K * '\0' -expect_normal_exit $DAXIO$EXESUFFIX -i $DATA2 -o ${DEVICE_DAX_PATH[0]} -k 2048 -s 4096 2>>$LOG +expect_normal_exit "$DAXIO$EXESUFFIX -i $DATA2 -o ${DEVICE_DAX_PATH[0]} -k 2048 -s 4096 2>>$LOG" # offset = 8K, skip = 1K, len = 2K # 1K * '1' + 1K * '2' -expect_normal_exit $DAXIO$EXESUFFIX -i $DATA2 -o ${DEVICE_DAX_PATH[0]} -k 1024 -s 8192 -l 2048 2>>$LOG +expect_normal_exit "$DAXIO$EXESUFFIX -i $DATA2 -o ${DEVICE_DAX_PATH[0]} -k 1024 -s 8192 -l 2048 2>>$LOG" # offset = 10K # 8 * 'a' echo -n "aaaaaaaa" > $STDIN_TMP -expect_normal_exit $DAXIO$EXESUFFIX -o ${DEVICE_DAX_PATH[0]} -s 10240 2>>$LOG < $STDIN_TMP +expect_normal_exit "$DAXIO$EXESUFFIX -o ${DEVICE_DAX_PATH[0]} -s 10240 2>>$LOG < $STDIN_TMP" rm $STDIN_TMP # zero some fragments -expect_normal_exit $DAXIO$EXESUFFIX -z -o ${DEVICE_DAX_PATH[0]} -l 256 2>>$LOG -expect_normal_exit $DAXIO$EXESUFFIX -z -o ${DEVICE_DAX_PATH[0]} -s 3072 -l 128 2>>$LOG +expect_normal_exit "$DAXIO$EXESUFFIX -z -o ${DEVICE_DAX_PATH[0]} -l 256 2>>$LOG" +expect_normal_exit "$DAXIO$EXESUFFIX -z -o ${DEVICE_DAX_PATH[0]} -s 3072 -l 128 2>>$LOG" # dump data to file -expect_normal_exit $DAXIO$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -o $DATAOUT1 -l 16384 2>>$LOG +expect_normal_exit "$DAXIO$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -o $DATAOUT1 -l 16384 2>>$LOG" # dump data to stdout -expect_normal_exit $DAXIO$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -l 16384 > $DATAOUT2 2>>$LOG +expect_normal_exit "$DAXIO$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -l 16384 > $DATAOUT2 2>>$LOG" # check content -expect_normal_exit $DDMAP$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -b 1 -n 16384 -r > $DATALOG -expect_normal_exit $DDMAP$EXESUFFIX -i $DATAOUT1 -b 1 -n 16384 -r >> $DATALOG -expect_normal_exit $DDMAP$EXESUFFIX -i $DATAOUT2 -b 1 -n 16384 -r >> $DATALOG +expect_normal_exit "$DDMAP$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -b 1 -n 16384 -r > $DATALOG" +expect_normal_exit "$DDMAP$EXESUFFIX -i $DATAOUT1 -b 1 -n 16384 -r >> $DATALOG" +expect_normal_exit "$DDMAP$EXESUFFIX -i $DATAOUT2 -b 1 -n 16384 -r >> $DATALOG" check diff --git a/src/test/daxio/TEST1 b/src/test/daxio/TEST1 index f9fdfb97a8baf637f9338de632f924b79ccbbfc5..a06ead5fbb189d2e1620bd6127b3dd7223a0d145 100755 --- a/src/test/daxio/TEST1 +++ b/src/test/daxio/TEST1 @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright 2018, Intel Corporation +# Copyright 2018-2019, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -48,39 +48,39 @@ require_binary $DAXIO$EXESUFFIX LOG=out$UNITTEST_NUM.log # invalid offset/length -expect_abnormal_exit $DAXIO$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -k 0x1234abzz &>$LOG -expect_abnormal_exit $DAXIO$EXESUFFIX -o ${DEVICE_DAX_PATH[0]} -s foo &>>$LOG -expect_abnormal_exit $DAXIO$EXESUFFIX -o ${DEVICE_DAX_PATH[0]} -l 20xxx &>>$LOG +expect_abnormal_exit "$DAXIO$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -k 0x1234abzz &>$LOG" +expect_abnormal_exit "$DAXIO$EXESUFFIX -o ${DEVICE_DAX_PATH[0]} -s foo &>>$LOG" +expect_abnormal_exit "$DAXIO$EXESUFFIX -o ${DEVICE_DAX_PATH[0]} -l 20xxx &>>$LOG" # zero flag w/o output -expect_abnormal_exit $DAXIO$EXESUFFIX -z &>>$LOG +expect_abnormal_exit "$DAXIO$EXESUFFIX -z &>>$LOG" # no input/output -expect_abnormal_exit $DAXIO$EXESUFFIX -l 100 &>>$LOG +expect_abnormal_exit "$DAXIO$EXESUFFIX -l 100 &>>$LOG" # offset w/o input or output -expect_abnormal_exit $DAXIO$EXESUFFIX -o ${DEVICE_DAX_PATH[0]} -k 100 &>>$LOG -expect_abnormal_exit $DAXIO$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -s 100 &>>$LOG +expect_abnormal_exit "$DAXIO$EXESUFFIX -o ${DEVICE_DAX_PATH[0]} -k 100 &>>$LOG" +expect_abnormal_exit "$DAXIO$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -s 100 &>>$LOG" # neither input or output is device dax -expect_abnormal_exit $DAXIO$EXESUFFIX -i /dev/zero -o $DIR/dummy -l 16384 &>>$LOG +expect_abnormal_exit "$DAXIO$EXESUFFIX -i /dev/zero -o $DIR/dummy -l 16384 &>>$LOG" # requested size larger than source - no error, but will copy less than requested create_holey_file 4KB $DIR/dummy -expect_normal_exit $DAXIO$EXESUFFIX -i $DIR/dummy -o ${DEVICE_DAX_PATH[0]} -l 8192 &>>$LOG +expect_normal_exit "$DAXIO$EXESUFFIX -i $DIR/dummy -o ${DEVICE_DAX_PATH[0]} -l 8192 &>>$LOG" # offset/length beyond device size DEVSIZE=`$PMEMDETECT -z ${DEVICE_DAX_PATH[0]}` -expect_abnormal_exit $DAXIO$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -o /dev/null -k $(($DEVSIZE + 100)) &>>$LOG -expect_abnormal_exit $DAXIO$EXESUFFIX -o ${DEVICE_DAX_PATH[0]} -i /dev/zero -s $(($DEVSIZE + 1)) &>>$LOG +expect_abnormal_exit "$DAXIO$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -o /dev/null -k $(($DEVSIZE + 100)) &>>$LOG" +expect_abnormal_exit "$DAXIO$EXESUFFIX -o ${DEVICE_DAX_PATH[0]} -i /dev/zero -s $(($DEVSIZE + 1)) &>>$LOG" # these succeed, but copy less bytes than requested -expect_normal_exit $DAXIO$EXESUFFIX -o ${DEVICE_DAX_PATH[0]} -i /dev/zero -l $(($DEVSIZE + 1000)) &>>$LOG -expect_normal_exit $DAXIO$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -o /dev/null -k $(($DEVSIZE / 2)) -l $DEVSIZE &>>$LOG -expect_normal_exit $DAXIO$EXESUFFIX -o ${DEVICE_DAX_PATH[0]} -i /dev/zero -s $(($DEVSIZE - 100)) -l $DEVSIZE &>>$LOG -expect_normal_exit $DAXIO$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -o $DIR/dummy_out -k $(($DEVSIZE - 100)) -l $DEVSIZE &>>$LOG -expect_normal_exit $DAXIO$EXESUFFIX -o ${DEVICE_DAX_PATH[0]} -i $DIR/dummy -s $(($DEVSIZE - 100)) -l $DEVSIZE &>>$LOG +expect_normal_exit "$DAXIO$EXESUFFIX -o ${DEVICE_DAX_PATH[0]} -i /dev/zero -l $(($DEVSIZE + 1000)) &>>$LOG" +expect_normal_exit "$DAXIO$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -o /dev/null -k $(($DEVSIZE / 2)) -l $DEVSIZE &>>$LOG" +expect_normal_exit "$DAXIO$EXESUFFIX -o ${DEVICE_DAX_PATH[0]} -i /dev/zero -s $(($DEVSIZE - 100)) -l $DEVSIZE &>>$LOG" +expect_normal_exit "$DAXIO$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -o $DIR/dummy_out -k $(($DEVSIZE - 100)) -l $DEVSIZE &>>$LOG" +expect_normal_exit "$DAXIO$EXESUFFIX -o ${DEVICE_DAX_PATH[0]} -i $DIR/dummy -s $(($DEVSIZE - 100)) -l $DEVSIZE &>>$LOG" check diff --git a/src/test/daxio/TEST2 b/src/test/daxio/TEST2 index 7aaaeb5663ed8dda2e31d0728afeb1455b5b29be..427aa74234631e2b64914dbaac29b9b5ad4aba50 100755 --- a/src/test/daxio/TEST2 +++ b/src/test/daxio/TEST2 @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright 2018, Intel Corporation +# Copyright 2018-2019, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -59,25 +59,25 @@ dd if=/dev/zero bs=1k count=2 2>> prep$UNITTEST_NUM.log | tr '\0' '1' > $DATA2 dd if=/dev/zero bs=1k count=2 2>> prep$UNITTEST_NUM.log | tr '\0' '2' >> $DATA2 # zero device (len in dec) -expect_normal_exit $DAXIO$EXESUFFIX -z -o ${DEVICE_DAX_PATH[0]} -l 16384 2>>$LOG -expect_normal_exit $DAXIO$EXESUFFIX -z -o ${DEVICE_DAX_PATH[1]} -l 16384 2>>$LOG +expect_normal_exit "$DAXIO$EXESUFFIX -z -o ${DEVICE_DAX_PATH[0]} -l 16384 2>$LOG" +expect_normal_exit "$DAXIO$EXESUFFIX -z -o ${DEVICE_DAX_PATH[1]} -l 16384 2>>$LOG" # check if zeroed -expect_normal_exit $CMPMAP$EXESUFFIX -z -l 16384 ${DEVICE_DAX_PATH[0]} &>>$LOG -expect_normal_exit $CMPMAP$EXESUFFIX -z -l 16384 ${DEVICE_DAX_PATH[1]} &>>$LOG +expect_normal_exit "$CMPMAP$EXESUFFIX -z -l 16384 ${DEVICE_DAX_PATH[0]} &>>$LOG" +expect_normal_exit "$CMPMAP$EXESUFFIX -z -l 16384 ${DEVICE_DAX_PATH[1]} &>>$LOG" # write data from files to Device DAX -expect_normal_exit $DAXIO$EXESUFFIX -i $DATA1 -o ${DEVICE_DAX_PATH[0]} 2>>$LOG -expect_normal_exit $DAXIO$EXESUFFIX -i $DATA2 -o ${DEVICE_DAX_PATH[0]} -s 4096 2>>$LOG +expect_normal_exit "$DAXIO$EXESUFFIX -i $DATA1 -o ${DEVICE_DAX_PATH[0]} 2>>$LOG" +expect_normal_exit "$DAXIO$EXESUFFIX -i $DATA2 -o ${DEVICE_DAX_PATH[0]} -s 4096 2>>$LOG" # move data from one Device DAX to another -expect_normal_exit $DAXIO$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -o ${DEVICE_DAX_PATH[1]} -k 512 -s 0 -l 2048 2>>$LOG -expect_normal_exit $DAXIO$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -o ${DEVICE_DAX_PATH[1]} -k 5120 -s 3072 -l 2048 2>>$LOG -expect_normal_exit $DAXIO$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -o ${DEVICE_DAX_PATH[1]} -k 7168 -s 4096 -l 2048 2>>$LOG +expect_normal_exit "$DAXIO$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -o ${DEVICE_DAX_PATH[1]} -k 512 -s 0 -l 2048 2>>$LOG" +expect_normal_exit "$DAXIO$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -o ${DEVICE_DAX_PATH[1]} -k 5120 -s 3072 -l 2048 2>>$LOG" +expect_normal_exit "$DAXIO$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -o ${DEVICE_DAX_PATH[1]} -k 7168 -s 4096 -l 2048 2>>$LOG" # check content -expect_normal_exit $DDMAP$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -b 1 -n 16384 -r > $DATALOG -expect_normal_exit $DDMAP$EXESUFFIX -i ${DEVICE_DAX_PATH[1]} -b 1 -n 16384 -r >> $DATALOG +expect_normal_exit "$DDMAP$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -b 1 -n 16384 -r > $DATALOG" +expect_normal_exit "$DDMAP$EXESUFFIX -i ${DEVICE_DAX_PATH[1]} -b 1 -n 16384 -r >> $DATALOG" check diff --git a/src/test/daxio/TEST3 b/src/test/daxio/TEST3 index 97fce65e4afd6d98fd424f53cd8bae83ae6f9b95..b167f8131ba677c53d2873a38c45f21c225764b1 100755 --- a/src/test/daxio/TEST3 +++ b/src/test/daxio/TEST3 @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright 2018, Intel Corporation +# Copyright 2018-2019, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -62,50 +62,50 @@ dd if=/dev/zero bs=1k count=2 2>> prep$UNITTEST_NUM.log | tr '\0' '1' > $DATA2 dd if=/dev/zero bs=1k count=2 2>> prep$UNITTEST_NUM.log | tr '\0' '2' >> $DATA2 # fill up Device DAX with some random data (len in hex) -expect_normal_exit $DAXIO$EXESUFFIX -o ${DEVICE_DAX_PATH[0]} -l 16KiB < /dev/urandom 2>$LOG +expect_normal_exit "$DAXIO$EXESUFFIX -o ${DEVICE_DAX_PATH[0]} -l 16KiB < /dev/urandom 2>$LOG" # check if not zeroed -expect_abnormal_exit $CMPMAP$EXESUFFIX -z -l 16384 ${DEVICE_DAX_PATH[0]} &>>$LOG +expect_abnormal_exit "$CMPMAP$EXESUFFIX -z -l 16384 ${DEVICE_DAX_PATH[0]} &>>$LOG" # zero device (len in dec) -expect_normal_exit $DAXIO$EXESUFFIX -z -o ${DEVICE_DAX_PATH[0]} -l 16K 2>>$LOG +expect_normal_exit "$DAXIO$EXESUFFIX -z -o ${DEVICE_DAX_PATH[0]} -l 16K 2>>$LOG" # check if zeroed -expect_normal_exit $CMPMAP$EXESUFFIX -z -l 16384 ${DEVICE_DAX_PATH[0]} &>>$LOG +expect_normal_exit "$CMPMAP$EXESUFFIX -z -l 16384 ${DEVICE_DAX_PATH[0]} &>>$LOG" # write data from files to Device DAX with various offsets/lengths # offset = 0 (default), len = length of input (4K) # 2K * 'x' + 2K * 'o' -expect_normal_exit $DAXIO$EXESUFFIX -i $DATA1 -o ${DEVICE_DAX_PATH[0]} 2>>$LOG +expect_normal_exit "$DAXIO$EXESUFFIX -i $DATA1 -o ${DEVICE_DAX_PATH[0]} 2>>$LOG" # offset = 4K, skip = 2K, len = length of remaining part of input (2K) # 2K * '2' + 2K * '\0' -expect_normal_exit $DAXIO$EXESUFFIX -i $DATA2 -o ${DEVICE_DAX_PATH[0]} -k 2KiB -s 4KiB 2>>$LOG +expect_normal_exit "$DAXIO$EXESUFFIX -i $DATA2 -o ${DEVICE_DAX_PATH[0]} -k 2KiB -s 4KiB 2>>$LOG" # offset = 8K, skip = 1K, len = 2K # 1K * '1' + 1K * '2' -expect_normal_exit $DAXIO$EXESUFFIX -i $DATA2 -o ${DEVICE_DAX_PATH[0]} -k 1K -s 8K -l 2K 2>>$LOG +expect_normal_exit "$DAXIO$EXESUFFIX -i $DATA2 -o ${DEVICE_DAX_PATH[0]} -k 1K -s 8K -l 2K 2>>$LOG" # offset = 10K # 8 * 'a' echo -n "aaaaaaaa" > $STDIN_TMP -expect_normal_exit $DAXIO$EXESUFFIX -o ${DEVICE_DAX_PATH[0]} -s 10K 2>>$LOG < $STDIN_TMP +expect_normal_exit "$DAXIO$EXESUFFIX -o ${DEVICE_DAX_PATH[0]} -s 10K 2>>$LOG < $STDIN_TMP" rm $STDIN_TMP # zero some fragments -expect_normal_exit $DAXIO$EXESUFFIX -z -o ${DEVICE_DAX_PATH[0]} -l 256B 2>>$LOG -expect_normal_exit $DAXIO$EXESUFFIX -z -o ${DEVICE_DAX_PATH[0]} -s 3K -l 128 2>>$LOG +expect_normal_exit "$DAXIO$EXESUFFIX -z -o ${DEVICE_DAX_PATH[0]} -l 256B 2>>$LOG" +expect_normal_exit "$DAXIO$EXESUFFIX -z -o ${DEVICE_DAX_PATH[0]} -s 3K -l 128 2>>$LOG" # dump data to file -expect_normal_exit $DAXIO$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -o $DATAOUT1 -l 16384 2>>$LOG +expect_normal_exit "$DAXIO$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -o $DATAOUT1 -l 16384 2>>$LOG" # dump data to stdout -expect_normal_exit $DAXIO$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -l 16384 > $DATAOUT2 2>>$LOG +expect_normal_exit "$DAXIO$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -l 16384 > $DATAOUT2 2>>$LOG" # check content -expect_normal_exit $DDMAP$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -b 1 -n 16384 -r > $DATALOG -expect_normal_exit $DDMAP$EXESUFFIX -i $DATAOUT1 -b 1 -n 16384 -r >> $DATALOG -expect_normal_exit $DDMAP$EXESUFFIX -i $DATAOUT2 -b 1 -n 16384 -r >> $DATALOG +expect_normal_exit "$DDMAP$EXESUFFIX -i ${DEVICE_DAX_PATH[0]} -b 1 -n 16384 -r > $DATALOG" +expect_normal_exit "$DDMAP$EXESUFFIX -i $DATAOUT1 -b 1 -n 16384 -r >> $DATALOG" +expect_normal_exit "$DDMAP$EXESUFFIX -i $DATAOUT2 -b 1 -n 16384 -r >> $DATALOG" check diff --git a/src/test/pmempool_check/TEST31 b/src/test/pmempool_check/TEST31 index a50e82261854a03a941edf37366d1c95feac4f68..582c07f4b61820c0cfa7d3a0fbf90fde8f405469 100755 --- a/src/test/pmempool_check/TEST31 +++ b/src/test/pmempool_check/TEST31 @@ -64,23 +64,15 @@ turn_on_checking_bad_blocks $POOLSET # inject bad block: FIRST_SECTOR=$(expect_normal_exit $EXTENTS $MOUNT_DIR/testfile1 -l 0) -ndctl_inject_error $NAMESPACE $FIRST_SECTOR 1 +ndctl_inject_error $NAMESPACE $FIRST_SECTOR 8 -expect_bad_blocks - -expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" - -expect_bad_blocks +expect_bad_blocks $NAMESPACE expect_abnormal_exit "$PMEMPOOL$EXESUFFIX check -v $POOLSET >> $LOG" -expect_bad_blocks - -expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" - -expect_bad_blocks +expect_bad_blocks $NAMESPACE -ndctl_uninject_error $FULLDEV $NAMESPACE $FIRST_SECTOR 1 +ndctl_uninject_error $FULLDEV $NAMESPACE $FIRST_SECTOR 8 badblock_test_fini $MOUNT_DIR diff --git a/src/test/pmempool_check/TEST32 b/src/test/pmempool_check/TEST32 index 8992c12c8b50b39e28ebd2fd97ea70cb74a59667..3cb80535a67311188846bc3d6407a6a411f30a97 100755 --- a/src/test/pmempool_check/TEST32 +++ b/src/test/pmempool_check/TEST32 @@ -61,24 +61,16 @@ expect_normal_exit $PMEMPOOL$EXESUFFIX create obj --layout pmempool$SUFFIX $POOL turn_on_checking_bad_blocks $POOLSET -# inject bad block: OFF=11 LEN=1 -ndctl_inject_error $NAMESPACE 11 1 +# inject bad block: OFF=11 LEN=8 +ndctl_inject_error $NAMESPACE 11 8 -expect_bad_blocks - -expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" - -expect_bad_blocks +expect_bad_blocks $NAMESPACE expect_abnormal_exit "$PMEMPOOL$EXESUFFIX check -v $POOLSET >> $LOG" -expect_bad_blocks - -expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" - -expect_bad_blocks +expect_bad_blocks $NAMESPACE -ndctl_uninject_error $FULLDEV $NAMESPACE 11 1 +ndctl_uninject_error $FULLDEV $NAMESPACE 11 8 badblock_test_fini diff --git a/src/test/pmempool_check/out31.log.match b/src/test/pmempool_check/out31.log.match index 035849d8c55469873f4f2764f022cb6c76860191..d38375a38ab6cbf5d7ff94c1059d81b127b020b1 100644 --- a/src/test/pmempool_check/out31.log.match +++ b/src/test/pmempool_check/out31.log.match @@ -1,118 +1,8 @@ - "badblock_count":1, + "badblock_count":8, "offset":$(N), - "length":1 -Poolset structure: -Number of replicas : 2 -Replica 0 (master) - local, 3 part(s): -part 0: -path : $(nW)/testfile0 -type : regular file -size : 10485760 -part 1: -path : $(nW)/mnt-pmem/testfile1 -type : regular file -size : 10485760 -bad blocks: - offset length - 0 2 -part 2: -path : $(nW)/testfile2 -type : regular file -size : 10485760 -Replica 1 - local, 1 part(s): -part 0: -path : $(nW)/testfile3 -type : regular file -size : 31457280 - -POOL Header: -Signature : PMEMOBJ -Major : $(nW) -Mandatory features : $(*) -Not mandatory features : $(*) -Forced RO : 0x0 -Pool set UUID : $(nW) -UUID : $(nW) -Previous part UUID : $(nW) -Next part UUID : $(nW) -Previous replica UUID : $(nW) -Next replica UUID : $(nW) -Creation Time : $(*) -Alignment Descriptor : $(nW) -Class : 64 -Data : 2's complement, little endian -Machine : $(*) -Last shutdown : clean -Checksum : $(*) - -PMEM OBJ Header: -Layout : pmempool$(*) -Lanes offset : $(nW) -Number of lanes : $(nW) -Heap offset : $(nW) -Heap size : $(nW) -Checksum : $(*) -Root offset : $(nW) - "badblock_count":1, - "offset":$(N), - "length":1 + "length":8, poolset contains bad blocks, use 'pmempool info --bad-blocks=yes' to print or 'pmempool sync --bad-blocks' to clear them $(nW)/testset1: cannot repair - "badblock_count":1, - "offset":$(N), - "length":1 -Poolset structure: -Number of replicas : 2 -Replica 0 (master) - local, 3 part(s): -part 0: -path : $(nW)/testfile0 -type : regular file -size : 10485760 -part 1: -path : $(nW)/mnt-pmem/testfile1 -type : regular file -size : 10485760 -bad blocks: - offset length - 0 2 -part 2: -path : $(nW)/testfile2 -type : regular file -size : 10485760 -Replica 1 - local, 1 part(s): -part 0: -path : $(nW)/testfile3 -type : regular file -size : 31457280 - -POOL Header: -Signature : PMEMOBJ -Major : $(nW) -Mandatory features : $(*) -Not mandatory features : $(*) -Forced RO : 0x0 -Pool set UUID : $(nW) -UUID : $(nW) -Previous part UUID : $(nW) -Next part UUID : $(nW) -Previous replica UUID : $(nW) -Next replica UUID : $(nW) -Creation Time : $(*) -Alignment Descriptor : $(nW) -Class : 64 -Data : 2's complement, little endian -Machine : $(*) -Last shutdown : clean -Checksum : $(*) - -PMEM OBJ Header: -Layout : pmempool$(*) -Lanes offset : $(nW) -Number of lanes : $(nW) -Heap offset : $(nW) -Heap size : $(nW) -Checksum : $(*) -Root offset : $(nW) - "badblock_count":1, + "badblock_count":8, "offset":$(N), - "length":1 + "length":8, diff --git a/src/test/pmempool_check/out32.log.match b/src/test/pmempool_check/out32.log.match index 2f1bb18d88c2ad0be6760988d179b57293ba9450..4bf0c89b73f982bfa6348ff3b7347652bdc02801 100644 --- a/src/test/pmempool_check/out32.log.match +++ b/src/test/pmempool_check/out32.log.match @@ -1,104 +1,8 @@ - "badblock_count":1, + "badblock_count":8, "offset":11, - "length":1, -Poolset structure: -Number of replicas : 2 -Replica 0 (master) - local, 1 part(s): -part 0: -path : /dev/dax$(N).$(N) -type : device dax -size : $(N) -alignment : 4096 -bad blocks: - offset length - 11 1 -Replica 1 - local, 1 part(s): -part 0: -path : $(nW)/testfile1 -type : regular file -size : 10485760 - -POOL Header: -Signature : PMEMOBJ -Major : $(nW) -Mandatory features : $(*) -Not mandatory features : $(*) -Forced RO : 0x0 -Pool set UUID : $(nW) -UUID : $(nW) -Previous part UUID : $(nW) -Next part UUID : $(nW) -Previous replica UUID : $(nW) -Next replica UUID : $(nW) -Creation Time : $(*) -Alignment Descriptor : $(nW) -Class : 64 -Data : 2's complement, little endian -Machine : $(*) -Last shutdown : clean -Checksum : $(*) - -PMEM OBJ Header: -Layout : pmempool$(*) -Lanes offset : $(nW) -Number of lanes : $(nW) -Heap offset : $(nW) -Heap size : $(nW) -Checksum : $(*) -Root offset : $(nW) - "badblock_count":1, - "offset":11, - "length":1, + "length":8, poolset contains bad blocks, use 'pmempool info --bad-blocks=yes' to print or 'pmempool sync --bad-blocks' to clear them $(nW)/testset1: cannot repair - "badblock_count":1, - "offset":11, - "length":1, -Poolset structure: -Number of replicas : 2 -Replica 0 (master) - local, 1 part(s): -part 0: -path : /dev/dax$(N).$(N) -type : device dax -size : $(N) -alignment : 4096 -bad blocks: - offset length - 11 1 -Replica 1 - local, 1 part(s): -part 0: -path : $(nW)/testfile1 -type : regular file -size : 10485760 - -POOL Header: -Signature : PMEMOBJ -Major : $(nW) -Mandatory features : $(*) -Not mandatory features : $(*) -Forced RO : 0x0 -Pool set UUID : $(nW) -UUID : $(nW) -Previous part UUID : $(nW) -Next part UUID : $(nW) -Previous replica UUID : $(nW) -Next replica UUID : $(nW) -Creation Time : $(*) -Alignment Descriptor : $(nW) -Class : 64 -Data : 2's complement, little endian -Machine : $(*) -Last shutdown : clean -Checksum : $(*) - -PMEM OBJ Header: -Layout : pmempool$(*) -Lanes offset : $(nW) -Number of lanes : $(nW) -Heap offset : $(nW) -Heap size : $(nW) -Checksum : $(*) -Root offset : $(nW) - "badblock_count":1, + "badblock_count":8, "offset":11, - "length":1, + "length":8, diff --git a/src/test/pmempool_create/TEST10 b/src/test/pmempool_create/TEST10 index 4f83b75e9d9b80f3307ebc31dbf9b4a0f7186b7e..19c74f3c7a15a834f7ef4749810010e2a7c13c5a 100755 --- a/src/test/pmempool_create/TEST10 +++ b/src/test/pmempool_create/TEST10 @@ -60,13 +60,9 @@ expect_normal_exit $PMEMPOOL$EXESUFFIX rm $POOLSET # inject bad block: OFF=11 LEN=1 ndctl_inject_error $NAMESPACE 11 1 -expect_bad_blocks +expect_bad_blocks $NAMESPACE -# -# When the compat feature POOL_FEAT_CHECK_BAD_BLOCKS is enabled by default, -# 'expect_normal_exit' should be replaced with 'expect_abnormal_exit'. -# -expect_normal_exit "$PMEMPOOL$EXESUFFIX create obj --layout pmempool$SUFFIX $POOLSET &>> $LOG" +expect_abnormal_exit "$PMEMPOOL$EXESUFFIX create obj --layout pmempool$SUFFIX $POOLSET &>> $LOG" ndctl_uninject_error $FULLDEV $NAMESPACE 11 1 badblock_test_fini diff --git a/src/test/pmempool_create/TEST11 b/src/test/pmempool_create/TEST11 index 425eaab21a4560a5c97d1677f47c21c1b939879a..448f48913ff1b7d3992a5d67d29abdd1673441ca 100755 --- a/src/test/pmempool_create/TEST11 +++ b/src/test/pmempool_create/TEST11 @@ -66,13 +66,9 @@ create_poolset $POOLSET 10M:$DIR/testfile1:x 10M:$FILE:x 10M:$DIR/testfile2:x SECTOR=$(expect_normal_exit $EXTENTS $FILE -l 100) ndctl_inject_error $NAMESPACE $SECTOR 1 -expect_bad_blocks +expect_bad_blocks $NAMESPACE -# -# When the compat feature POOL_FEAT_CHECK_BAD_BLOCKS is enabled by default, -# 'expect_normal_exit' should be replaced with 'expect_abnormal_exit'. -# -expect_normal_exit "$PMEMPOOL$EXESUFFIX create obj --layout pmempool$SUFFIX $POOLSET &>> $LOG" +expect_abnormal_exit "$PMEMPOOL$EXESUFFIX create obj --layout pmempool$SUFFIX $POOLSET &>> $LOG" ndctl_uninject_error $FULLDEV $NAMESPACE $SECTOR 1 badblock_test_fini $MOUNT_DIR diff --git a/src/test/pmempool_create/TEST12 b/src/test/pmempool_create/TEST12 index e40c0414c029fb57f6c22b2ca773fa85bd9f0a47..9cdd969fe25e884aae691419603c146a59a34823 100755 --- a/src/test/pmempool_create/TEST12 +++ b/src/test/pmempool_create/TEST12 @@ -61,7 +61,7 @@ expect_normal_exit $PMEMPOOL$EXESUFFIX rm $POOLSET # inject bad block: OFF=11 LEN=1 ndctl_inject_error $NAMESPACE 11 1 -expect_bad_blocks +expect_bad_blocks $NAMESPACE expect_normal_exit "$PMEMPOOL$EXESUFFIX create obj -b --layout pmempool$SUFFIX $POOLSET >> $LOG" diff --git a/src/test/pmempool_create/out10.log.match b/src/test/pmempool_create/out10.log.match index 33cae9470289a27360c2f3cbcbc3407d3d955a41..b74c9199f63022e43dd8d1659e7b034e82c719cc 100644 --- a/src/test/pmempool_create/out10.log.match +++ b/src/test/pmempool_create/out10.log.match @@ -1,3 +1,5 @@ "badblock_count":1, "offset":11, "length":1, +error: '$(nW)/testset1' -- pool set contains bad blocks and cannot be created, run 'pmempool create --clear-bad-blocks' utility to clear bad blocks and create a pool +error: creating pool file failed diff --git a/src/test/pmempool_create/out11.log.match b/src/test/pmempool_create/out11.log.match index c345e1171a1417c129cf24ba8b94682ffe29c4e3..1f829261341127ff7a75e6aee9ad163c8e5686cb 100644 --- a/src/test/pmempool_create/out11.log.match +++ b/src/test/pmempool_create/out11.log.match @@ -1,3 +1,5 @@ "badblock_count":1, "offset":$(N), "length":1, +error: '$(nW)/testset1' -- pool set contains bad blocks and cannot be created, run 'pmempool create --clear-bad-blocks' utility to clear bad blocks and create a pool +error: creating pool file failed diff --git a/src/test/pmempool_feature/TEST12 b/src/test/pmempool_feature/TEST12 index a9fa4b286c482fe43760cbd9e1261bd96b613451..8125c31b727da43ed3179622e94ee1927433b5c7 100755 --- a/src/test/pmempool_feature/TEST12 +++ b/src/test/pmempool_feature/TEST12 @@ -44,7 +44,7 @@ configure_valgrind force-disable setup . ./common.sh -require_su_bb $PMEMPOOL$EXESUFFIX +require_bb_disabled_by_default $PMEMPOOL$EXESUFFIX pmempool_feature_create_poolset "no_dax_device" pmempool_feature_test_CHECK_BAD_BLOCKS diff --git a/src/test/pmempool_feature/TEST16 b/src/test/pmempool_feature/TEST16 index 57233d2115dc2e7829e7161a0e30d86e9b81763c..832efb6af3a69f7ece168cdacde169264508eca8 100755 --- a/src/test/pmempool_feature/TEST16 +++ b/src/test/pmempool_feature/TEST16 @@ -44,7 +44,7 @@ configure_valgrind force-disable setup . ./common.sh -require_user_bb $PMEMPOOL$EXESUFFIX +require_bb_enabled_by_default $PMEMPOOL$EXESUFFIX pmempool_feature_create_poolset "no_dax_device" pmempool_feature_test_CHECK_BAD_BLOCKS diff --git a/src/test/pmempool_info/TEST24 b/src/test/pmempool_info/TEST24 index 01cfc70e2e10048986bff93a53fc779a896250bf..a74eb535f1a52678a69f22daa10a6c07790f9ff0 100755 --- a/src/test/pmempool_info/TEST24 +++ b/src/test/pmempool_info/TEST24 @@ -58,13 +58,15 @@ create_poolset $POOLSET AUTO:$FULLDEV:x expect_normal_exit $PMEMPOOL$EXESUFFIX rm $POOLSET expect_normal_exit $PMEMPOOL$EXESUFFIX create obj --layout pmempool$SUFFIX $POOLSET -# inject bad block: OFF=11 LEN=1 -ndctl_inject_error $NAMESPACE 11 1 +# inject bad block: OFF=16 LEN=8 +ndctl_inject_error $NAMESPACE 16 8 -expect_bad_blocks +expect_bad_blocks $NAMESPACE expect_normal_exit $PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG +ndctl_uninject_error $FULLDEV $NAMESPACE 16 8 + badblock_test_fini check diff --git a/src/test/pmempool_info/TEST25 b/src/test/pmempool_info/TEST25 index 10822d452bb0d9dfd9d8a70edda2924fa39b77f4..9e46fc1086fed73b4b50fdfd929259b61b049af8 100755 --- a/src/test/pmempool_info/TEST25 +++ b/src/test/pmempool_info/TEST25 @@ -60,14 +60,14 @@ expect_normal_exit $PMEMPOOL$EXESUFFIX rm $POOLSET expect_normal_exit $PMEMPOOL$EXESUFFIX create obj --layout pmempool$SUFFIX $POOLSET # inject bad block: -FIRST_SECTOR=$(expect_normal_exit $EXTENTS $MOUNT_DIR/testfile1 -l 0) -ndctl_inject_error $NAMESPACE $FIRST_SECTOR 1 +FIRST_SECTOR=$(expect_normal_exit $EXTENTS $MOUNT_DIR/testfile1 -l 16) +ndctl_inject_error $NAMESPACE $FIRST_SECTOR 8 -expect_bad_blocks +expect_bad_blocks $NAMESPACE expect_normal_exit $PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG -ndctl_uninject_error $FULLDEV $NAMESPACE $FIRST_SECTOR 1 +ndctl_uninject_error $FULLDEV $NAMESPACE $FIRST_SECTOR 8 badblock_test_fini $MOUNT_DIR check diff --git a/src/test/pmempool_info/out24.log.match b/src/test/pmempool_info/out24.log.match index 18779e5b8e88d013003aa42280f9bb26c8344ef8..0030541f7f8422f78a403015e38dfdc30caae707 100644 --- a/src/test/pmempool_info/out24.log.match +++ b/src/test/pmempool_info/out24.log.match @@ -1,6 +1,6 @@ - "badblock_count":1, - "offset":11, - "length":1, + "badblock_count":8, + "offset":16, + "length":8, Poolset structure: Number of replicas : 1 Replica 0 (master) - local, 1 part(s): @@ -8,10 +8,10 @@ part 0: path : /dev/dax$(N).$(N) type : device dax size : $(nW) -alignment : 4096 +alignment : $(N) bad blocks: offset length - 11 1 + 16 8 POOL Header: Signature : PMEMOBJ diff --git a/src/test/pmempool_info/out25.log.match b/src/test/pmempool_info/out25.log.match index f19509d42700ce4d2c8c34391f2c551ea41387c5..9587b3bfaf7c4e170381afb0b8ac33c3964d2514 100644 --- a/src/test/pmempool_info/out25.log.match +++ b/src/test/pmempool_info/out25.log.match @@ -1,6 +1,6 @@ - "badblock_count":1, + "badblock_count":8, "offset":$(N), - "length":1, + "length":8, Poolset structure: Number of replicas : 1 Replica 0 (master) - local, 3 part(s): @@ -14,7 +14,7 @@ type : regular file size : 10485760 bad blocks: offset length - 0 2 + 16 8 part 2: path : $(nW)/testfile2 type : regular file diff --git a/src/test/pmempool_sync/TEST27 b/src/test/pmempool_sync/TEST27 index d94e15fa8c97712f68171271701bbb466712327d..d0f86e4bf9384c63ca74009bd2682018a361eee2 100755 --- a/src/test/pmempool_sync/TEST27 +++ b/src/test/pmempool_sync/TEST27 @@ -33,7 +33,7 @@ # # pmempool_sync/TEST27 -- test for sync command with badblocks # - bad blocks in the regular file -# blocks: offset: 8 length: 1 +# blocks: offset: 0 length: 8 # . ../unittest/unittest.sh @@ -70,18 +70,14 @@ expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX c v &>> $LOG" turn_on_checking_bad_blocks $POOLSET # inject bad block: -FIRST_SECTOR=$(expect_normal_exit $EXTENTS $MOUNT_DIR/testfile1 -l 8) -ndctl_inject_error $NAMESPACE $FIRST_SECTOR 1 +FIRST_SECTOR=$(expect_normal_exit $EXTENTS $MOUNT_DIR/testfile1 -l 0) +ndctl_inject_error $NAMESPACE $FIRST_SECTOR 8 -expect_bad_blocks +expect_bad_blocks $NAMESPACE -expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" - -expect_bad_blocks - -expect_abnormal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> /dev/null" +expect_abnormal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v" > /dev/null 2>&1 -expect_bad_blocks +expect_bad_blocks $NAMESPACE expect_normal_exit "$PMEMPOOL$EXESUFFIX sync -b -v $POOLSET >> $LOG" expect_normal_exit "$PMEMPOOL$EXESUFFIX check -v $POOLSET >> $LOG" @@ -89,7 +85,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 +ndctl_uninject_error $FULLDEV $NAMESPACE $FIRST_SECTOR 8 badblock_test_fini $MOUNT_DIR check diff --git a/src/test/pmempool_sync/TEST28 b/src/test/pmempool_sync/TEST28 index 1abf2034317e99a8c3978d0e87edc62ff87088f8..eb96a951ad7216a175e79fad1f0ae03f3fe42fbf 100755 --- a/src/test/pmempool_sync/TEST28 +++ b/src/test/pmempool_sync/TEST28 @@ -33,7 +33,7 @@ # # pmempool_sync/TEST28 -- test for sync command with badblocks # - bad blocks in the dax device -# blocks: offset: 0 length: 1 +# blocks: offset: 0 length: 8 # . ../unittest/unittest.sh @@ -65,34 +65,30 @@ expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX c v &>> $LOG" turn_on_checking_bad_blocks $POOLSET -# inject bad block: OFF=0 LEN=1 -ndctl_inject_error $NAMESPACE 0 1 +# inject bad block: OFF=0 LEN=8 +ndctl_inject_error $NAMESPACE 0 8 -expect_bad_blocks +expect_bad_blocks $NAMESPACE -expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" - -expect_bad_blocks - -expect_abnormal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> /dev/null" +expect_abnormal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v" > /dev/null 2>&1 -expect_bad_blocks +expect_bad_blocks $NAMESPACE expect_normal_exit "$PMEMPOOL$EXESUFFIX sync -b -v $POOLSET >> $LOG" -print_bad_blocks +print_bad_blocks $NAMESPACE expect_normal_exit "$PMEMPOOL$EXESUFFIX check -v $POOLSET >> $LOG" -print_bad_blocks +print_bad_blocks $NAMESPACE expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" -print_bad_blocks +print_bad_blocks $NAMESPACE expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" -ndctl_uninject_error $FULLDEV $NAMESPACE 0 1 +ndctl_uninject_error $FULLDEV $NAMESPACE 0 8 badblock_test_fini check diff --git a/src/test/pmempool_sync/TEST29 b/src/test/pmempool_sync/TEST29 index 67fa6e9dff76987bc19d291211fe7a3c46e68997..df7ea0360f36832ecf5cc3eb19b19798537c93d6 100755 --- a/src/test/pmempool_sync/TEST29 +++ b/src/test/pmempool_sync/TEST29 @@ -61,7 +61,7 @@ expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX c v &>> $LOG" # zero blocks zero_blocks $DIR/testfile1 0 100 -expect_abnormal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> /dev/null" +expect_abnormal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v" > /dev/null 2>&1 expect_abnormal_exit "$PMEMPOOL$EXESUFFIX check -v $POOLSET >> $LOG" expect_normal_exit "$PMEMPOOL$EXESUFFIX sync -v $POOLSET >> $LOG" expect_normal_exit "$PMEMPOOL$EXESUFFIX check -v $POOLSET >> $LOG" diff --git a/src/test/pmempool_sync/TEST30 b/src/test/pmempool_sync/TEST30 index dd796b9663d2a447350e322fc56cafba961e13d6..32f1ee70a4f8cf437e6e6d53b8bb08dff9655ebb 100755 --- a/src/test/pmempool_sync/TEST30 +++ b/src/test/pmempool_sync/TEST30 @@ -33,7 +33,7 @@ # # pmempool_sync/TEST30 -- test for sync command with badblocks # - bad blocks in the regular file -# blocks: offset: 1000 length: 1 +# blocks: offset: 1000 length: 8 # . ../unittest/unittest.sh @@ -71,17 +71,17 @@ turn_on_checking_bad_blocks $POOLSET # inject bad block: FIRST_SECTOR=$(expect_normal_exit $EXTENTS $MOUNT_DIR/testfile1 -l 1000) -ndctl_inject_error $NAMESPACE $FIRST_SECTOR 1 +ndctl_inject_error $NAMESPACE $FIRST_SECTOR 8 -expect_bad_blocks +expect_bad_blocks $NAMESPACE expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" -expect_bad_blocks +expect_bad_blocks $NAMESPACE -expect_abnormal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> /dev/null" +expect_abnormal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v" > /dev/null 2>&1 -expect_bad_blocks +expect_bad_blocks $NAMESPACE expect_normal_exit "$PMEMPOOL$EXESUFFIX sync -b -v $POOLSET >> $LOG" expect_normal_exit "$PMEMPOOL$EXESUFFIX check -v $POOLSET >> $LOG" @@ -89,7 +89,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 +ndctl_uninject_error $FULLDEV $NAMESPACE $FIRST_SECTOR 8 badblock_test_fini $MOUNT_DIR check diff --git a/src/test/pmempool_sync/TEST31 b/src/test/pmempool_sync/TEST31 index 182c7e65a2bb577133481fe5c20e68764d4863e1..c773f70a8bd7b5e6233a03095c6c31ce1ed9e554 100755 --- a/src/test/pmempool_sync/TEST31 +++ b/src/test/pmempool_sync/TEST31 @@ -33,7 +33,7 @@ # # pmempool_sync/TEST31 -- test for sync command with badblocks # - bad blocks in the dax device -# blocks: offset: 1000 length: 1 +# blocks: offset: 1000 length: 8 # . ../unittest/unittest.sh @@ -65,34 +65,34 @@ expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX c v &>> $LOG" turn_on_checking_bad_blocks $POOLSET -# inject bad block: OFF=1000 LEN=1 -ndctl_inject_error $NAMESPACE 1000 1 +# inject bad block: OFF=1000 LEN=8 +ndctl_inject_error $NAMESPACE 1000 8 -expect_bad_blocks +expect_bad_blocks $NAMESPACE expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" -expect_bad_blocks +expect_bad_blocks $NAMESPACE -expect_abnormal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> /dev/null" +expect_abnormal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v" > /dev/null 2>&1 -expect_bad_blocks +expect_bad_blocks $NAMESPACE expect_normal_exit "$PMEMPOOL$EXESUFFIX sync -b -v $POOLSET >> $LOG" -print_bad_blocks +print_bad_blocks $NAMESPACE expect_normal_exit "$PMEMPOOL$EXESUFFIX check -v $POOLSET >> $LOG" -print_bad_blocks +print_bad_blocks $NAMESPACE expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" -print_bad_blocks +print_bad_blocks $NAMESPACE expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" -ndctl_uninject_error $FULLDEV $NAMESPACE 1000 1 +ndctl_uninject_error $FULLDEV $NAMESPACE 1000 8 badblock_test_fini diff --git a/src/test/pmempool_sync/TEST38 b/src/test/pmempool_sync/TEST38 index 26bbaeb09f32caea2dd1e3027b56342684b66dcd..3af12cf30af25485f43b0c50667a922046809b96 100755 --- a/src/test/pmempool_sync/TEST38 +++ b/src/test/pmempool_sync/TEST38 @@ -33,7 +33,7 @@ # # pmempool_sync/TEST38 -- test for sync command with badblocks # - bad blocks in the regular file -# blocks: offset: 8000 length: 1 +# blocks: offset: 8000 length: 8 # in the 1st part # - run sync and break it after clearing bad blocks # and before recovering data using gdb @@ -81,17 +81,17 @@ turn_on_checking_bad_blocks $POOLSET # inject bad block: FIRST_SECTOR=$(expect_normal_exit $EXTENTS $MOUNT_DIR/testfile0 -l 8000) -ndctl_inject_error $NAMESPACE $FIRST_SECTOR 1 +ndctl_inject_error $NAMESPACE $FIRST_SECTOR 8 -expect_bad_blocks +expect_bad_blocks $NAMESPACE expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" -expect_bad_blocks +expect_bad_blocks $NAMESPACE -expect_abnormal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> /dev/null" +expect_abnormal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v" > /dev/null 2>&1 -expect_bad_blocks +expect_bad_blocks $NAMESPACE # run sync and break it after clearing bad blocks and before recovering data using gdb expect_normal_exit gdb --batch \ @@ -109,7 +109,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 +ndctl_uninject_error $FULLDEV $NAMESPACE $FIRST_SECTOR 8 badblock_test_fini $MOUNT_DIR check diff --git a/src/test/pmempool_sync/TEST39 b/src/test/pmempool_sync/TEST39 index 6ec7d6d217fa8a13391e7d0bf916eedefd2c6d96..31cdb11e30c5b37328f291f7d4230f7ed0449a87 100755 --- a/src/test/pmempool_sync/TEST39 +++ b/src/test/pmempool_sync/TEST39 @@ -33,7 +33,7 @@ # # pmempool_sync/TEST39 -- test for sync command with badblocks # - bad blocks in the regular file -# blocks: offset: 1000 length: 1 +# blocks: offset: 1000 length: 8 # in the 2nd part # - run sync and break it after clearing bad blocks # and before recovering data using gdb @@ -81,17 +81,17 @@ turn_on_checking_bad_blocks $POOLSET # inject bad block: FIRST_SECTOR=$(expect_normal_exit $EXTENTS $MOUNT_DIR/testfile1 -l 1000) -ndctl_inject_error $NAMESPACE $FIRST_SECTOR 1 +ndctl_inject_error $NAMESPACE $FIRST_SECTOR 8 -expect_bad_blocks +expect_bad_blocks $NAMESPACE expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" -expect_bad_blocks +expect_bad_blocks $NAMESPACE -expect_abnormal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> /dev/null" +expect_abnormal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v" > /dev/null 2>&1 -expect_bad_blocks +expect_bad_blocks $NAMESPACE # run sync and break it after clearing bad blocks and before recovering data using gdb expect_normal_exit gdb --batch \ @@ -109,7 +109,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 +ndctl_uninject_error $FULLDEV $NAMESPACE $FIRST_SECTOR 8 badblock_test_fini $MOUNT_DIR check diff --git a/src/test/pmempool_sync/TEST40 b/src/test/pmempool_sync/TEST40 index f064c15b3978c6817a3fc2fb3c7cecea7248b4cf..c33b5eb494bf30fdfcbba097a3c244b5ac9ed92f 100755 --- a/src/test/pmempool_sync/TEST40 +++ b/src/test/pmempool_sync/TEST40 @@ -33,7 +33,7 @@ # # pmempool_sync/TEST40 -- test for sync command with badblocks # - bad blocks in the regular file -# blocks: offset: 1000 length: 1 +# blocks: offset: 1000 length: 8 # in the 1st part # - run sync and break it after clearing bad blocks # and before recovering data using gdb @@ -81,17 +81,17 @@ turn_on_checking_bad_blocks $POOLSET # inject bad block: FIRST_SECTOR=$(expect_normal_exit $EXTENTS $MOUNT_DIR/testfile0 -l 1000) -ndctl_inject_error $NAMESPACE $FIRST_SECTOR 1 +ndctl_inject_error $NAMESPACE $FIRST_SECTOR 8 -expect_bad_blocks +expect_bad_blocks $NAMESPACE expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" -expect_bad_blocks +expect_bad_blocks $NAMESPACE -expect_abnormal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> /dev/null" +expect_abnormal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v" > /dev/null 2>&1 -expect_bad_blocks +expect_bad_blocks $NAMESPACE # run sync and break it during saving bad block recovery files expect_normal_exit gdb --batch \ @@ -109,7 +109,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 +ndctl_uninject_error $FULLDEV $NAMESPACE $FIRST_SECTOR 8 badblock_test_fini $MOUNT_DIR check diff --git a/src/test/pmempool_sync/TEST41 b/src/test/pmempool_sync/TEST41 index 7c79cd673540f5665ace0fd8fd82635316eb80d2..c29e2cbd3addc702600f1ad5429681d40ecceb9c 100755 --- a/src/test/pmempool_sync/TEST41 +++ b/src/test/pmempool_sync/TEST41 @@ -33,7 +33,7 @@ # # pmempool_sync/TEST41 -- test for sync command with badblocks # - bad blocks in the regular file -# blocks: offset: 1000 length: 1 +# blocks: offset: 1000 length: 8 # in the 2nd part # - run sync and break it after clearing bad blocks # and before recovering data using gdb @@ -81,17 +81,17 @@ turn_on_checking_bad_blocks $POOLSET # inject bad block: FIRST_SECTOR=$(expect_normal_exit $EXTENTS $MOUNT_DIR/testfile1 -l 1000) -ndctl_inject_error $NAMESPACE $FIRST_SECTOR 1 +ndctl_inject_error $NAMESPACE $FIRST_SECTOR 8 -expect_bad_blocks +expect_bad_blocks $NAMESPACE expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" -expect_bad_blocks +expect_bad_blocks $NAMESPACE -expect_abnormal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> /dev/null" +expect_abnormal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v" > /dev/null 2>&1 -expect_bad_blocks +expect_bad_blocks $NAMESPACE # run sync and break it during saving bad block recovery files expect_normal_exit gdb --batch \ @@ -109,7 +109,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 +ndctl_uninject_error $FULLDEV $NAMESPACE $FIRST_SECTOR 8 badblock_test_fini $MOUNT_DIR check diff --git a/src/test/pmempool_sync/out27.log.match b/src/test/pmempool_sync/out27.log.match index 6d6641238628b5b901f7f61caef7904f1854b5fc..911fa7371264be6125064d88722b5921ac8fbb6f 100644 --- a/src/test/pmempool_sync/out27.log.match +++ b/src/test/pmempool_sync/out27.log.match @@ -1,67 +1,12 @@ create($(nW)/testset1): allocating records in the pool ... create($(nW)/testset1): allocated $(N) records (of size $(N)) verify($(nW)/testset1): pool file successfully verified ($(N) records of size $(N)) - "badblock_count":1, + "badblock_count":8, "offset":$(N), - "length":1, -Poolset structure: -Number of replicas : 2 -Replica 0 (master) - local, 3 part(s): -part 0: -path : $(nW)/testfile0 -type : regular file -size : $(N) -part 1: -path : $(nW)/mnt-pmem/testfile1 -type : regular file -size : $(N) -bad blocks: - offset length - 8 2 -part 2: -path : $(nW)/testfile2 -type : regular file -size : $(N) -Replica 1 - local, 1 part(s): -part 0: -path : $(nW)/testfile3 -type : regular file -size : $(N) - -POOL Header: -Signature : PMEMOBJ -Major : $(nW) -Mandatory features : $(*) -Not mandatory features : $(*) -Forced RO : 0x0 -Pool set UUID : $(nW) -UUID : $(nW) -Previous part UUID : $(nW) -Next part UUID : $(nW) -Previous replica UUID : $(nW) -Next replica UUID : $(nW) -Creation Time : $(*) -Alignment Descriptor : $(nW) -Class : 64 -Data : 2's complement, little endian -Machine : $(*) -Last shutdown : clean -Checksum : $(*) - -PMEM OBJ Header: -Layout : pmempool$(*) -Lanes offset : $(nW) -Number of lanes : $(nW) -Heap offset : $(nW) -Heap size : $(nW) -Checksum : $(*) -Root offset : $(nW) - "badblock_count":1, - "offset":$(N), - "length":1, - "badblock_count":1, + "length":8, + "badblock_count":8, "offset":$(N), - "length":1, + "length":8, $(nW)/testset1: synchronized replica 0: checking shutdown state replica 0: shutdown state correct diff --git a/src/test/pmempool_sync/out28.log.match b/src/test/pmempool_sync/out28.log.match index ef578b8e47bfb314d21e0ac67da28417fbc912dd..e06d85dfd166d3b6749567d4f6d2be29bfb5d74a 100644 --- a/src/test/pmempool_sync/out28.log.match +++ b/src/test/pmempool_sync/out28.log.match @@ -1,60 +1,12 @@ create($(nW)/testset1): allocating records in the pool ... create($(nW)/testset1): allocated $(N) records (of size $(N)) verify($(nW)/testset1): pool file successfully verified ($(N) records of size $(N)) - "badblock_count":1, + "badblock_count":8, "offset":0, - "length":1, -Poolset structure: -Number of replicas : 2 -Replica 0 (master) - local, 1 part(s): -part 0: -path : /dev/dax$(N).$(N) -type : device dax -size : $(N) -alignment : 4096 -bad blocks: - offset length - 0 1 -Replica 1 - local, 1 part(s): -part 0: -path : $(nW)/testfile1 -type : regular file -size : $(N) - -POOL Header: -Signature : PMEMOBJ -Major : $(nW) -Mandatory features : $(*) -Not mandatory features : $(*) -Forced RO : 0x0 -Pool set UUID : $(nW) -UUID : $(nW) -Previous part UUID : $(nW) -Next part UUID : $(nW) -Previous replica UUID : $(nW) -Next replica UUID : $(nW) -Creation Time : $(*) -Alignment Descriptor : $(nW) -Class : 64 -Data : 2's complement, little endian -Machine : $(*) -Last shutdown : clean -Checksum : $(*) - -PMEM OBJ Header: -Layout : pmempool$(*) -Lanes offset : $(nW) -Number of lanes : $(nW) -Heap offset : $(nW) -Heap size : $(nW) -Checksum : $(*) -Root offset : $(nW) - "badblock_count":1, - "offset":0, - "length":1, - "badblock_count":1, + "length":8, + "badblock_count":8, "offset":0, - "length":1, + "length":8, $(nW)/testset1: synchronized No bad blocks found replica 0: checking shutdown state @@ -74,7 +26,7 @@ part 0: path : /dev/dax$(N).$(N) type : device dax size : $(N) -alignment : 4096 +alignment : $(N) Replica 1 - local, 1 part(s): part 0: path : $(nW)/testfile1 diff --git a/src/test/pmempool_sync/out30.log.match b/src/test/pmempool_sync/out30.log.match index c984f5bb5dae3d8a5ec206cc4ec9d430fd0d43a6..cf8e313bf8ae8d759993236140b69140248474a8 100644 --- a/src/test/pmempool_sync/out30.log.match +++ b/src/test/pmempool_sync/out30.log.match @@ -1,9 +1,9 @@ create($(nW)/testset1): allocating records in the pool ... create($(nW)/testset1): allocated $(N) records (of size $(N)) verify($(nW)/testset1): pool file successfully verified ($(N) records of size $(N)) - "badblock_count":1, + "badblock_count":8, "offset":$(N), - "length":1, + "length":8, Poolset structure: Number of replicas : 2 Replica 0 (master) - local, 3 part(s): @@ -17,7 +17,7 @@ type : regular file size : $(N) bad blocks: offset length - 1000 2 + 1000 8 part 2: path : $(nW)/testfile2 type : regular file @@ -56,12 +56,12 @@ Heap offset : $(nW) Heap size : $(nW) Checksum : $(*) Root offset : $(nW) - "badblock_count":1, + "badblock_count":8, "offset":$(N), - "length":1, - "badblock_count":1, + "length":8, + "badblock_count":8, "offset":$(N), - "length":1, + "length":8, $(nW)/testset1: synchronized replica 0: checking shutdown state replica 0: shutdown state correct diff --git a/src/test/pmempool_sync/out31.log.match b/src/test/pmempool_sync/out31.log.match index 97031001db4c4846957c42efc96f7df0c510a7d6..a930f6272e73de6fa3b446d9b066b6a9e0a5de88 100644 --- a/src/test/pmempool_sync/out31.log.match +++ b/src/test/pmempool_sync/out31.log.match @@ -1,9 +1,9 @@ create($(nW)/testset1): allocating records in the pool ... create($(nW)/testset1): allocated $(N) records (of size $(N)) verify($(nW)/testset1): pool file successfully verified ($(N) records of size $(N)) - "badblock_count":1, + "badblock_count":8, "offset":$(N), - "length":1, + "length":8, Poolset structure: Number of replicas : 2 Replica 0 (master) - local, 1 part(s): @@ -11,10 +11,10 @@ part 0: path : /dev/dax$(N).$(N) type : device dax size : $(N) -alignment : 4096 +alignment : $(N) bad blocks: offset length - 1000 1 + 1000 8 Replica 1 - local, 1 part(s): part 0: path : $(nW)/testfile1 @@ -49,12 +49,12 @@ Heap offset : $(nW) Heap size : $(nW) Checksum : $(*) Root offset : $(nW) - "badblock_count":1, + "badblock_count":8, "offset":$(N), - "length":1, - "badblock_count":1, + "length":8, + "badblock_count":8, "offset":$(N), - "length":1, + "length":8, $(nW)/testset1: synchronized No bad blocks found replica 0: checking shutdown state @@ -74,7 +74,7 @@ part 0: path : /dev/dax$(N).$(N) type : device dax size : $(N) -alignment : 4096 +alignment : $(N) Replica 1 - local, 1 part(s): part 0: path : $(nW)/testfile1 diff --git a/src/test/pmempool_sync/out38.log.match b/src/test/pmempool_sync/out38.log.match index 79ed09c7f55eab0e44c0f542ad51e2aa445efbe2..f0ed872d3aab66266ca35885230d66ea64a68c54 100644 --- a/src/test/pmempool_sync/out38.log.match +++ b/src/test/pmempool_sync/out38.log.match @@ -1,9 +1,9 @@ create($(nW)/testset1): allocating records in the pool ... create($(nW)/testset1): allocated $(N) records (of size $(N)) verify($(nW)/testset1): pool file successfully verified ($(N) records of size $(N)) - "badblock_count":1, + "badblock_count":8, "offset":$(N), - "length":1, + "length":8, Poolset structure: Number of replicas : 2 Replica 0 (master) - local, 3 part(s): @@ -13,7 +13,7 @@ type : regular file size : $(N) bad blocks: offset length - 8000 2 + 8000 8 part 1: path : $(nW)/testfile1 type : regular file @@ -56,12 +56,12 @@ Heap offset : $(nW) Heap size : $(nW) Checksum : $(*) Root offset : $(nW) - "badblock_count":1, + "badblock_count":8, "offset":$(N), - "length":1, - "badblock_count":1, + "length":8, + "badblock_count":8, "offset":$(N), - "length":1, + "length":8, $(nW)/testset1: pmemobj_open: error: a bad block recovery file exists, run 'pmempool sync --bad-blocks' utility to try to recover the pool: Invalid argument $(nW)/testset1: synchronized replica 0: checking shutdown state diff --git a/src/test/pmempool_sync/out39.log.match b/src/test/pmempool_sync/out39.log.match index 0880839a2632eae98605da601a5195916b03806f..7438695b928f353015ba1d8fb522e3e951fb0e13 100644 --- a/src/test/pmempool_sync/out39.log.match +++ b/src/test/pmempool_sync/out39.log.match @@ -1,9 +1,9 @@ create($(nW)/testset1): allocating records in the pool ... create($(nW)/testset1): allocated $(N) records (of size $(N)) verify($(nW)/testset1): pool file successfully verified ($(N) records of size $(N)) - "badblock_count":1, + "badblock_count":8, "offset":$(N), - "length":1, + "length":8, Poolset structure: Number of replicas : 2 Replica 0 (master) - local, 3 part(s): @@ -17,7 +17,7 @@ type : regular file size : $(N) bad blocks: offset length - 1000 2 + 1000 8 part 2: path : $(nW)/testfile2 type : regular file @@ -56,12 +56,12 @@ Heap offset : $(nW) Heap size : $(nW) Checksum : $(*) Root offset : $(nW) - "badblock_count":1, + "badblock_count":8, "offset":$(N), - "length":1, - "badblock_count":1, + "length":8, + "badblock_count":8, "offset":$(N), - "length":1, + "length":8, $(nW)/testset1: pmemobj_open: error: a bad block recovery file exists, run 'pmempool sync --bad-blocks' utility to try to recover the pool: Invalid argument $(nW)/testset1: synchronized replica 0: checking shutdown state diff --git a/src/test/pmempool_sync/out40.log.match b/src/test/pmempool_sync/out40.log.match index f6f35d8b81414efa7e1f8d708faaf654c86e81e7..da9b663d0e7cb638584f18728bf4ada5f2aa7bd4 100644 --- a/src/test/pmempool_sync/out40.log.match +++ b/src/test/pmempool_sync/out40.log.match @@ -1,9 +1,9 @@ create($(nW)/testset1): allocating records in the pool ... create($(nW)/testset1): allocated $(N) records (of size $(N)) verify($(nW)/testset1): pool file successfully verified ($(N) records of size $(N)) - "badblock_count":1, + "badblock_count":8, "offset":$(N), - "length":1, + "length":8, Poolset structure: Number of replicas : 2 Replica 0 (master) - local, 3 part(s): @@ -13,7 +13,7 @@ type : regular file size : $(N) bad blocks: offset length - 1000 2 + 1000 8 part 1: path : $(nW)/testfile1 type : regular file @@ -56,12 +56,12 @@ Heap offset : $(nW) Heap size : $(nW) Checksum : $(*) Root offset : $(nW) - "badblock_count":1, + "badblock_count":8, "offset":$(N), - "length":1, - "badblock_count":1, + "length":8, + "badblock_count":8, "offset":$(N), - "length":1, + "length":8, $(nW)/testset1: pmemobj_open: error: a bad block recovery file exists, run 'pmempool sync --bad-blocks' utility to try to recover the pool: Invalid argument $(nW)/testset1: synchronized replica 0: checking shutdown state diff --git a/src/test/pmempool_sync/out41.log.match b/src/test/pmempool_sync/out41.log.match index 0880839a2632eae98605da601a5195916b03806f..7438695b928f353015ba1d8fb522e3e951fb0e13 100644 --- a/src/test/pmempool_sync/out41.log.match +++ b/src/test/pmempool_sync/out41.log.match @@ -1,9 +1,9 @@ create($(nW)/testset1): allocating records in the pool ... create($(nW)/testset1): allocated $(N) records (of size $(N)) verify($(nW)/testset1): pool file successfully verified ($(N) records of size $(N)) - "badblock_count":1, + "badblock_count":8, "offset":$(N), - "length":1, + "length":8, Poolset structure: Number of replicas : 2 Replica 0 (master) - local, 3 part(s): @@ -17,7 +17,7 @@ type : regular file size : $(N) bad blocks: offset length - 1000 2 + 1000 8 part 2: path : $(nW)/testfile2 type : regular file @@ -56,12 +56,12 @@ Heap offset : $(nW) Heap size : $(nW) Checksum : $(*) Root offset : $(nW) - "badblock_count":1, + "badblock_count":8, "offset":$(N), - "length":1, - "badblock_count":1, + "length":8, + "badblock_count":8, "offset":$(N), - "length":1, + "length":8, $(nW)/testset1: pmemobj_open: error: a bad block recovery file exists, run 'pmempool sync --bad-blocks' utility to try to recover the pool: Invalid argument $(nW)/testset1: synchronized replica 0: checking shutdown state diff --git a/src/test/pmempool_sync_remote/TEST22 b/src/test/pmempool_sync_remote/TEST22 index 2ae64ed82926d0fa9e45c9092e8f433d8b5c105a..ab2a48468c04e3ab8e0b416768283cb2614c4adf 100755 --- a/src/test/pmempool_sync_remote/TEST22 +++ b/src/test/pmempool_sync_remote/TEST22 @@ -106,11 +106,11 @@ FILE=${MOUNT_DIR}/pool.local FIRST_SECTOR=$(expect_normal_exit run_on_node 0 ../extents $FILE -l 0) ndctl_inject_error_node 0 $NAMESPACE $FIRST_SECTOR 1 -expect_bad_blocks_node 0 +expect_bad_blocks_node 0 $NAMESPACE expect_abnormal_exit run_on_node 0 "../obj_verify ${NODE_DIR[0]}$POOLSET_LOCAL $LAYOUT v &>> $LOG" -expect_bad_blocks_node 0 +expect_bad_blocks_node 0 $NAMESPACE 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" diff --git a/src/test/pmempool_sync_remote/TEST23 b/src/test/pmempool_sync_remote/TEST23 index e773d00e55b5d2dfc2ed3f22c794a8c6b7cdf493..d523115b8a01b43815940fab170b4e5790020263 100755 --- a/src/test/pmempool_sync_remote/TEST23 +++ b/src/test/pmempool_sync_remote/TEST23 @@ -106,11 +106,11 @@ FILE=${MOUNT_DIR}/pool.local FIRST_SECTOR=$(expect_normal_exit run_on_node 0 ../extents $FILE -l 1000) ndctl_inject_error_node 0 $NAMESPACE $FIRST_SECTOR 1 -expect_bad_blocks_node 0 +expect_bad_blocks_node 0 $NAMESPACE expect_abnormal_exit run_on_node 0 "../obj_verify ${NODE_DIR[0]}$POOLSET_LOCAL $LAYOUT v &>> $LOG" -expect_bad_blocks_node 0 +expect_bad_blocks_node 0 $NAMESPACE 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" diff --git a/src/test/pmempool_sync_remote/TEST24 b/src/test/pmempool_sync_remote/TEST24 index b5193266b11e9093257861fc3329118697e9f23e..01818e56f29b23dd647e87be3c79a2eaa8c2fa0b 100755 --- a/src/test/pmempool_sync_remote/TEST24 +++ b/src/test/pmempool_sync_remote/TEST24 @@ -111,11 +111,11 @@ FIRST_SECTOR=$(expect_normal_exit run_on_node 0 ../extents $FILE -l 0) ndctl_inject_error_node 0 $NAMESPACE $FIRST_SECTOR 1 -expect_bad_blocks_node 0 +expect_bad_blocks_node 0 $NAMESPACE expect_abnormal_exit run_on_node 0 "../obj_verify ${NODE_DIR[0]}$POOLSET_LOCAL $LAYOUT v &>> $LOG" -expect_bad_blocks_node 0 +expect_bad_blocks_node 0 $NAMESPACE 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" diff --git a/src/test/pmempool_sync_remote/TEST25 b/src/test/pmempool_sync_remote/TEST25 index 28d6ab615feb45ef17b5da4ea147a591d73203d6..3287faf890e07bf0f77a368fbdd5d3e8ce3c7cb0 100755 --- a/src/test/pmempool_sync_remote/TEST25 +++ b/src/test/pmempool_sync_remote/TEST25 @@ -110,11 +110,11 @@ FIRST_SECTOR=$(expect_normal_exit run_on_node 0 ../extents $FILE -l 1000) ndctl_inject_error_node 0 $NAMESPACE $FIRST_SECTOR 1 -expect_bad_blocks_node 0 +expect_bad_blocks_node 0 $NAMESPACE expect_abnormal_exit run_on_node 0 "../obj_verify ${NODE_DIR[0]}$POOLSET_LOCAL $LAYOUT v &>> $LOG" -expect_bad_blocks_node 0 +expect_bad_blocks_node 0 $NAMESPACE 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" diff --git a/src/test/pmempool_sync_remote/TEST32 b/src/test/pmempool_sync_remote/TEST32 index 88379b03f4bb98eae8942e72f7ffd37b9444f80a..b2ecbb8f0ef9606be3f44f6857a0516fe0bcde69 100755 --- a/src/test/pmempool_sync_remote/TEST32 +++ b/src/test/pmempool_sync_remote/TEST32 @@ -120,11 +120,11 @@ 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 +expect_bad_blocks_node 0 $NAMESPACE expect_abnormal_exit run_on_node 0 "../obj_verify ${NODE_DIR[0]}$POOLSET_LOCAL $LAYOUT v &>> $LOG" -expect_bad_blocks_node 0 +expect_bad_blocks_node 0 $NAMESPACE 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" diff --git a/src/test/pmempool_sync_remote/TEST33 b/src/test/pmempool_sync_remote/TEST33 index a8adf9e2e73132646d305d8275e7ec1728817e66..2a7c3a268d96d1b7a1c11651f466a6952f107453 100755 --- a/src/test/pmempool_sync_remote/TEST33 +++ b/src/test/pmempool_sync_remote/TEST33 @@ -120,11 +120,11 @@ 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 +expect_bad_blocks_node 0 $NAMESPACE expect_abnormal_exit run_on_node 0 "../obj_verify ${NODE_DIR[0]}$POOLSET_LOCAL $LAYOUT v &>> $LOG" -expect_bad_blocks_node 0 +expect_bad_blocks_node 0 $NAMESPACE 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" diff --git a/src/test/pmempool_sync_remote/TEST34 b/src/test/pmempool_sync_remote/TEST34 index e5a7b6cab22a162b2631a66de715942047bec4ee..3795e7d93f70d80dab55b53a8eac0e250fcc83b1 100755 --- a/src/test/pmempool_sync_remote/TEST34 +++ b/src/test/pmempool_sync_remote/TEST34 @@ -110,12 +110,12 @@ FIRST_SECTOR=$(expect_normal_exit run_on_node 1 ../extents $FILE -l 0) ndctl_inject_error_node 1 $NAMESPACE $FIRST_SECTOR 1 -expect_bad_blocks_node 1 +expect_bad_blocks_node 1 $NAMESPACE # verification should fail expect_abnormal_exit run_on_node 0 "../obj_verify ${NODE_DIR[0]}/$POOLSET_LOCAL $LAYOUT v &>> $LOG" -expect_bad_blocks_node 1 +expect_bad_blocks_node 1 $NAMESPACE # the remote replica contains bad blocks, so it cannot be opened and will be recreated expect_normal_exit run_on_node 0 "../pmempool sync -b -v ${NODE_DIR[0]}/$POOLSET_LOCAL &>> $LOG" diff --git a/src/test/pmempool_sync_remote/TEST35 b/src/test/pmempool_sync_remote/TEST35 index 2a2733cd529e61233bb49149560b4a41fb592dc9..f8e896dbf5b1fff45753c0153de693401c82c35c 100755 --- a/src/test/pmempool_sync_remote/TEST35 +++ b/src/test/pmempool_sync_remote/TEST35 @@ -110,12 +110,12 @@ FIRST_SECTOR=$(expect_normal_exit run_on_node 1 ../extents $FILE -l 1000) ndctl_inject_error_node 1 $NAMESPACE $FIRST_SECTOR 1 -expect_bad_blocks_node 1 +expect_bad_blocks_node 1 $NAMESPACE # verification should fail expect_abnormal_exit run_on_node 0 "../obj_verify ${NODE_DIR[0]}/$POOLSET_LOCAL $LAYOUT v &>> $LOG" -expect_bad_blocks_node 1 +expect_bad_blocks_node 1 $NAMESPACE # the remote replica contains bad blocks, so it cannot be opened and will be recreated expect_normal_exit run_on_node 0 "../pmempool sync -b -v ${NODE_DIR[0]}/$POOLSET_LOCAL &>> $LOG" diff --git a/src/test/pmempool_transform/out18.log.match b/src/test/pmempool_transform/out18.log.match index 8fc845fc3f49f88433df147dce7285fcdfb67177..4b5fa80a884f24fac5776659ce0a2fbd642be2ac 100644 --- a/src/test/pmempool_transform/out18.log.match +++ b/src/test/pmempool_transform/out18.log.match @@ -29,12 +29,12 @@ part 0: path : $(nW) type : device dax size : $(nW) -alignment : 4096 +alignment : $(N) part 1: path : $(nW) type : device dax size : $(nW) -alignment : 4096 +alignment : $(N) Replica 1 - local, 2 part(s): part 0: path : $(nW)part00 diff --git a/src/test/pmempool_transform_remote/node_0_out11.log.match b/src/test/pmempool_transform_remote/node_0_out11.log.match index 6a26682bf67004e88fa3c1f575f1b4d01fc0eb6d..bfd51b85c2658c08bd255a6f0a7533d8403bb028 100644 --- a/src/test/pmempool_transform_remote/node_0_out11.log.match +++ b/src/test/pmempool_transform_remote/node_0_out11.log.match @@ -2,7 +2,7 @@ Part file: path : $(nW) type : device dax size : $(nW) -alignment : 4096 +alignment : $(N) POOL Header: Signature : PMEMOBJ [part file] diff --git a/src/test/pmempool_transform_remote/node_0_out6.log.match b/src/test/pmempool_transform_remote/node_0_out6.log.match index 6a26682bf67004e88fa3c1f575f1b4d01fc0eb6d..bfd51b85c2658c08bd255a6f0a7533d8403bb028 100644 --- a/src/test/pmempool_transform_remote/node_0_out6.log.match +++ b/src/test/pmempool_transform_remote/node_0_out6.log.match @@ -2,7 +2,7 @@ Part file: path : $(nW) type : device dax size : $(nW) -alignment : 4096 +alignment : $(N) POOL Header: Signature : PMEMOBJ [part file] diff --git a/src/test/pmempool_transform_remote/node_0_out7.log.match b/src/test/pmempool_transform_remote/node_0_out7.log.match index 6a26682bf67004e88fa3c1f575f1b4d01fc0eb6d..bfd51b85c2658c08bd255a6f0a7533d8403bb028 100644 --- a/src/test/pmempool_transform_remote/node_0_out7.log.match +++ b/src/test/pmempool_transform_remote/node_0_out7.log.match @@ -2,7 +2,7 @@ Part file: path : $(nW) type : device dax size : $(nW) -alignment : 4096 +alignment : $(N) POOL Header: Signature : PMEMOBJ [part file] diff --git a/src/test/pmempool_transform_remote/node_1_out13.log.match b/src/test/pmempool_transform_remote/node_1_out13.log.match index b8cd08e3a4bbea17216b9963762e3ea90b9899e9..00dc688da5e69b3bfc5b20fb0fb00f265de7a2b9 100644 --- a/src/test/pmempool_transform_remote/node_1_out13.log.match +++ b/src/test/pmempool_transform_remote/node_1_out13.log.match @@ -5,12 +5,12 @@ part 0: path : $(nW) type : device dax size : $(nW) -alignment : 4096 +alignment : $(N) part 1: path : $(nW) type : device dax size : $(nW) -alignment : 4096 +alignment : $(N) Replica 1 - remote: node : $(nW) pool set : poolset.remote @@ -45,7 +45,7 @@ Part file: path : $(nW) type : device dax size : $(nW) -alignment : 4096 +alignment : $(N) POOL Header: Signature : PMEMOBJ [part file] diff --git a/src/test/pmempool_transform_remote/node_1_out15.log.match b/src/test/pmempool_transform_remote/node_1_out15.log.match index c0d86e35493615ff7a2c1839f63ee12e49e92618..0290e5c6f36ad19bf6191ae9a69d445d64b65341 100644 --- a/src/test/pmempool_transform_remote/node_1_out15.log.match +++ b/src/test/pmempool_transform_remote/node_1_out15.log.match @@ -5,12 +5,12 @@ part 0: path : $(nW) type : device dax size : $(nW) -alignment : 4096 +alignment : $(N) part 1: path : $(nW) type : device dax size : $(nW) -alignment : 4096 +alignment : $(N) Poolset options: SINGLEHDR @@ -42,7 +42,7 @@ Part file: path : $(nW) type : device dax size : $(nW) -alignment : 4096 +alignment : $(N) POOL Header: Signature : PMEMOBJ diff --git a/src/test/pmempool_transform_remote/node_1_out19.log.match b/src/test/pmempool_transform_remote/node_1_out19.log.match index c0d86e35493615ff7a2c1839f63ee12e49e92618..0290e5c6f36ad19bf6191ae9a69d445d64b65341 100644 --- a/src/test/pmempool_transform_remote/node_1_out19.log.match +++ b/src/test/pmempool_transform_remote/node_1_out19.log.match @@ -5,12 +5,12 @@ part 0: path : $(nW) type : device dax size : $(nW) -alignment : 4096 +alignment : $(N) part 1: path : $(nW) type : device dax size : $(nW) -alignment : 4096 +alignment : $(N) Poolset options: SINGLEHDR @@ -42,7 +42,7 @@ Part file: path : $(nW) type : device dax size : $(nW) -alignment : 4096 +alignment : $(N) POOL Header: Signature : PMEMOBJ diff --git a/src/test/pmempool_transform_remote/node_1_out6.log.match b/src/test/pmempool_transform_remote/node_1_out6.log.match index b8cd08e3a4bbea17216b9963762e3ea90b9899e9..00dc688da5e69b3bfc5b20fb0fb00f265de7a2b9 100644 --- a/src/test/pmempool_transform_remote/node_1_out6.log.match +++ b/src/test/pmempool_transform_remote/node_1_out6.log.match @@ -5,12 +5,12 @@ part 0: path : $(nW) type : device dax size : $(nW) -alignment : 4096 +alignment : $(N) part 1: path : $(nW) type : device dax size : $(nW) -alignment : 4096 +alignment : $(N) Replica 1 - remote: node : $(nW) pool set : poolset.remote @@ -45,7 +45,7 @@ Part file: path : $(nW) type : device dax size : $(nW) -alignment : 4096 +alignment : $(N) POOL Header: Signature : PMEMOBJ [part file] diff --git a/src/test/pmempool_transform_remote/node_1_out8.log.match b/src/test/pmempool_transform_remote/node_1_out8.log.match index b8cd08e3a4bbea17216b9963762e3ea90b9899e9..00dc688da5e69b3bfc5b20fb0fb00f265de7a2b9 100644 --- a/src/test/pmempool_transform_remote/node_1_out8.log.match +++ b/src/test/pmempool_transform_remote/node_1_out8.log.match @@ -5,12 +5,12 @@ part 0: path : $(nW) type : device dax size : $(nW) -alignment : 4096 +alignment : $(N) part 1: path : $(nW) type : device dax size : $(nW) -alignment : 4096 +alignment : $(N) Replica 1 - remote: node : $(nW) pool set : poolset.remote @@ -45,7 +45,7 @@ Part file: path : $(nW) type : device dax size : $(nW) -alignment : 4096 +alignment : $(N) POOL Header: Signature : PMEMOBJ [part file] diff --git a/src/test/pmempool_transform_remote/node_1_out9.log.match b/src/test/pmempool_transform_remote/node_1_out9.log.match index 30fcba6f54bff7fb0cec2fbf72751017e3a80a74..aff27d34ca3d111de2936ab51e03ec1d5800688f 100644 --- a/src/test/pmempool_transform_remote/node_1_out9.log.match +++ b/src/test/pmempool_transform_remote/node_1_out9.log.match @@ -5,7 +5,7 @@ part 0: path : $(nW) type : device dax size : $(nW) -alignment : 4096 +alignment : $(N) part 1: path : $(nW) type : device dax @@ -45,7 +45,7 @@ Part file: path : $(nW) type : device dax size : $(nW) -alignment : 4096 +alignment : $(N) POOL Header: Signature : PMEMOBJ [part file] diff --git a/src/test/test_debug.props b/src/test/test_debug.props index 5b66e12521228f531ab9370fde81065a60504694..4e72b8ea7ee289b40d1030a9989b905ff4008c62 100644 --- a/src/test/test_debug.props +++ b/src/test/test_debug.props @@ -6,6 +6,7 @@ <PropertyGroup Label="UserMacros" /> <PropertyGroup> <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\tests\</OutDir> + <ExecutablePath>$(FrameworkSDKdir)bin\$(TargetPlatformVersion)\$(Platform);$(ExecutablePath)</ExecutablePath> </PropertyGroup> <ItemDefinitionGroup> <ClCompile> @@ -26,4 +27,4 @@ <SubSystem>Console</SubSystem> </Link> </ItemDefinitionGroup> -</Project> +</Project> \ No newline at end of file diff --git a/src/test/test_release.props b/src/test/test_release.props index a582b3e32343070bd70560bf62764099d1ba6d88..cdb33224ae802eb5ece9b7a1103007b6ac7b7d3e 100644 --- a/src/test/test_release.props +++ b/src/test/test_release.props @@ -6,6 +6,7 @@ <PropertyGroup Label="UserMacros" /> <PropertyGroup> <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\tests\</OutDir> + <ExecutablePath>$(FrameworkSDKdir)bin\$(TargetPlatformVersion)\$(Platform);$(ExecutablePath)</ExecutablePath> </PropertyGroup> <ItemDefinitionGroup> <ClCompile> @@ -22,4 +23,4 @@ <SubSystem>Console</SubSystem> </Link> </ItemDefinitionGroup> -</Project> +</Project> \ No newline at end of file diff --git a/src/test/unittest/unittest.sh b/src/test/unittest/unittest.sh index c9ff03a4a13a4b7745afefcc50e724a1b90b6c59..aa3e8adf036dd6f4c8448ed22bb85a84fcf0687a 100644 --- a/src/test/unittest/unittest.sh +++ b/src/test/unittest/unittest.sh @@ -2036,14 +2036,14 @@ function is_ndctl_ge_63() { } # -# require_user_bb -- checks if the binary has support for unprivileged -# bad block iteration +# require_bb_enabled_by_default -- check if the binary has bad block +# checking feature enabled by default # -# usage: require_user_bb <binary> +# usage: require_bb_enabled_by_default <binary> # -function require_user_bb() { +function require_bb_enabled_by_default() { if ! is_ndctl_ge_63 $1 &> /dev/null ; then - msg "$UNITTEST_NAME: SKIP unprivileged bad block iteration not supported" + msg "$UNITTEST_NAME: SKIP bad block checking feature disabled by default" exit 0 fi @@ -2051,14 +2051,14 @@ function require_user_bb() { } # -# require_su_bb -- checks if the binary does not have support for -# unprivileged bad block iteration +# require_bb_disabled_by_default -- check if the binary does not have bad +# block checking feature enabled by default # -# usage: require_su_bb <binary> +# usage: require_bb_disabled_by_default <binary> # -function require_su_bb() { +function require_bb_disabled_by_default() { if is_ndctl_ge_63 $1 &> /dev/null ; then - msg "$UNITTEST_NAME: SKIP unprivileged bad block iteration supported" + msg "$UNITTEST_NAME: SKIP bad block checking feature enabled by default" exit 0 fi return 0 @@ -3594,6 +3594,20 @@ function require_max_devdax_size() { fi } +# +# require_max_block_size -- checks that block size is smaller or equal than requested +# +# usage: require_max_block_size <file> <max-block-size> +# +function require_max_block_size() { + cur_sz=$(stat --file-system --format=%S $1) + max_size=$2 + if [ $cur_sz -gt $max_size ]; then + msg "$UNITTEST_NAME: SKIP: block size of $1 is too big for this test (max $2 required)" + exit 0 + fi +} + # # require_badblock_tests_enabled - check if tests for bad block support are not enabled # Input arguments: @@ -3602,16 +3616,18 @@ function require_max_devdax_size() { function require_badblock_tests_enabled() { require_sudo_allowed require_command ndctl + require_bb_enabled_by_default $PMEMPOOL$EXESUFFIX 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 + # used directly - no device dax path is needed to be provided by the + # user. Some tests though may use an additional filesystem for the + # pool replica - hence 'any' filesystem is required. if [ $1 == "dax_device" ]; then - require_fs_type none + require_fs_type any # nfit_test block device is created by the test and mounted on # a filesystem of any type provided by the user @@ -3622,7 +3638,7 @@ function require_badblock_tests_enabled() { elif [ "$BADBLOCK_TEST_TYPE" == "real_pmem" ]; then if [ $1 == "dax_device" ]; then - require fs_type none + require_fs_type any require_dax_devices 1 require_binary $DAXIO$EXESUFFIX @@ -3643,6 +3659,8 @@ function require_badblock_tests_enabled() { function require_badblock_tests_enabled_node() { require_sudo_allowed_node $1 require_command_node $1 ndctl + require_bb_enabled_by_default $PMEMPOOL$EXESUFFIX + if [ "$BADBLOCK_TEST_TYPE" == "nfit_test" ]; then require_kernel_module_node $1 nfit_test elif [ "$BADBLOCK_TEST_TYPE" == "real_pmem" ]; then diff --git a/src/test/util_badblock/TEST3 b/src/test/util_badblock/TEST3 index 67a54adab8a928180b49197a68e1049008dba931..4e1f1fc8c78f8fcb5ff9b35cda5adc606be9a0cf 100755 --- a/src/test/util_badblock/TEST3 +++ b/src/test/util_badblock/TEST3 @@ -53,7 +53,7 @@ badblock_test_init dax_device # inject bad block: OFF=11 LEN=1 ndctl_inject_error $NAMESPACE 11 1 -expect_bad_blocks +expect_bad_blocks $NAMESPACE expect_normal_exit ./util_badblock$EXESUFFIX $FULLDEV l diff --git a/src/test/util_badblock/TEST4 b/src/test/util_badblock/TEST4 index b7c50ff3e56dab612302b262b44e7710fdded3f9..e9478455a62569a8b0b1e0dc9c9f783259263432 100755 --- a/src/test/util_badblock/TEST4 +++ b/src/test/util_badblock/TEST4 @@ -54,7 +54,7 @@ badblock_test_init dax_device # inject bad block: OFF=11 LEN=1 ndctl_inject_error $NAMESPACE 11 1 -expect_bad_blocks +expect_bad_blocks $NAMESPACE expect_normal_exit ./util_badblock$EXESUFFIX $FULLDEV l c l diff --git a/src/test/util_badblock/TEST6 b/src/test/util_badblock/TEST6 index 93c68e4bd16f45a7d487e6f8d56add7fb8c03b2b..3b1501da7fb961bb8b2606f302f08cc87524c74b 100755 --- a/src/test/util_badblock/TEST6 +++ b/src/test/util_badblock/TEST6 @@ -58,7 +58,7 @@ fallocate -l 1M $FILE FIRST_SECTOR=$(expect_normal_exit $EXTENTS $FILE -l 0) ndctl_inject_error $NAMESPACE $FIRST_SECTOR 1 -expect_bad_blocks +expect_bad_blocks $NAMESPACE expect_normal_exit ./util_badblock$EXESUFFIX $FILE l diff --git a/src/test/util_badblock/TEST7 b/src/test/util_badblock/TEST7 index 2c1b7e833078e3b35997e44962cdcc452952e7d4..0d0e3a0091a420da0f6c745288f0577894946429 100755 --- a/src/test/util_badblock/TEST7 +++ b/src/test/util_badblock/TEST7 @@ -59,7 +59,7 @@ fallocate -l 1M $FILE FIRST_SECTOR=$(expect_normal_exit $EXTENTS $FILE -l 0) ndctl_inject_error $NAMESPACE $FIRST_SECTOR 1 -expect_bad_blocks +expect_bad_blocks $NAMESPACE enable_log_append diff --git a/src/test/util_badblock/TEST8 b/src/test/util_badblock/TEST8 index 03b47cf4fc8b5dd250eff077194722d54424df30..097685a25a629eb6668ff4221a0db52e27c9b4c1 100755 --- a/src/test/util_badblock/TEST8 +++ b/src/test/util_badblock/TEST8 @@ -58,7 +58,7 @@ turn_on_checking_bad_blocks $FULLDEV # inject bad block: OFF=11 LEN=1 ndctl_inject_error $NAMESPACE 11 1 -expect_bad_blocks +expect_bad_blocks $NAMESPACE # open a pool with bad blocks expect_abnormal_exit ./util_badblock$EXESUFFIX $FULLDEV o diff --git a/src/test/util_badblock/TEST9 b/src/test/util_badblock/TEST9 index fb07e60b03a17e8e5adf8d4e3ea452fd4bd6d786..d5ce264f151c71c073c5c9597dab35c09bf10dad 100755 --- a/src/test/util_badblock/TEST9 +++ b/src/test/util_badblock/TEST9 @@ -63,7 +63,7 @@ turn_on_checking_bad_blocks $FILE FIRST_SECTOR=$(expect_normal_exit $EXTENTS $FILE -l 0) ndctl_inject_error $NAMESPACE $FIRST_SECTOR 1 -expect_bad_blocks +expect_bad_blocks $NAMESPACE # open a pool with bad blocks expect_abnormal_exit ./util_badblock$EXESUFFIX $FILE o diff --git a/src/windows/libs_debug.props b/src/windows/libs_debug.props index 322d76a971b6f93024375cc87dc235fa365d9f6f..ff51c482a61ae9499fac9acc140a6ba19d2d74f2 100644 --- a/src/windows/libs_debug.props +++ b/src/windows/libs_debug.props @@ -4,6 +4,7 @@ <PropertyGroup Label="UserMacros" /> <PropertyGroup> <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\libs\</OutDir> + <ExecutablePath>$(FrameworkSDKdir)bin\$(TargetPlatformVersion)\$(Platform);$(ExecutablePath)</ExecutablePath> </PropertyGroup> <ItemDefinitionGroup> <ClCompile> @@ -30,4 +31,4 @@ <AdditionalIncludeDirectories>$(SolutionDir)\common;$(SolutionDir)\windows\include</AdditionalIncludeDirectories> </ResourceCompile> </ItemDefinitionGroup> -</Project> +</Project> \ No newline at end of file diff --git a/src/windows/libs_release.props b/src/windows/libs_release.props index 5bbbfd4e0bc38891869a38ceac228b6c370bb1c6..a2c6389b100eb17d9229aa951324e24907777aca 100644 --- a/src/windows/libs_release.props +++ b/src/windows/libs_release.props @@ -4,6 +4,7 @@ <PropertyGroup Label="UserMacros" /> <PropertyGroup> <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\libs\</OutDir> + <ExecutablePath>$(FrameworkSDKdir)bin\$(TargetPlatformVersion)\$(Platform);$(ExecutablePath)</ExecutablePath> </PropertyGroup> <ItemDefinitionGroup> <ClCompile> @@ -32,4 +33,4 @@ <AdditionalIncludeDirectories>$(SolutionDir)\common;$(SolutionDir)\windows\include</AdditionalIncludeDirectories> </ResourceCompile> </ItemDefinitionGroup> -</Project> +</Project> \ No newline at end of file