diff --git a/ChangeLog b/ChangeLog index 16ce20dc93d..9e003fd0aba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ This release: - removes libpmempool API tests that use log/blk/btt pool types (partially) + - removes btt specific test and related btt tests tools + - remove btt support from pmemspoil - ... Wed May 31 2023 Oksana Sałyk diff --git a/src/test/Makefile b/src/test/Makefile index 6ceb5f2a783..8b85b3d581d 100644 --- a/src/test/Makefile +++ b/src/test/Makefile @@ -126,7 +126,6 @@ OBJ_TESTS = \ OTHER_TESTS = \ arch_flags\ - bttdevice\ checksum\ compat_incompat_features\ ctl_prefault\ @@ -248,10 +247,8 @@ LIBPMEMPOOL_DEPS = \ LIBPMEMPOOL_TESTS = \ libpmempool_include\ libpmempool_backup\ - libpmempool_bttdev\ libpmempool_check_version\ libpmempool_feature\ - libpmempool_map_flog\ libpmempool_rm LIBPMEMPOOL_MOD_DEPS = \ diff --git a/src/test/Makefile.inc b/src/test/Makefile.inc index e38f5d0bb6b..057a3bd07d3 100644 --- a/src/test/Makefile.inc +++ b/src/test/Makefile.inc @@ -658,13 +658,6 @@ ifeq ($(USE_PMEMSPOIL), y) all: $(TOOLS)/pmemspoil/pmemspoil endif -$(TOOLS)/bttcreate/bttcreate: - $(MAKE) -C $(TOOLS)/bttcreate all - -ifeq ($(USE_BTTCREATE), y) -all: $(TOOLS)/bttcreate/bttcreate -endif - $(TOOLS)/pmemwrite/pmemwrite: $(MAKE) -C $(TOOLS)/pmemwrite all diff --git a/src/test/bttdevice/Makefile b/src/test/bttdevice/Makefile deleted file mode 100644 index 2a7832cc0a3..00000000000 --- a/src/test/bttdevice/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016, Intel Corporation - -# -# src/test/bttdevice/Makefile -- build unittest for testing tools operating -# on btt device -# -USE_PMEMSPOIL=y -USE_BTTCREATE=y - -include ../Makefile.inc diff --git a/src/test/bttdevice/README b/src/test/bttdevice/README deleted file mode 100644 index fa28ea2397e..00000000000 --- a/src/test/bttdevice/README +++ /dev/null @@ -1,9 +0,0 @@ -Persistent Memory Development Kit - -This is src/test/bttdevice/README. - -This directory contains a unit test for tools that use btt device. - -The tests in this directory verify the creation of btt pool, -support for corrupting the pool in pmemspoil tool and analyzing -the pool by pmempool info. diff --git a/src/test/bttdevice/TEST0 b/src/test/bttdevice/TEST0 deleted file mode 100755 index 96b0092419e..00000000000 --- a/src/test/bttdevice/TEST0 +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2018, Intel Corporation -# -# -# bttdevice/TEST0 -- test for checking bttcreate tool -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_fs_type any - -setup - -POOL=$DIR/file.pool -LOG=out${UNITTEST_NUM}.log -rm -f $LOG && touch $LOG - -echo "Create btt device - uuid defined by the user" >> $LOG -expect_normal_exit $BTTCREATE -s 20M -b 1K -l 256 \ - -u "9047cad6-53e1-4ba8-bcdd-a9fb411f7392" -v $POOL >> $LOG - -expect_normal_exit $PMEMPOOL$EXESUFFIX info $POOL >> $LOG -check_file $POOL -rm -f $POOL - -echo -e "\nCreate btt device - automatic uuid generation" >> $LOG -expect_normal_exit $BTTCREATE -s 40M -b 2K -l 256 -v $POOL >> $LOG - -expect_normal_exit $PMEMPOOL$EXESUFFIX info $POOL >> $LOG -check_file $POOL - -check - -pass diff --git a/src/test/bttdevice/TEST1 b/src/test/bttdevice/TEST1 deleted file mode 100755 index 025832fa6c5..00000000000 --- a/src/test/bttdevice/TEST1 +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2018, Intel Corporation -# -# -# bttdevice/TEST1 -- test for checking pmempool info for spoiled btt device -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_fs_type any - -setup - -POOL=$DIR/file.pool -LOG=out${UNITTEST_NUM}.log -rm -f $LOG && touch $LOG - -expect_normal_exit $BTTCREATE -v $POOL >> $LOG - -$PMEMSPOIL -v $POOL "bttdevice.arena(0).btt_info.sig=BADSIGNATURE"\ - "bttdevice.arena(0).btt_info.external_lbasize=10"\ - "bttdevice.arena(0).btt_info.major=0x0" >> $LOG - -expect_normal_exit $PMEMPOOL$EXESUFFIX info $POOL -f btt >> $LOG -check_file $POOL - -check - -pass diff --git a/src/test/bttdevice/out0.log.match b/src/test/bttdevice/out0.log.match deleted file mode 100644 index db9890213f8..00000000000 --- a/src/test/bttdevice/out0.log.match +++ /dev/null @@ -1,67 +0,0 @@ -Create btt device - uuid defined by the user -BTT successfully created: $(nW) -poolsize 20971520B -blocksize 1024B -maxlanes 256 -uuid 9047cad6-53e1-4ba8-bcdd-a9fb411f7392 - - -BTT Device -[ARENA 0] -PMEM BLK BTT Info Header: -Signature : BTT_ARENA_INFO -UUID of container : 9047cad6-53e1-4ba8-bcdd-a9fb411f7392 -Flags : 0x0 -Major : 1 -Minor : 1 -External LBA size : 1024 -$(OPT)External LBA count : 20112 -$(OPX)External LBA count : 20052 -Internal LBA size : 1024 -$(OPT)Internal LBA count : 20368 -$(OPX)Internal LBA count : 20308 -Free blocks : 256 -Info block size : 4096 -Next arena offset : 0x0 -Arena data offset : 0x1000 -$(OPT)Area map offset : 0x13e6000 -$(OPX)Area map offset : 0x13d7000 -$(OPT)Area flog offset : 0x13fa000 -$(OPX)Area flog offset : 0x13eb000 -$(OPT)Info block backup offset : 0x13fe000 -$(OPX)Info block backup offset : 0x13ef000 -Checksum : $(XX) [OK] - -Create btt device - automatic uuid generation -BTT successfully created: $(nW) -poolsize 41943040B -blocksize 2048B -maxlanes 256 -uuid $(nW) - - -BTT Device -[ARENA 0] -PMEM BLK BTT Info Header: -Signature : BTT_ARENA_INFO -UUID of container : $(nW) -Flags : 0x0 -Major : 1 -Minor : 1 -External LBA size : 2048 -$(OPT)External LBA count : 20168 -$(OPX)External LBA count : 20138 -Internal LBA size : 2048 -$(OPT)Internal LBA count : 20424 -$(OPX)Internal LBA count : 20394 -Free blocks : 256 -Info block size : 4096 -Next arena offset : 0x0 -Arena data offset : 0x1000 -$(OPT)Area map offset : 0x27e6000 -$(OPX)Area map offset : 0x27d7000 -$(OPT)Area flog offset : 0x27fa000 -$(OPX)Area flog offset : 0x27eb000 -$(OPT)Info block backup offset : 0x27fe000 -$(OPX)Info block backup offset : 0x27ef000 -Checksum : $(XX) [OK] diff --git a/src/test/bttdevice/out1.log.match b/src/test/bttdevice/out1.log.match deleted file mode 100644 index db930a8f1ea..00000000000 --- a/src/test/bttdevice/out1.log.match +++ /dev/null @@ -1,35 +0,0 @@ -BTT successfully created: $(nW) -poolsize 20971520B -blocksize 512B -maxlanes 256 -uuid $(nW) - -$(nW): spoil: bttdevice.arena(0).btt_info.sig=BADSIGNATURE -$(nW): spoil: bttdevice.arena(0).btt_info.external_lbasize=10 -$(nW): spoil: bttdevice.arena(0).btt_info.major=0x0 - -BTT Device -[ARENA 0] -PMEM BLK BTT Info Header: -Signature : BADSIGNATUREFO -UUID of container : $(nW) -Flags : 0x0 -Major : 0 -Minor : 1 -External LBA size : 10 -$(OPT)External LBA count : 40322 -$(OPX)External LBA count : 40203 -Internal LBA size : 512 -$(OPT)Internal LBA count : 40578 -$(OPX)Internal LBA count : 40459 -Free blocks : 256 -Info block size : 4096 -Next arena offset : 0x0 -Arena data offset : 0x1000 -$(OPT)Area map offset : 0x13d2000 -$(OPX)Area map offset : 0x13c3000 -$(OPT)Area flog offset : 0x13fa000 -$(OPX)Area flog offset : 0x13eb000 -$(OPT)Info block backup offset : 0x13fe000 -$(OPX)Info block backup offset : 0x13ef000 -Checksum : $(XX) [wrong! should be: $(XX)] diff --git a/src/test/libpmempool_api/Makefile b/src/test/libpmempool_api/Makefile index 817f8b99499..a594fc22477 100644 --- a/src/test/libpmempool_api/Makefile +++ b/src/test/libpmempool_api/Makefile @@ -1,5 +1,5 @@ # SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2019, Intel Corporation +# Copyright 2016-2023, Intel Corporation # # src/test/libpmempool_api/Makefile -- build libpmempool_api unittest @@ -11,6 +11,5 @@ OBJS = libpmempool_test.o LIBPMEMPOOL=y USE_PMEMSPOIL=y USE_PMEMWRITE=y -USE_BTTCREATE=y include ../Makefile.inc diff --git a/src/test/libpmempool_api/Makefile.inc b/src/test/libpmempool_api/Makefile.inc index f8e320c6f0b..96cb5dbf0a6 100644 --- a/src/test/libpmempool_api/Makefile.inc +++ b/src/test/libpmempool_api/Makefile.inc @@ -1,5 +1,5 @@ # SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2018, Intel Corporation +# Copyright 2016-2023, Intel Corporation # # src/test/libpmempool_api/Makefile.inc -- build libpmempool_* unittest @@ -11,6 +11,5 @@ all: ../libpmempool_api/libpmempool_test USE_PMEMSPOIL=y -USE_BTTCREATE=y include ../Makefile.inc diff --git a/src/test/libpmempool_api/libpmempool_test.c b/src/test/libpmempool_api/libpmempool_test.c index 59d49694710..f2f0f0e6e75 100644 --- a/src/test/libpmempool_api/libpmempool_test.c +++ b/src/test/libpmempool_api/libpmempool_test.c @@ -118,8 +118,6 @@ main(int argc, char *argv[]) args.pool_type = PMEMPOOL_POOL_TYPE_LOG; } else if (strcmp(optarg, "obj") == 0) { args.pool_type = PMEMPOOL_POOL_TYPE_OBJ; - } else if (strcmp(optarg, "btt") == 0) { - args.pool_type = PMEMPOOL_POOL_TYPE_BTT; } else { args.pool_type = (uint32_t)strtoul(optarg, NULL, 0); diff --git a/src/test/libpmempool_bttdev/Makefile b/src/test/libpmempool_bttdev/Makefile deleted file mode 100644 index 8ca9ae97273..00000000000 --- a/src/test/libpmempool_bttdev/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016, Intel Corporation - -# -# src/test/libpmempool_bttdev/Makefile -- build libpmempool_bttdev unittest -# - -include ../libpmempool_api/Makefile.inc diff --git a/src/test/libpmempool_bttdev/README b/src/test/libpmempool_bttdev/README deleted file mode 100644 index 1bdf8d7f8d4..00000000000 --- a/src/test/libpmempool_bttdev/README +++ /dev/null @@ -1,5 +0,0 @@ -Persistent Memory Development Kit - -This is src/test/pmempool_bttdev/README. - -This directory contains a unit test for btt device. diff --git a/src/test/libpmempool_bttdev/TEST0 b/src/test/libpmempool_bttdev/TEST0 deleted file mode 100755 index 70d3eddc572..00000000000 --- a/src/test/libpmempool_bttdev/TEST0 +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2018, Intel Corporation -# -# -# libpmempool_bttdev/TEST0 -- test for checking API -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_fs_type any - -setup - -POOL=$DIR/file.pool -LOG=out${UNITTEST_NUM}.log -rm -f $LOG && touch $LOG -EXE=../libpmempool_api/libpmempool_test - -expect_normal_exit $BTTCREATE $POOL >> $LOG - -expect_normal_exit $EXE$EXESUFFIX -r 1 -t btt $POOL >> $LOG - -check_file $POOL - -check - -pass diff --git a/src/test/libpmempool_bttdev/TEST1 b/src/test/libpmempool_bttdev/TEST1 deleted file mode 100755 index 41e2bf3f350..00000000000 --- a/src/test/libpmempool_bttdev/TEST1 +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2018, Intel Corporation -# -# -# libpmempool_bttdev/TEST1 -- test for checking btt -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_fs_type any - -setup - -POOL=$DIR/file.pool -LOG=out${UNITTEST_NUM}.log -rm -f $LOG && touch $LOG -EXE=../libpmempool_api/libpmempool_test - -expect_normal_exit $BTTCREATE $POOL >> $LOG - -$PMEMSPOIL $POOL "bttdevice.arena(0).btt_info.sig=ERROR"\ - "bttdevice.arena(0).btt_info_backup.sig=ERROR" - -expect_normal_exit $EXE$EXESUFFIX -r 1 -t btt $POOL >> $LOG - -check_file $POOL - -check - -pass diff --git a/src/test/libpmempool_bttdev/TEST10 b/src/test/libpmempool_bttdev/TEST10 deleted file mode 100755 index eb91be0052d..00000000000 --- a/src/test/libpmempool_bttdev/TEST10 +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2018, Intel Corporation -# -# -# libpmempool_bttdev/TEST10 -- test for checking btt -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_fs_type any - -setup - -POOL=$DIR/file.pool -LOG=out${UNITTEST_NUM}.log -rm -f $LOG && touch $LOG -EXE=../libpmempool_api/libpmempool_test - -expect_normal_exit $BTTCREATE $POOL >> $LOG - -$PMEMSPOIL $POOL "bttdevice.arena(0).btt_info.checksum=777"\ - "bttdevice.arena(0).btt_info.sig=ERROR"\ - "bttdevice.arena(0).btt_info_backup.checksum=777" - -expect_normal_exit $EXE$EXESUFFIX -r 1 -t btt $POOL >> $LOG - -check_file $POOL - -check - -pass diff --git a/src/test/libpmempool_bttdev/TEST11 b/src/test/libpmempool_bttdev/TEST11 deleted file mode 100755 index 55d2083db3a..00000000000 --- a/src/test/libpmempool_bttdev/TEST11 +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2021, Intel Corporation -# -# -# libpmempool_bttdev/TEST11 -- test for checking btt -# - -. ../unittest/unittest.sh - -require_test_type medium -require_fs_type any -require_unlimited_vm - -# Valgrind cannot trace more than 32G which is required for this test -configure_valgrind memcheck force-disable - -setup - -POOL=$DIR/file.pool -LOG=out${UNITTEST_NUM}.log -rm -f $LOG && touch $LOG -EXE=../libpmempool_api/libpmempool_test - -truncate -s1T $POOL -expect_normal_exit $BTTCREATE -s 1T -b 512M -t $POOL >> $LOG - -$PMEMSPOIL $POOL "bttdevice.arena(1).btt_info.checksum=777"\ - "bttdevice.arena(1).btt_info.sig=ERROR"\ - "bttdevice.arena(1).btt_info_backup.checksum=777" - -expect_normal_exit $EXE$EXESUFFIX -r 1 -t btt $POOL >> $LOG - -check_file $POOL - -check - -pass diff --git a/src/test/libpmempool_bttdev/TEST2 b/src/test/libpmempool_bttdev/TEST2 deleted file mode 100755 index f5c5e49edce..00000000000 --- a/src/test/libpmempool_bttdev/TEST2 +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2018, Intel Corporation -# -# -# libpmempool_bttdev/TEST2 -- test for checking btt -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_fs_type any - -setup - -POOL=$DIR/file.pool -LOG=out${UNITTEST_NUM}.log -LOG_TEMP=out${UNITTEST_NUM}_part.log -rm -f $LOG && touch $LOG -rm -f $LOG_TEMP && touch $LOG_TEMP -EXE=../libpmempool_api/libpmempool_test - -expect_normal_exit $BTTCREATE $POOL >> $LOG - -$PMEMSPOIL $POOL "bttdevice.arena(0).btt_info_backup.sig=ERROR" -expect_normal_exit $EXE$EXESUFFIX -r 1 -t btt $POOL >> $LOG -cat $LOG >> $LOG_TEMP - -$PMEMSPOIL $POOL "bttdevice.arena(0).btt_info.sig=ERROR" -expect_normal_exit $EXE$EXESUFFIX -r 1 -t btt $POOL >> $LOG -cat $LOG >> $LOG_TEMP - -mv $LOG_TEMP $LOG - -check_file $POOL - -check - -pass diff --git a/src/test/libpmempool_bttdev/TEST3 b/src/test/libpmempool_bttdev/TEST3 deleted file mode 100755 index 45c0d528dc9..00000000000 --- a/src/test/libpmempool_bttdev/TEST3 +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2021, Intel Corporation -# -# -# libpmempool_bttdev/TEST3 -- test for checking btt -# - -. ../unittest/unittest.sh - -require_test_type medium -require_fs_type any -require_unlimited_vm - -# Valgrind cannot trace more than 32G which is required for this test -configure_valgrind memcheck force-disable - -setup - -POOL=$DIR/file.pool -LOG=out${UNITTEST_NUM}.log -rm -f $LOG && touch $LOG -EXE=../libpmempool_api/libpmempool_test - -truncate -s1T $POOL -expect_normal_exit $BTTCREATE -s 1T -b 512M -t $POOL >> $LOG - -$PMEMSPOIL $POOL "bttdevice.arena(0).btt_info.sig=ERROR"\ - "bttdevice.arena(0).btt_info_backup.sig=ERROR"\ - "bttdevice.arena(1).btt_info_backup.sig=ERROR" - -expect_normal_exit $EXE$EXESUFFIX -r 1 -t btt $POOL >> $LOG - -check_file $POOL - -check - -pass diff --git a/src/test/libpmempool_bttdev/TEST4 b/src/test/libpmempool_bttdev/TEST4 deleted file mode 100755 index 4190eef9ce2..00000000000 --- a/src/test/libpmempool_bttdev/TEST4 +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2021, Intel Corporation -# -# -# libpmempool_bttdev/TEST4 -- test for checking btt -# - -. ../unittest/unittest.sh - -require_test_type medium -require_fs_type any -require_unlimited_vm - -# Valgrind cannot trace more than 32G which is required for this test -configure_valgrind memcheck force-disable - -setup - -POOL=$DIR/file.pool -LOG=out${UNITTEST_NUM}.log -rm -f $LOG && touch $LOG -EXE=../libpmempool_api/libpmempool_test - -truncate -s1T $POOL -expect_normal_exit $BTTCREATE -s 1T -b 512M -t $POOL >> $LOG - -$PMEMSPOIL $POOL "bttdevice.arena(0).btt_info.sig=ERROR"\ - "bttdevice.arena(0).btt_info_backup.sig=ERROR"\ - "bttdevice.arena(1).btt_info.sig=ERROR" - -expect_normal_exit $EXE$EXESUFFIX -r 1 -t btt $POOL >> $LOG - -check_file $POOL - -check - -pass diff --git a/src/test/libpmempool_bttdev/TEST5 b/src/test/libpmempool_bttdev/TEST5 deleted file mode 100755 index c3ef2f17b4f..00000000000 --- a/src/test/libpmempool_bttdev/TEST5 +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2021, Intel Corporation -# -# -# libpmempool_bttdev/TEST5 -- test for checking btt -# - -. ../unittest/unittest.sh - -require_test_type medium -require_fs_type any -require_unlimited_vm - -# Valgrind cannot trace more than 32G which is required for this test -configure_valgrind memcheck force-disable - -setup - -POOL=$DIR/file.pool -LOG=out${UNITTEST_NUM}.log -rm -f $LOG && touch $LOG -EXE=../libpmempool_api/libpmempool_test - -truncate -s1T $POOL -expect_normal_exit $BTTCREATE -s 1T -b 512M -t $POOL >> $LOG - -$PMEMSPOIL $POOL "bttdevice.arena(0).btt_info.sig=ERROR"\ - "bttdevice.arena(0).btt_info_backup.sig=ERROR"\ - "bttdevice.arena(1).btt_info.sig=ERROR"\ - "bttdevice.arena(1).btt_info_backup.sig=ERROR" - -expect_normal_exit $EXE$EXESUFFIX -r 1 -t btt $POOL >> $LOG - -check_file $POOL - -check - -pass diff --git a/src/test/libpmempool_bttdev/TEST6 b/src/test/libpmempool_bttdev/TEST6 deleted file mode 100755 index 1a05e08397a..00000000000 --- a/src/test/libpmempool_bttdev/TEST6 +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2021, Intel Corporation -# -# -# libpmempool_bttdev/TEST6 -- test for checking btt -# - -. ../unittest/unittest.sh - -require_test_type medium -require_fs_type any -require_unlimited_vm - -# Valgrind cannot trace more than 32G which is required for this test -configure_valgrind memcheck force-disable - -setup - -POOL=$DIR/file.pool -LOG=out${UNITTEST_NUM}.log -rm -f $LOG && touch $LOG -EXE=../libpmempool_api/libpmempool_test - -truncate -s2T $POOL -expect_normal_exit $BTTCREATE -s 2T -b 512M -t $POOL >> $LOG - -$PMEMSPOIL $POOL "bttdevice.arena(0).btt_info.sig=ERROR"\ - "bttdevice.arena(0).btt_info_backup.sig=ERROR"\ - "bttdevice.arena(1).btt_info.sig=ERROR"\ - "bttdevice.arena(1).btt_info_backup.sig=ERROR"\ - "bttdevice.arena(2).btt_info.sig=ERROR"\ - "bttdevice.arena(2).btt_info_backup.sig=ERROR"\ - "bttdevice.arena(3).btt_info.checksum=13" - -expect_normal_exit $EXE$EXESUFFIX -r 1 -t btt $POOL >> $LOG - -check_file $POOL - -check - -pass diff --git a/src/test/libpmempool_bttdev/TEST7 b/src/test/libpmempool_bttdev/TEST7 deleted file mode 100755 index f1475bc1b17..00000000000 --- a/src/test/libpmempool_bttdev/TEST7 +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2018, Intel Corporation -# -# -# libpmempool_bttdev/TEST7 -- test for checking btt -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_fs_type any - -setup - -POOL=$DIR/file.pool -LOG=out${UNITTEST_NUM}.log -rm -f $LOG && touch $LOG -EXE=../libpmempool_api/libpmempool_test - -expect_normal_exit $BTTCREATE $POOL >> $LOG - -$PMEMSPOIL -v $POOL "bttdevice.arena(0).btt_info.sig=BADSIGNATURE"\ - "bttdevice.arena(0).btt_info.external_lbasize=10"\ - "bttdevice.arena(0).btt_info.major=0x0" >> $LOG - -expect_normal_exit $EXE$EXESUFFIX -r 1 -t btt $POOL >> $LOG - -check_file $POOL - -check - -pass diff --git a/src/test/libpmempool_bttdev/TEST8 b/src/test/libpmempool_bttdev/TEST8 deleted file mode 100755 index 889ef33845b..00000000000 --- a/src/test/libpmempool_bttdev/TEST8 +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2018, Intel Corporation -# -# -# libpmempool_bttdev/TEST8 -- test for checking btt -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_fs_type any - -setup - -POOL=$DIR/file.pool -LOG=out${UNITTEST_NUM}.log -LOG_TEMP=out${UNITTEST_NUM}_part.log -rm -f $LOG && touch $LOG -rm -f $LOG_TEMP && touch $LOG_TEMP -EXE=../libpmempool_api/libpmempool_test - -expect_normal_exit $BTTCREATE $POOL >> $LOG - -declare -A btt_info_dic_err=(["sig"]="ERROR" ["uuid"]="01-02" - ["flags"]="7" ["major"]="7" ["minor"]="7" - ["nfree"]="7" ["infosize"]="7" ["nextoff"]="7" - ["dataoff"]="7" ["infooff"]="7" ["unused"]="7" - ["parent_uuid"]="03-04" ["mapoff"]="7" ["flogoff"]="7") - -for field in flags unused major sig nextoff infosize infooff dataoff nfree mapoff uuid parent_uuid flogoff minor -do - spcmd="bttdevice.arena(0).btt_info.$field=${btt_info_dic_err["$field"]}" - - rm -f $POOL - - expect_normal_exit $BTTCREATE $POOL - $PMEMSPOIL -v $POOL $spcmd >> $LOG_TEMP - - expect_normal_exit $EXE$EXESUFFIX -r 1 -t btt $POOL - cat $LOG >> $LOG_TEMP - - check_file $POOL -done - -mv $LOG_TEMP $LOG - -check - -pass diff --git a/src/test/libpmempool_bttdev/TEST9 b/src/test/libpmempool_bttdev/TEST9 deleted file mode 100755 index d1f87abb307..00000000000 --- a/src/test/libpmempool_bttdev/TEST9 +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2018, Intel Corporation -# -# -# libpmempool_bttdev/TEST9 -- test for checking btt -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_fs_type any - -setup - -POOL=$DIR/file.pool -LOG=out${UNITTEST_NUM}.log -LOG_TEMP=out${UNITTEST_NUM}_part.log -rm -f $LOG && touch $LOG -rm -f $LOG_TEMP && touch $LOG_TEMP -EXE=../libpmempool_api/libpmempool_test - -expect_normal_exit $BTTCREATE $POOL >> $LOG - -declare -A btt_info_dic_err=(["sig"]="ERROR" ["uuid"]="01-02" - ["flags"]="7" ["major"]="7" ["minor"]="7" - ["nfree"]="7" ["infosize"]="7" ["nextoff"]="7" - ["dataoff"]="7" ["infooff"]="7" ["unused"]="7") - -for field in flags unused major sig nextoff infosize infooff dataoff nfree uuid minor -do - spcmd=$spcmd"bttdevice.arena(0).btt_info.$field=${btt_info_dic_err["$field"]} " - - rm -f $POOL - - expect_normal_exit $BTTCREATE $POOL - $PMEMSPOIL -v $POOL $spcmd >> $LOG_TEMP - - expect_normal_exit $EXE$EXESUFFIX -r 1 -t btt $POOL - cat $LOG >> $LOG_TEMP - - check_file $POOL -done - -mv $LOG_TEMP $LOG - -check - -pass diff --git a/src/test/libpmempool_bttdev/out0.log.match b/src/test/libpmempool_bttdev/out0.log.match deleted file mode 100644 index 551f5da973c..00000000000 --- a/src/test/libpmempool_bttdev/out0.log.match +++ /dev/null @@ -1,8 +0,0 @@ -libpmempool_bttdev/TEST0: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum correct -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = consistent -libpmempool_bttdev/TEST0: DONE diff --git a/src/test/libpmempool_bttdev/out1.log.match b/src/test/libpmempool_bttdev/out1.log.match deleted file mode 100644 index 9389f346f74..00000000000 --- a/src/test/libpmempool_bttdev/out1.log.match +++ /dev/null @@ -1,6 +0,0 @@ -libpmempool_bttdev/TEST1: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -can not find any valid BTT Info -status = not consistent -libpmempool_bttdev/TEST1: DONE diff --git a/src/test/libpmempool_bttdev/out10.log.match b/src/test/libpmempool_bttdev/out10.log.match deleted file mode 100644 index 35a6d9f9988..00000000000 --- a/src/test/libpmempool_bttdev/out10.log.match +++ /dev/null @@ -1,6 +0,0 @@ -libpmempool_bttdev/TEST10: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -can not find any valid BTT Info -status = not consistent -libpmempool_bttdev/TEST10: DONE diff --git a/src/test/libpmempool_bttdev/out11.log.match b/src/test/libpmempool_bttdev/out11.log.match deleted file mode 100644 index 759d24ecdc2..00000000000 --- a/src/test/libpmempool_bttdev/out11.log.match +++ /dev/null @@ -1,10 +0,0 @@ -libpmempool_bttdev/TEST11: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum correct -arena 1: BTT Info header checksum incorrect. Do you want to regenerate BTT Info? -arena 1: regenerating BTT Info header -the following error can be fixed using PMEMPOOL_CHECK_ADVANCED flag -arena 1: BTT Info header checksum incorrect -status = cannot repair -libpmempool_bttdev/TEST11: DONE diff --git a/src/test/libpmempool_bttdev/out2.log.match b/src/test/libpmempool_bttdev/out2.log.match deleted file mode 100644 index c07df5c153c..00000000000 --- a/src/test/libpmempool_bttdev/out2.log.match +++ /dev/null @@ -1,19 +0,0 @@ -libpmempool_bttdev/TEST2: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum correct -arena 0: BTT Info backup checksum incorrect. Do you want to restore it from BTT Info header? -arena 0: restoring BTT Info backup from header -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST2: DONE -libpmempool_bttdev/TEST2: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 0: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST2: DONE diff --git a/src/test/libpmempool_bttdev/out3.log.match b/src/test/libpmempool_bttdev/out3.log.match deleted file mode 100644 index 984262f52a2..00000000000 --- a/src/test/libpmempool_bttdev/out3.log.match +++ /dev/null @@ -1,16 +0,0 @@ -libpmempool_bttdev/TEST3: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Do you want to regenerate BTT Info? -arena 0: regenerating BTT Info header -arena 0: BTT Info header checksum correct -arena 0: BTT Info backup checksum incorrect. Do you want to restore it from BTT Info header? -arena 0: restoring BTT Info backup from header -arena 1: BTT Info header checksum correct -arena 1: BTT Info backup checksum incorrect. Do you want to restore it from BTT Info header? -arena 1: restoring BTT Info backup from header -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -arena 1: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST3: DONE diff --git a/src/test/libpmempool_bttdev/out4.log.match b/src/test/libpmempool_bttdev/out4.log.match deleted file mode 100644 index 9a352ee192c..00000000000 --- a/src/test/libpmempool_bttdev/out4.log.match +++ /dev/null @@ -1,15 +0,0 @@ -libpmempool_bttdev/TEST4: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Do you want to regenerate BTT Info? -arena 0: regenerating BTT Info header -arena 0: BTT Info header checksum correct -arena 0: BTT Info backup checksum incorrect. Do you want to restore it from BTT Info header? -arena 0: restoring BTT Info backup from header -arena 1: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 1: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -arena 1: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST4: DONE diff --git a/src/test/libpmempool_bttdev/out5.log.match b/src/test/libpmempool_bttdev/out5.log.match deleted file mode 100644 index e28feb59ac3..00000000000 --- a/src/test/libpmempool_bttdev/out5.log.match +++ /dev/null @@ -1,6 +0,0 @@ -libpmempool_bttdev/TEST5: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -can not find any valid BTT Info -status = not consistent -libpmempool_bttdev/TEST5: DONE diff --git a/src/test/libpmempool_bttdev/out6.log.match b/src/test/libpmempool_bttdev/out6.log.match deleted file mode 100644 index abd4a71c973..00000000000 --- a/src/test/libpmempool_bttdev/out6.log.match +++ /dev/null @@ -1,27 +0,0 @@ -libpmempool_bttdev/TEST6: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Do you want to regenerate BTT Info? -arena 0: regenerating BTT Info header -arena 0: BTT Info header checksum correct -arena 0: BTT Info backup checksum incorrect. Do you want to restore it from BTT Info header? -arena 0: restoring BTT Info backup from header -arena 1: BTT Info header checksum incorrect. Do you want to regenerate BTT Info? -arena 1: regenerating BTT Info header -arena 1: BTT Info header checksum correct -arena 1: BTT Info backup checksum incorrect. Do you want to restore it from BTT Info header? -arena 1: restoring BTT Info backup from header -arena 2: BTT Info header checksum incorrect. Do you want to regenerate BTT Info? -arena 2: regenerating BTT Info header -arena 2: BTT Info header checksum correct -arena 2: BTT Info backup checksum incorrect. Do you want to restore it from BTT Info header? -arena 2: restoring BTT Info backup from header -arena 3: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 3: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -arena 1: checking BTT Map and Flog -arena 2: checking BTT Map and Flog -arena 3: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST6: DONE diff --git a/src/test/libpmempool_bttdev/out7.log.match b/src/test/libpmempool_bttdev/out7.log.match deleted file mode 100644 index 4a7e2f61931..00000000000 --- a/src/test/libpmempool_bttdev/out7.log.match +++ /dev/null @@ -1,9 +0,0 @@ -libpmempool_bttdev/TEST7: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 0: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST7: DONE diff --git a/src/test/libpmempool_bttdev/out8.log.match b/src/test/libpmempool_bttdev/out8.log.match deleted file mode 100644 index 2558f7fa625..00000000000 --- a/src/test/libpmempool_bttdev/out8.log.match +++ /dev/null @@ -1,140 +0,0 @@ -$(nW)test_libpmempool_bttdev8$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.flags=7 -libpmempool_bttdev/TEST8: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 0: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST8: DONE -$(nW)test_libpmempool_bttdev8$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.unused=7 -libpmempool_bttdev/TEST8: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 0: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST8: DONE -$(nW)test_libpmempool_bttdev8$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.major=7 -libpmempool_bttdev/TEST8: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 0: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST8: DONE -$(nW)test_libpmempool_bttdev8$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.sig=ERROR -libpmempool_bttdev/TEST8: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 0: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST8: DONE -$(nW)test_libpmempool_bttdev8$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.nextoff=7 -libpmempool_bttdev/TEST8: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 0: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST8: DONE -$(nW)test_libpmempool_bttdev8$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.infosize=7 -libpmempool_bttdev/TEST8: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 0: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST8: DONE -$(nW)test_libpmempool_bttdev8$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.infooff=7 -libpmempool_bttdev/TEST8: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 0: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST8: DONE -$(nW)test_libpmempool_bttdev8$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.dataoff=7 -libpmempool_bttdev/TEST8: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 0: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST8: DONE -$(nW)test_libpmempool_bttdev8$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.nfree=7 -libpmempool_bttdev/TEST8: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 0: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST8: DONE -$(nW)test_libpmempool_bttdev8$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.mapoff=7 -libpmempool_bttdev/TEST8: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 0: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST8: DONE -$(nW)test_libpmempool_bttdev8$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.uuid=01-02 -libpmempool_bttdev/TEST8: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 0: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST8: DONE -$(nW)test_libpmempool_bttdev8$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.parent_uuid=03-04 -libpmempool_bttdev/TEST8: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 0: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST8: DONE -$(nW)test_libpmempool_bttdev8$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.flogoff=7 -libpmempool_bttdev/TEST8: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 0: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST8: DONE -$(nW)test_libpmempool_bttdev8$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.minor=7 -libpmempool_bttdev/TEST8: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 0: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST8: DONE diff --git a/src/test/libpmempool_bttdev/out9.log.match b/src/test/libpmempool_bttdev/out9.log.match deleted file mode 100644 index a0d44ac118d..00000000000 --- a/src/test/libpmempool_bttdev/out9.log.match +++ /dev/null @@ -1,165 +0,0 @@ -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.flags=7 -libpmempool_bttdev/TEST9: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 0: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST9: DONE -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.flags=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.unused=7 -libpmempool_bttdev/TEST9: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 0: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST9: DONE -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.flags=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.unused=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.major=7 -libpmempool_bttdev/TEST9: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 0: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST9: DONE -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.flags=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.unused=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.major=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.sig=ERROR -libpmempool_bttdev/TEST9: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 0: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST9: DONE -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.flags=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.unused=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.major=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.sig=ERROR -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.nextoff=7 -libpmempool_bttdev/TEST9: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 0: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST9: DONE -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.flags=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.unused=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.major=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.sig=ERROR -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.nextoff=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.infosize=7 -libpmempool_bttdev/TEST9: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 0: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST9: DONE -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.flags=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.unused=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.major=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.sig=ERROR -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.nextoff=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.infosize=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.infooff=7 -libpmempool_bttdev/TEST9: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 0: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST9: DONE -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.flags=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.unused=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.major=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.sig=ERROR -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.nextoff=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.infosize=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.infooff=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.dataoff=7 -libpmempool_bttdev/TEST9: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 0: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST9: DONE -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.flags=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.unused=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.major=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.sig=ERROR -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.nextoff=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.infosize=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.infooff=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.dataoff=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.nfree=7 -libpmempool_bttdev/TEST9: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 0: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST9: DONE -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.flags=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.unused=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.major=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.sig=ERROR -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.nextoff=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.infosize=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.infooff=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.dataoff=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.nfree=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.uuid=01-02 -libpmempool_bttdev/TEST9: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 0: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST9: DONE -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.flags=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.unused=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.major=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.sig=ERROR -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.nextoff=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.infosize=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.infooff=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.dataoff=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.nfree=7 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.uuid=01-02 -$(nW)test_libpmempool_bttdev9$(nW)file.pool: spoil: bttdevice.arena(0).btt_info.minor=7 -libpmempool_bttdev/TEST9: START: libpmempool_test - $(nW)libpmempool_test$(nW) -r 1 -t btt $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum incorrect. Restore BTT Info from backup? -arena 0: restoring BTT Info header from backup -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = repaired -libpmempool_bttdev/TEST9: DONE diff --git a/src/test/libpmempool_map_flog/Makefile b/src/test/libpmempool_map_flog/Makefile deleted file mode 100644 index a335d2e041a..00000000000 --- a/src/test/libpmempool_map_flog/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016, Intel Corporation - -# -# src/test/libpmempool_map_flog/Makefile -- build libpmempool_map_flog unittest -# - -include ../libpmempool_api/Makefile.inc diff --git a/src/test/libpmempool_map_flog/README b/src/test/libpmempool_map_flog/README deleted file mode 100644 index 531489af868..00000000000 --- a/src/test/libpmempool_map_flog/README +++ /dev/null @@ -1,6 +0,0 @@ -Persistent Memory Development Kit - -This is src/test/libpmempool_map_flog/README. - -This directory contains a unit test for libpmempool check in context of -map and flog defects. diff --git a/src/test/libpmempool_map_flog/TEST0 b/src/test/libpmempool_map_flog/TEST0 deleted file mode 100755 index 8be64ea8506..00000000000 --- a/src/test/libpmempool_map_flog/TEST0 +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2018, Intel Corporation -# -# -# libpmempool_map_flog/TEST0 -- test for checking map and flog -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_fs_type any - -setup - -POOL=$DIR/file.pool -LOG=out${UNITTEST_NUM}.log -LOG_TEMP=out${UNITTEST_NUM}_part.log -rm -f $LOG && touch $LOG -rm -f $LOG_TEMP && touch $LOG_TEMP -EXE=../libpmempool_api/libpmempool_test - -declare -A map_err=(["Initial"]="0" ["Error"]="4" - ["Zeroed"]="8" ["Normal"]="C") - -ent_val=2 - -for field in Zeroed Error Initial Normal; -do - for((i=0;i> $LOG_TEMP - $PMEMSPOIL $POOL $spcmd - - expect_normal_exit $EXE$EXESUFFIX -r 1 -t btt -a 1 $POOL - cat $LOG >> $LOG_TEMP - done -done - -mv $LOG_TEMP $LOG -check_file $POOL - -check -pass diff --git a/src/test/libpmempool_map_flog/TEST1 b/src/test/libpmempool_map_flog/TEST1 deleted file mode 100755 index f7ee3afb7b3..00000000000 --- a/src/test/libpmempool_map_flog/TEST1 +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2018, Intel Corporation -# -# -# libpmempool_map_flog/TEST1 -- test for checking map and flog -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_fs_type any - -setup - -POOL=$DIR/file.pool -LOG=out${UNITTEST_NUM}.log -LOG_TEMP=out${UNITTEST_NUM}_part.log -rm -f $LOG && touch $LOG -rm -f $LOG_TEMP && touch $LOG_TEMP -EXE=../libpmempool_api/libpmempool_test - -declare -A map_err=(["Initial"]="0" ["Error"]="4" - ["Zeroed"]="8" ["Normal"]="C") - -ent_val=6 - -for field in Zeroed Error Initial Normal; -do - expect_normal_exit $BTTCREATE $POOL - - for((i=0;i> $LOG_TEMP - $PMEMSPOIL $POOL $spcmd - done - - # duplicated entry - spcmd="bttdevice.arena.btt_map(6)=0x${map_err["$field"]}0000003" - echo ${field}: $spcmd >> $LOG_TEMP - $PMEMSPOIL $POOL $spcmd - - # lba number is higher then internal nlba - spcmd="bttdevice.arena.btt_map(2)=0x${map_err["$field"]}000FFFF" - echo ${field}: $spcmd >> $LOG_TEMP - $PMEMSPOIL $POOL $spcmd - - expect_normal_exit $EXE$EXESUFFIX -r 1 -t btt -a 1 $POOL - cat $LOG >> $LOG_TEMP -done - -mv $LOG_TEMP $LOG -check_file $POOL - -check -pass diff --git a/src/test/libpmempool_map_flog/TEST2 b/src/test/libpmempool_map_flog/TEST2 deleted file mode 100755 index 1766f68e8ba..00000000000 --- a/src/test/libpmempool_map_flog/TEST2 +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2018, Intel Corporation -# -# -# libpmempool_map_flog/TEST2 -- test for checking map and flog -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_fs_type any - -setup - -POOL=$DIR/file.pool -LOG=out${UNITTEST_NUM}.log -LOG_TEMP=out${UNITTEST_NUM}_part.log -rm -f $LOG && touch $LOG -rm -f $LOG_TEMP && touch $LOG_TEMP -EXE=../libpmempool_api/libpmempool_test - -declare -A map_err=(["Initial"]="0" ["Error"]="4" - ["Zeroed"]="8" ["Normal"]="C") - -ent_val=9 - -for field in Zeroed Error Initial Normal; -do - expect_normal_exit $BTTCREATE $POOL - - for((i=0;i> $LOG_TEMP - $PMEMSPOIL $POOL $spcmd - done - - spcmd="bttdevice.arena.btt_flog(3).seq=4" - echo ${field}: $spcmd >> $LOG_TEMP - $PMEMSPOIL $POOL $spcmd - - spcmd="bttdevice.arena.btt_flog(4).old_map=0x${map_err["$field"]}000FFFF" - echo ${field}: $spcmd >> $LOG_TEMP - $PMEMSPOIL $POOL $spcmd - - spcmd="bttdevice.arena.btt_flog(5).new_map=0x${map_err["$field"]}000FFFF" - echo ${field}: $spcmd >> $LOG_TEMP - $PMEMSPOIL $POOL $spcmd - - spcmd="bttdevice.arena.btt_flog(6).old_map=0x${map_err["$field"]}0000001" - echo ${field}: $spcmd >> $LOG_TEMP - $PMEMSPOIL $POOL $spcmd - - spcmd="bttdevice.arena.btt_flog(7).new_map=0x${map_err["$field"]}0000002" - echo ${field}: $spcmd >> $LOG_TEMP - $PMEMSPOIL $POOL $spcmd - - spcmd="bttdevice.arena.btt_flog(8).new_map=0x${map_err["$field"]}0000069" - echo ${field}: $spcmd >> $LOG_TEMP - $PMEMSPOIL $POOL $spcmd - - expect_normal_exit $EXE$EXESUFFIX -r 1 -t btt -a 1 $POOL - cat $LOG >> $LOG_TEMP -done - -mv $LOG_TEMP $LOG -check_file $POOL - -check -pass diff --git a/src/test/libpmempool_map_flog/TEST3 b/src/test/libpmempool_map_flog/TEST3 deleted file mode 100755 index 6f258db2711..00000000000 --- a/src/test/libpmempool_map_flog/TEST3 +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2018, Intel Corporation -# -# -# libpmempool_map_flog/TEST3 -- test for checking map and flog -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_fs_type any - -setup - -POOL=$DIR/file.pool -LOG=out${UNITTEST_NUM}.log -LOG_TEMP=out${UNITTEST_NUM}_part.log -rm -f $LOG && touch $LOG -rm -f $LOG_TEMP && touch $LOG_TEMP -EXE=../libpmempool_api/libpmempool_test - -ent_val=10 - -expect_normal_exit $BTTCREATE $POOL - -for((i=0;i> $LOG_TEMP - $PMEMSPOIL $POOL $spcmd -done - -spcmd="bttdevice.arena.btt_map(5)=0xC0000002" -echo $spcmd >> $LOG_TEMP -$PMEMSPOIL $POOL $spcmd - -spcmd="bttdevice.arena.btt_map(6)=0xC0000002" -echo $spcmd >> $LOG_TEMP -$PMEMSPOIL $POOL $spcmd - -spcmd="bttdevice.arena.btt_map(7)=0xC0000002" -echo $spcmd >> $LOG_TEMP -$PMEMSPOIL $POOL $spcmd - -spcmd="bttdevice.arena.btt_map(10)=0xC0000002" -echo $spcmd >> $LOG_TEMP -$PMEMSPOIL $POOL $spcmd - -spcmd="bttdevice.arena.btt_map(11)=0xC0000002" -echo $spcmd >> $LOG_TEMP -$PMEMSPOIL $POOL $spcmd - -spcmd="bttdevice.arena.btt_map(12)=0xC0000003" -echo $spcmd >> $LOG_TEMP -$PMEMSPOIL $POOL $spcmd - -expect_normal_exit $EXE$EXESUFFIX -r 1 -t btt -a 1 $POOL -cat $LOG >> $LOG_TEMP - -expect_normal_exit $PMEMPOOL$EXESUFFIX info $POOL -f btt -m\ - | $GREP "error" >> $LOG_TEMP - -mv $LOG_TEMP $LOG -check_file $POOL - -check -pass diff --git a/src/test/libpmempool_map_flog/out0.log.match b/src/test/libpmempool_map_flog/out0.log.match deleted file mode 100644 index d9843dbc05e..00000000000 --- a/src/test/libpmempool_map_flog/out0.log.match +++ /dev/null @@ -1,93 +0,0 @@ -Zeroed: bttdevice.arena.btt_map(0)=0x80000000 -libpmempool_map_flog$(nW)TEST0: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -r 1 -t btt -a 1 $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum correct -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = consistent -libpmempool_map_flog$(nW)TEST0: DONE -Zeroed: bttdevice.arena.btt_map(0)=0x80000001 -libpmempool_map_flog$(nW)TEST0: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -r 1 -t btt -a 1 $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum correct -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -arena 0: BTT Map entry 1 duplicated at 1 -arena 0: unmapped block 0 -arena 0: number of unmapped blocks: 1 -arena 0: number of invalid BTT Map entries: 1 -Do you want to repair invalid BTT Map entries? -arena 0: storing 0x40000001 at 0 BTT Map entry -arena 0: storing 0x40000000 at 1 BTT Map entry -status = repaired -libpmempool_map_flog$(nW)TEST0: DONE -Error: bttdevice.arena.btt_map(0)=0x40000000 -libpmempool_map_flog$(nW)TEST0: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -r 1 -t btt -a 1 $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum correct -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = consistent -libpmempool_map_flog$(nW)TEST0: DONE -Error: bttdevice.arena.btt_map(0)=0x40000001 -libpmempool_map_flog$(nW)TEST0: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -r 1 -t btt -a 1 $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum correct -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -arena 0: BTT Map entry 1 duplicated at 1 -arena 0: unmapped block 0 -arena 0: number of unmapped blocks: 1 -arena 0: number of invalid BTT Map entries: 1 -Do you want to repair invalid BTT Map entries? -arena 0: storing 0x40000001 at 0 BTT Map entry -arena 0: storing 0x40000000 at 1 BTT Map entry -status = repaired -libpmempool_map_flog$(nW)TEST0: DONE -Initial: bttdevice.arena.btt_map(0)=0x00000000 -libpmempool_map_flog$(nW)TEST0: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -r 1 -t btt -a 1 $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum correct -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = consistent -libpmempool_map_flog$(nW)TEST0: DONE -Initial: bttdevice.arena.btt_map(0)=0x00000001 -libpmempool_map_flog$(nW)TEST0: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -r 1 -t btt -a 1 $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum correct -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = consistent -libpmempool_map_flog$(nW)TEST0: DONE -Normal: bttdevice.arena.btt_map(0)=0xC0000000 -libpmempool_map_flog$(nW)TEST0: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -r 1 -t btt -a 1 $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum correct -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = consistent -libpmempool_map_flog$(nW)TEST0: DONE -Normal: bttdevice.arena.btt_map(0)=0xC0000001 -libpmempool_map_flog$(nW)TEST0: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -r 1 -t btt -a 1 $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum correct -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -arena 0: BTT Map entry 1 duplicated at 1 -arena 0: unmapped block 0 -arena 0: number of unmapped blocks: 1 -arena 0: number of invalid BTT Map entries: 1 -Do you want to repair invalid BTT Map entries? -arena 0: storing 0x40000001 at 0 BTT Map entry -arena 0: storing 0x40000000 at 1 BTT Map entry -status = repaired -libpmempool_map_flog$(nW)TEST0: DONE diff --git a/src/test/libpmempool_map_flog/out1.log.match b/src/test/libpmempool_map_flog/out1.log.match deleted file mode 100644 index c42f39bf907..00000000000 --- a/src/test/libpmempool_map_flog/out1.log.match +++ /dev/null @@ -1,94 +0,0 @@ -Zeroed: bttdevice.arena.btt_map(0)=0x80000000 -Zeroed: bttdevice.arena.btt_map(1)=0x80000001 -Zeroed: bttdevice.arena.btt_map(2)=0x80000002 -Zeroed: bttdevice.arena.btt_map(3)=0x80000003 -Zeroed: bttdevice.arena.btt_map(4)=0x80000004 -Zeroed: bttdevice.arena.btt_map(5)=0x80000005 -Zeroed: bttdevice.arena.btt_map(6)=0x80000003 -Zeroed: bttdevice.arena.btt_map(2)=0x8000FFFF -libpmempool_map_flog$(nW)TEST1: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -r 1 -t btt -a 1 $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum correct -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -arena 0: invalid BTT Map entry at 2 -arena 0: BTT Map entry 3 duplicated at 6 -arena 0: unmapped block 2 -arena 0: unmapped block 6 -arena 0: number of unmapped blocks: 2 -arena 0: number of invalid BTT Map entries: 2 -Do you want to repair invalid BTT Map entries? -arena 0: storing 0x40000003 at 3 BTT Map entry -arena 0: storing 0x40000006 at 6 BTT Map entry -arena 0: storing 0x40000002 at 2 BTT Map entry -status = repaired -libpmempool_map_flog$(nW)TEST1: DONE -Error: bttdevice.arena.btt_map(0)=0x40000000 -Error: bttdevice.arena.btt_map(1)=0x40000001 -Error: bttdevice.arena.btt_map(2)=0x40000002 -Error: bttdevice.arena.btt_map(3)=0x40000003 -Error: bttdevice.arena.btt_map(4)=0x40000004 -Error: bttdevice.arena.btt_map(5)=0x40000005 -Error: bttdevice.arena.btt_map(6)=0x40000003 -Error: bttdevice.arena.btt_map(2)=0x4000FFFF -libpmempool_map_flog$(nW)TEST1: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -r 1 -t btt -a 1 $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum correct -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -arena 0: invalid BTT Map entry at 2 -arena 0: BTT Map entry 3 duplicated at 6 -arena 0: unmapped block 2 -arena 0: unmapped block 6 -arena 0: number of unmapped blocks: 2 -arena 0: number of invalid BTT Map entries: 2 -Do you want to repair invalid BTT Map entries? -arena 0: storing 0x40000003 at 3 BTT Map entry -arena 0: storing 0x40000006 at 6 BTT Map entry -arena 0: storing 0x40000002 at 2 BTT Map entry -status = repaired -libpmempool_map_flog$(nW)TEST1: DONE -Initial: bttdevice.arena.btt_map(0)=0x00000000 -Initial: bttdevice.arena.btt_map(1)=0x00000001 -Initial: bttdevice.arena.btt_map(2)=0x00000002 -Initial: bttdevice.arena.btt_map(3)=0x00000003 -Initial: bttdevice.arena.btt_map(4)=0x00000004 -Initial: bttdevice.arena.btt_map(5)=0x00000005 -Initial: bttdevice.arena.btt_map(6)=0x00000003 -Initial: bttdevice.arena.btt_map(2)=0x0000FFFF -libpmempool_map_flog$(nW)TEST1: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -r 1 -t btt -a 1 $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum correct -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -status = consistent -libpmempool_map_flog$(nW)TEST1: DONE -Normal: bttdevice.arena.btt_map(0)=0xC0000000 -Normal: bttdevice.arena.btt_map(1)=0xC0000001 -Normal: bttdevice.arena.btt_map(2)=0xC0000002 -Normal: bttdevice.arena.btt_map(3)=0xC0000003 -Normal: bttdevice.arena.btt_map(4)=0xC0000004 -Normal: bttdevice.arena.btt_map(5)=0xC0000005 -Normal: bttdevice.arena.btt_map(6)=0xC0000003 -Normal: bttdevice.arena.btt_map(2)=0xC000FFFF -libpmempool_map_flog$(nW)TEST1: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -r 1 -t btt -a 1 $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum correct -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -arena 0: invalid BTT Map entry at 2 -arena 0: BTT Map entry 3 duplicated at 6 -arena 0: unmapped block 2 -arena 0: unmapped block 6 -arena 0: number of unmapped blocks: 2 -arena 0: number of invalid BTT Map entries: 2 -Do you want to repair invalid BTT Map entries? -arena 0: storing 0x40000003 at 3 BTT Map entry -arena 0: storing 0x40000006 at 6 BTT Map entry -arena 0: storing 0x40000002 at 2 BTT Map entry -status = repaired -libpmempool_map_flog$(nW)TEST1: DONE diff --git a/src/test/libpmempool_map_flog/out2.log.match b/src/test/libpmempool_map_flog/out2.log.match deleted file mode 100644 index 7a530951abe..00000000000 --- a/src/test/libpmempool_map_flog/out2.log.match +++ /dev/null @@ -1,164 +0,0 @@ -Zeroed: bttdevice.arena.btt_map(0)=0x80000000 -Zeroed: bttdevice.arena.btt_map(1)=0x80000001 -Zeroed: bttdevice.arena.btt_map(2)=0x80000002 -Zeroed: bttdevice.arena.btt_map(3)=0x80000003 -Zeroed: bttdevice.arena.btt_map(4)=0x80000004 -Zeroed: bttdevice.arena.btt_map(5)=0x80000005 -Zeroed: bttdevice.arena.btt_map(6)=0x80000006 -Zeroed: bttdevice.arena.btt_map(7)=0x80000007 -Zeroed: bttdevice.arena.btt_map(8)=0x80000008 -Zeroed: bttdevice.arena.btt_flog(3).seq=4 -Zeroed: bttdevice.arena.btt_flog(4).old_map=0x8000FFFF -Zeroed: bttdevice.arena.btt_flog(5).new_map=0x8000FFFF -Zeroed: bttdevice.arena.btt_flog(6).old_map=0x80000001 -Zeroed: bttdevice.arena.btt_flog(7).new_map=0x80000002 -Zeroed: bttdevice.arena.btt_flog(8).new_map=0x80000069 -libpmempool_map_flog$(nW)TEST2: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -r 1 -t btt -a 1 $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum correct -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -arena 0: invalid BTT Flog entry at 3 -arena 0: invalid BTT Flog entry at 4 -arena 0: invalid BTT Flog entry at 5 -$(OPT)arena 0: unmapped block 40325 -$(OPX)arena 0: unmapped block 40206 -$(OPT)arena 0: unmapped block 40326 -$(OPX)arena 0: unmapped block 40207 -$(OPT)arena 0: unmapped block 40327 -$(OPX)arena 0: unmapped block 40208 -arena 0: number of unmapped blocks: 3 -arena 0: number of invalid BTT Flog entries: 3 -Do you want to repair invalid BTT Flog entries? -$(OPT)arena 0: repairing BTT Flog at 5 with free block entry 0x40009d87 -$(OPX)arena 0: repairing BTT Flog at 5 with free block entry 0x40009d10 -$(OPT)arena 0: repairing BTT Flog at 4 with free block entry 0x40009d86 -$(OPX)arena 0: repairing BTT Flog at 4 with free block entry 0x40009d0f -$(OPT)arena 0: repairing BTT Flog at 3 with free block entry 0x40009d85 -$(OPX)arena 0: repairing BTT Flog at 3 with free block entry 0x40009d0e -status = repaired -libpmempool_map_flog$(nW)TEST2: DONE -Error: bttdevice.arena.btt_map(0)=0x40000000 -Error: bttdevice.arena.btt_map(1)=0x40000001 -Error: bttdevice.arena.btt_map(2)=0x40000002 -Error: bttdevice.arena.btt_map(3)=0x40000003 -Error: bttdevice.arena.btt_map(4)=0x40000004 -Error: bttdevice.arena.btt_map(5)=0x40000005 -Error: bttdevice.arena.btt_map(6)=0x40000006 -Error: bttdevice.arena.btt_map(7)=0x40000007 -Error: bttdevice.arena.btt_map(8)=0x40000008 -Error: bttdevice.arena.btt_flog(3).seq=4 -Error: bttdevice.arena.btt_flog(4).old_map=0x4000FFFF -Error: bttdevice.arena.btt_flog(5).new_map=0x4000FFFF -Error: bttdevice.arena.btt_flog(6).old_map=0x40000001 -Error: bttdevice.arena.btt_flog(7).new_map=0x40000002 -Error: bttdevice.arena.btt_flog(8).new_map=0x40000069 -libpmempool_map_flog$(nW)TEST2: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -r 1 -t btt -a 1 $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum correct -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -arena 0: invalid BTT Flog entry at 3 -arena 0: invalid BTT Flog entry at 4 -arena 0: invalid BTT Flog entry at 5 -$(OPT)arena 0: unmapped block 40325 -$(OPX)arena 0: unmapped block 40206 -$(OPT)arena 0: unmapped block 40326 -$(OPX)arena 0: unmapped block 40207 -$(OPT)arena 0: unmapped block 40327 -$(OPX)arena 0: unmapped block 40208 -arena 0: number of unmapped blocks: 3 -arena 0: number of invalid BTT Flog entries: 3 -Do you want to repair invalid BTT Flog entries? -$(OPT)arena 0: repairing BTT Flog at 5 with free block entry 0x40009d87 -$(OPX)arena 0: repairing BTT Flog at 5 with free block entry 0x40009d10 -$(OPT)arena 0: repairing BTT Flog at 4 with free block entry 0x40009d86 -$(OPX)arena 0: repairing BTT Flog at 4 with free block entry 0x40009d0f -$(OPT)arena 0: repairing BTT Flog at 3 with free block entry 0x40009d85 -$(OPX)arena 0: repairing BTT Flog at 3 with free block entry 0x40009d0e -status = repaired -libpmempool_map_flog$(nW)TEST2: DONE -Initial: bttdevice.arena.btt_map(0)=0x00000000 -Initial: bttdevice.arena.btt_map(1)=0x00000001 -Initial: bttdevice.arena.btt_map(2)=0x00000002 -Initial: bttdevice.arena.btt_map(3)=0x00000003 -Initial: bttdevice.arena.btt_map(4)=0x00000004 -Initial: bttdevice.arena.btt_map(5)=0x00000005 -Initial: bttdevice.arena.btt_map(6)=0x00000006 -Initial: bttdevice.arena.btt_map(7)=0x00000007 -Initial: bttdevice.arena.btt_map(8)=0x00000008 -Initial: bttdevice.arena.btt_flog(3).seq=4 -Initial: bttdevice.arena.btt_flog(4).old_map=0x0000FFFF -Initial: bttdevice.arena.btt_flog(5).new_map=0x0000FFFF -Initial: bttdevice.arena.btt_flog(6).old_map=0x00000001 -Initial: bttdevice.arena.btt_flog(7).new_map=0x00000002 -Initial: bttdevice.arena.btt_flog(8).new_map=0x00000069 -libpmempool_map_flog$(nW)TEST2: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -r 1 -t btt -a 1 $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum correct -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -arena 0: invalid BTT Flog entry at 3 -arena 0: invalid BTT Flog entry at 4 -arena 0: invalid BTT Flog entry at 5 -$(OPT)arena 0: unmapped block 40325 -$(OPX)arena 0: unmapped block 40206 -$(OPT)arena 0: unmapped block 40326 -$(OPX)arena 0: unmapped block 40207 -$(OPT)arena 0: unmapped block 40327 -$(OPX)arena 0: unmapped block 40208 -arena 0: number of unmapped blocks: 3 -arena 0: number of invalid BTT Flog entries: 3 -Do you want to repair invalid BTT Flog entries? -$(OPT)arena 0: repairing BTT Flog at 5 with free block entry 0x40009d87 -$(OPX)arena 0: repairing BTT Flog at 5 with free block entry 0x40009d10 -$(OPT)arena 0: repairing BTT Flog at 4 with free block entry 0x40009d86 -$(OPX)arena 0: repairing BTT Flog at 4 with free block entry 0x40009d0f -$(OPT)arena 0: repairing BTT Flog at 3 with free block entry 0x40009d85 -$(OPX)arena 0: repairing BTT Flog at 3 with free block entry 0x40009d0e -status = repaired -libpmempool_map_flog$(nW)TEST2: DONE -Normal: bttdevice.arena.btt_map(0)=0xC0000000 -Normal: bttdevice.arena.btt_map(1)=0xC0000001 -Normal: bttdevice.arena.btt_map(2)=0xC0000002 -Normal: bttdevice.arena.btt_map(3)=0xC0000003 -Normal: bttdevice.arena.btt_map(4)=0xC0000004 -Normal: bttdevice.arena.btt_map(5)=0xC0000005 -Normal: bttdevice.arena.btt_map(6)=0xC0000006 -Normal: bttdevice.arena.btt_map(7)=0xC0000007 -Normal: bttdevice.arena.btt_map(8)=0xC0000008 -Normal: bttdevice.arena.btt_flog(3).seq=4 -Normal: bttdevice.arena.btt_flog(4).old_map=0xC000FFFF -Normal: bttdevice.arena.btt_flog(5).new_map=0xC000FFFF -Normal: bttdevice.arena.btt_flog(6).old_map=0xC0000001 -Normal: bttdevice.arena.btt_flog(7).new_map=0xC0000002 -Normal: bttdevice.arena.btt_flog(8).new_map=0xC0000069 -libpmempool_map_flog$(nW)TEST2: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -r 1 -t btt -a 1 $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum correct -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -arena 0: invalid BTT Flog entry at 3 -arena 0: invalid BTT Flog entry at 4 -arena 0: invalid BTT Flog entry at 5 -$(OPT)arena 0: unmapped block 40325 -$(OPX)arena 0: unmapped block 40206 -$(OPT)arena 0: unmapped block 40326 -$(OPX)arena 0: unmapped block 40207 -$(OPT)arena 0: unmapped block 40327 -$(OPX)arena 0: unmapped block 40208 -arena 0: number of unmapped blocks: 3 -arena 0: number of invalid BTT Flog entries: 3 -Do you want to repair invalid BTT Flog entries? -$(OPT)arena 0: repairing BTT Flog at 5 with free block entry 0x40009d87 -$(OPX)arena 0: repairing BTT Flog at 5 with free block entry 0x40009d10 -$(OPT)arena 0: repairing BTT Flog at 4 with free block entry 0x40009d86 -$(OPX)arena 0: repairing BTT Flog at 4 with free block entry 0x40009d0f -$(OPT)arena 0: repairing BTT Flog at 3 with free block entry 0x40009d85 -$(OPX)arena 0: repairing BTT Flog at 3 with free block entry 0x40009d0e -status = repaired -libpmempool_map_flog$(nW)TEST2: DONE diff --git a/src/test/libpmempool_map_flog/out3.log.match b/src/test/libpmempool_map_flog/out3.log.match deleted file mode 100644 index e1bc49ee759..00000000000 --- a/src/test/libpmempool_map_flog/out3.log.match +++ /dev/null @@ -1,55 +0,0 @@ -bttdevice.arena.btt_map(0)=0xC0000000 -bttdevice.arena.btt_map(1)=0xC0000001 -bttdevice.arena.btt_map(2)=0xC0000002 -bttdevice.arena.btt_map(3)=0xC0000003 -bttdevice.arena.btt_map(4)=0xC0000004 -bttdevice.arena.btt_map(5)=0xC0000005 -bttdevice.arena.btt_map(6)=0xC0000006 -bttdevice.arena.btt_map(7)=0xC0000007 -bttdevice.arena.btt_map(8)=0xC0000008 -bttdevice.arena.btt_map(9)=0xC0000009 -bttdevice.arena.btt_map(5)=0xC0000002 -bttdevice.arena.btt_map(6)=0xC0000002 -bttdevice.arena.btt_map(7)=0xC0000002 -bttdevice.arena.btt_map(10)=0xC0000002 -bttdevice.arena.btt_map(11)=0xC0000002 -bttdevice.arena.btt_map(12)=0xC0000003 -libpmempool_map_flog$(nW)TEST3: START: libpmempool_test$(nW) - $(nW)libpmempool_test$(nW) -r 1 -t btt -a 1 $(nW) -checking BTT Info headers -arena 0: BTT Info header checksum correct -checking BTT Map and Flog -arena 0: checking BTT Map and Flog -arena 0: BTT Map entry 2 duplicated at 5 -arena 0: BTT Map entry 2 duplicated at 6 -arena 0: BTT Map entry 2 duplicated at 7 -arena 0: BTT Map entry 2 duplicated at 10 -arena 0: BTT Map entry 2 duplicated at 11 -arena 0: BTT Map entry 3 duplicated at 12 -arena 0: unmapped block 5 -arena 0: unmapped block 6 -arena 0: unmapped block 7 -arena 0: unmapped block 10 -arena 0: unmapped block 11 -arena 0: unmapped block 12 -arena 0: number of unmapped blocks: 6 -arena 0: number of invalid BTT Map entries: 6 -Do you want to repair invalid BTT Map entries? -arena 0: storing 0x40000002 at 2 BTT Map entry -arena 0: storing 0x40000003 at 3 BTT Map entry -arena 0: storing 0x4000000c at 12 BTT Map entry -arena 0: storing 0x4000000b at 11 BTT Map entry -arena 0: storing 0x4000000a at 10 BTT Map entry -arena 0: storing 0x40000007 at 7 BTT Map entry -arena 0: storing 0x40000006 at 6 BTT Map entry -arena 0: storing 0x40000005 at 5 BTT Map entry -status = repaired -libpmempool_map_flog$(nW)TEST3: DONE -0000000002: 0x00000002 state: error -0000000003: 0x00000003 state: error -0000000005: 0x00000005 state: error -0000000006: 0x00000006 state: error -0000000007: 0x00000007 state: error -0000000010: 0x0000000a state: error -0000000011: 0x0000000b state: error -0000000012: 0x0000000c state: error diff --git a/src/test/pmempool_create/TEST1 b/src/test/pmempool_create/TEST1 deleted file mode 100755 index f8f901b3ce4..00000000000 --- a/src/test/pmempool_create/TEST1 +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2018, Intel Corporation -# -# -# pmempool_create/TEST1 -- test for creating pmemblk pool with btt layout -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_fs_type pmem non-pmem - -setup - -POOL=$DIR/file.pool - -# PMEMBLK with layout -expect_normal_exit $PMEMPOOL$EXESUFFIX create -w blk 512 $POOL -check_file $POOL -check_signature PMEMBLK $POOL -check_arena $POOL - -pass diff --git a/src/test/tools/Makefile b/src/test/tools/Makefile index 0f21e3f7de0..8d677bf1979 100644 --- a/src/test/tools/Makefile +++ b/src/test/tools/Makefile @@ -1,5 +1,5 @@ # SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2022, Intel Corporation +# Copyright 2015-2023, Intel Corporation # # src/test/tools/Makefile -- build unit test helpers @@ -15,7 +15,6 @@ DIRS = \ pmemalloc\ pmemobjcli\ pmemdetect\ - bttcreate\ gran_detecto\ ddmap\ cmpmap\ diff --git a/src/test/tools/bttcreate/.gitignore b/src/test/tools/bttcreate/.gitignore deleted file mode 100644 index 08e50c3e754..00000000000 --- a/src/test/tools/bttcreate/.gitignore +++ /dev/null @@ -1 +0,0 @@ -bttcreate diff --git a/src/test/tools/bttcreate/Makefile b/src/test/tools/bttcreate/Makefile deleted file mode 100644 index ce78bb4935c..00000000000 --- a/src/test/tools/bttcreate/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016, Intel Corporation -# -# Makefile -- Makefile for bttcreate tool -# -TOP = ../../../.. - -vpath %.c $(TOP)/src/libpmemblk/ - -TARGET = bttcreate -OBJS = bttcreate.o btt.o - -LIBPMEMCOMMON=y -LIBPMEM=y - -include $(TOP)/src/tools/Makefile.inc -INCS += -I$(TOP)/src/libpmemblk diff --git a/src/test/tools/bttcreate/README b/src/test/tools/bttcreate/README deleted file mode 100644 index 45f8718b1e5..00000000000 --- a/src/test/tools/bttcreate/README +++ /dev/null @@ -1,22 +0,0 @@ -Persistent Memory Development Kit - -This is src/test/tools/bttcreate/README. - -This directory contains a tool for creating BTT pool in given file. -It's used as a helper program by some unit tests. - -Usage: - $ bttcreate [-s ] [-b ] - [-l ] [-u ] [-t] [-v] - - Valid arguments: - -s - size of the pool file (i.e. size of the pool + 4KB) - -b - block size - -l - maximum number of lanes - -u - parent uuid (generated by default) - -t - do not allocate blocks - -v - verbose - -Example: - ./bttcreate file_name -s 20M -b 1K -l 256 - -u "9047cad6-53e1-4ba8-bcdd-a9fb411f7392" -v diff --git a/src/test/tools/bttcreate/bttcreate.c b/src/test/tools/bttcreate/bttcreate.c deleted file mode 100644 index 688689c31a9..00000000000 --- a/src/test/tools/bttcreate/bttcreate.c +++ /dev/null @@ -1,363 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2016-2023, Intel Corporation */ -/* - * bttcreate.c -- tool for generating BTT layout - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "set.h" -#include "pool_hdr.h" -#include "btt.h" -#include "btt_layout.h" -#include "pmemcommon.h" -#include "os.h" -#include "util.h" -#include "page_size.h" - -#define BTT_CREATE_DEF_SIZE (20 * (1UL << 20)) /* 20 MB */ -#define BTT_CREATE_DEF_BLK_SIZE 512UL -#define BTT_CREATE_DEF_OFFSET_SIZE PMEM_PAGESIZE - -struct btt_context { - void *addr; - uint64_t len; -}; - -struct bbtcreate_options { - const char *fpath; - size_t poolsize; - uint32_t blocksize; - unsigned maxlanes; - uuid_t uuid; - bool trunc; - bool verbose; - bool user_uuid; -}; - -/* - * nsread -- btt callback for reading - */ -static int -nsread(void *ns, unsigned lane, void *buf, size_t count, - uint64_t off) -{ - struct btt_context *nsc = (struct btt_context *)ns; - - if (off + count > nsc->len) { - errno = EINVAL; - return -1; - } - memcpy(buf, (char *)nsc->addr + off, count); - return 0; -} - -/* - * nswrite -- btt callback for writing - */ -static int -nswrite(void *ns, unsigned lane, const void *buf, - size_t count, uint64_t off) -{ - struct btt_context *nsc = (struct btt_context *)ns; - - if (off + count > nsc->len) { - errno = EINVAL; - return -1; - } - - memcpy((char *)nsc->addr + off, buf, count); - - return 0; -} - -/* - * nsmap -- btt callback for memory mapping - */ -static ssize_t -nsmap(void *ns, unsigned lane, void **addrp, size_t len, - uint64_t off) -{ - struct btt_context *nsc = (struct btt_context *)ns; - - assert((ssize_t)len >= 0); - if (off + len >= nsc->len) { - errno = EINVAL; - return -1; - } - - /* - * Since the entire file is memory-mapped, this callback - * can always provide the entire length requested. - */ - *addrp = (char *)nsc->addr + off; - return (ssize_t)len; -} - -/* - * nssync -- btt callback for memory synchronization - */ -static void -nssync(void *ns, unsigned lane, void *addr, size_t len) -{ - /* do nothing */ -} - -/* - * nszero -- btt callback for zeroing memory - */ -static int -nszero(void *ns, unsigned lane, size_t len, uint64_t off) -{ - struct btt_context *nsc = (struct btt_context *)ns; - if (off + len >= nsc->len) { - errno = EINVAL; - return -1; - } - memset((char *)nsc->addr + off, 0, len); - return 0; -} - -/* - * print_usage -- print usage of program - */ -static void -print_usage(char *name) -{ - printf("Usage: %s [-s ] [-b ] " - "[-l ] [-u ] [-t] [-v] " - "\n", name); -} - -/* - * file_error -- handle file errors - */ -static int -file_error(const int fd, const char *fpath) -{ - if (fd != -1) - (void) os_close(fd); - os_unlink(fpath); - return -1; -} - -/* - * print_uuid -- print uuid - */ -static void -print_uuid(uuid_t uuid) -{ - char uuidstr[POOL_HDR_UUID_STR_LEN]; - if (util_uuid_to_string(uuid, uuidstr) == 0) { - printf("uuid\t\t%s\n", uuidstr); - } -} - -/* - * print_result -- print result if verbose option is on - */ -static void -print_result(struct bbtcreate_options *opts) -{ - if (opts->verbose) { - printf("BTT successfully created: %s\n", opts->fpath); - printf("poolsize\t%zuB\n", opts->poolsize); - printf("blocksize\t%uB\n", opts->blocksize); - printf("maxlanes\t%u\n", opts->maxlanes); - print_uuid(opts->uuid); - putchar('\n'); - } -} - -int -main(int argc, char *argv[]) -{ - common_init("", "", "", 0, 0); - - int opt; - size_t size; - int fd; - int res = 0; - struct bbtcreate_options opts = { - .poolsize = BTT_CREATE_DEF_SIZE, - .blocksize = BTT_CREATE_DEF_BLK_SIZE, - .maxlanes = BTT_DEFAULT_NFREE, - .trunc = false, - .verbose = false, - .user_uuid = false - }; - - /* parse option */ - while ((opt = getopt(argc, argv, "s:b:l:u:tv")) != -1) { - switch (opt) { - case 's': - if (util_parse_size(optarg, &size) == 0) { - opts.poolsize = size; - } else { - fprintf(stderr, "Wrong size format in pool" - " size option\n"); - res = 1; - goto out; - } - break; - case 'b': - if (util_parse_size(optarg, &size) == 0) { - opts.blocksize = (uint32_t)size; - } else { - fprintf(stderr, "Wrong size format in block" - " size option\n"); - res = 1; - goto out; - } - break; - case 'l': - opts.maxlanes = (unsigned)strtoul(optarg, NULL, 0); - break; - case 'u': - if (util_uuid_from_string(optarg, - (struct uuid *)&opts.uuid) == 0) { - opts.user_uuid = true; - } else { - fprintf(stderr, "Wrong uuid format."); - res = 1; - goto out; - } - break; - case 't': - opts.trunc = true; - break; - case 'v': - opts.verbose = true; - break; - default: - print_usage(argv[0]); - res = 1; - goto out; - } - } - if (optind < argc) { - opts.fpath = argv[optind]; - } else { - print_usage(argv[0]); - res = 1; - goto out; - } - - /* check sizes */ - if (opts.poolsize - BTT_CREATE_DEF_OFFSET_SIZE < BTT_MIN_SIZE) { - fprintf(stderr, "Pool size is less then %d MB\n", - BTT_MIN_SIZE >> 20); - res = 1; - goto out; - } - if (opts.blocksize < BTT_MIN_LBA_SIZE) { - fprintf(stderr, "Block size is less then %zu B\n", - BTT_MIN_LBA_SIZE); - res = 1; - goto out; - } - - /* open file */ - if ((fd = os_open(opts.fpath, O_RDWR|O_CREAT, - S_IRUSR|S_IWUSR)) < 0) { - perror(opts.fpath); - res = 1; - goto out; - } - - /* allocate file */ - if (!opts.trunc) { - if (os_posix_fallocate(fd, 0, - (os_off_t)opts.poolsize) != 0) { - perror("posix_fallocate"); - res = file_error(fd, opts.fpath); - goto error; - } - } else { - if (os_ftruncate(fd, (os_off_t)opts.poolsize) != 0) { - perror("ftruncate"); - res = file_error(fd, opts.fpath); - goto error; - } - } - - /* map created file */ - void *base = util_map(fd, 0, opts.poolsize, MAP_SHARED, 0, 0, NULL); - if (!base) { - perror("util_map"); - res = file_error(fd, opts.fpath); - goto error_map; - } - - /* setup btt context */ - struct btt_context btt_context = { - .addr = (void *)((uint64_t)base + BTT_CREATE_DEF_OFFSET_SIZE), - .len = opts.poolsize - BTT_CREATE_DEF_OFFSET_SIZE - }; - - /* generate uuid */ - if (!opts.user_uuid) { - if (util_uuid_generate(opts.uuid) < 0) { - perror("util_uuid_generate"); - res = -1; - goto error_map; - } - } - - /* init callback structure */ - static struct ns_callback btt_ns_callback = { - .nsread = nsread, - .nswrite = nswrite, - .nsmap = nsmap, - .nssync = nssync, - .nszero = nszero, - }; - - /* init btt in requested area */ - struct btt *bttp = btt_init(opts.poolsize - BTT_CREATE_DEF_OFFSET_SIZE, - opts.blocksize, opts.uuid, opts.maxlanes, - (void *)&btt_context, - &btt_ns_callback); - if (!bttp) { - printf("Error: Cannot initialize BTT layer\n"); - res = -1; - goto error_map; - } - - /* initialize metadata */ - if (btt_set_error(bttp, 0, 0)) { - perror("btt_set_error"); - res = -1; - goto error_btt; - } - if (btt_set_zero(bttp, 0, 0)) { - perror("btt_set_zero"); - res = -1; - goto error_btt; - } - - /* print results */ - print_result(&opts); - -error_btt: - btt_fini(bttp); - if (util_unmap(base, opts.poolsize) < 0) { - perror("!util_unmap"); - res = -1; - } -error_map: - common_fini(); -error: - os_close(fd); -out: - return res; -} diff --git a/src/test/tools/pmemspoil/README b/src/test/tools/pmemspoil/README index e464d4c337e..1ede7b7c5d9 100644 --- a/src/test/tools/pmemspoil/README +++ b/src/test/tools/pmemspoil/README @@ -25,26 +25,9 @@ The pmemspoil supports the following structures: - pmemlog - see log.h for details - pmemblk - see blk.h for details - arena - specify arena index - - btt_info - see btt_layout.h for details - - btt_info_backup - the same as btt_info but refers to BTT Info - backup header - - btt_flog - see btt_layout.h for details - - btt_flog_prime - the same as btt_flog but refers to second - instance of FLOG entry - - btt_map - BTT Map entries, see btt_layout.h for details - - bttdevice - analogical to pmemblk but for BTT device Examples: In order to change pool_hdr's signature and start offset of pmemlog pool: $ pmemspoil /path/to/file pool_hdr.signature=ERROR\ pmemlog.start_offset=0x0 - -For pmemblk pool file you can modify a signature in BTT Info header of second -arena using the following command: - $ pmemspoil /path/to/file "pmemblk.arena(1).btt_info.sig=ERROR" - -In order to change BTT Map entry number 20 and 5th flog sequence number in 3rd -arena: - $ pmemspoil /path/to/file "pmemblk.arena(3).btt_map(20)=0x0"\ - "pmemblk.arena(3).btt_flog(5).seq=0xff" diff --git a/src/test/tools/pmemspoil/spoil.c b/src/test/tools/pmemspoil/spoil.c index d7ea9fda1cb..a51d4eb1ee5 100644 --- a/src/test/tools/pmemspoil/spoil.c +++ b/src/test/tools/pmemspoil/spoil.c @@ -1026,23 +1026,6 @@ pmemspoil_process_pmemblk(struct pmemspoil *psp, return PROCESS_RET; } -/* - * pmemspoil_process_bttdevice -- process btt device fields - */ -static int -pmemspoil_process_bttdevice(struct pmemspoil *psp, - struct pmemspoil_list *pfp, void *arg) -{ - PROCESS_BEGIN(psp, pfp) { - PROCESS(arena, - pmemspoil_get_arena_offset(psp, PROCESS_INDEX, - ALIGN_UP(sizeof(struct pool_hdr), - BTT_ALIGNMENT)), - UINT32_MAX, uint64_t); - } PROCESS_END - return PROCESS_RET; -} - /* * pmemspoil_process_pmemlog -- process pmemlog fields */ @@ -1232,7 +1215,6 @@ pmemspoil_process(struct pmemspoil *psp, PROCESS(pmemlog, NULL, 1, void *); PROCESS(pmemblk, NULL, 1, void *); PROCESS(pmemobj, NULL, 1, void *); - PROCESS(bttdevice, NULL, 1, void *); } PROCESS_END return PROCESS_RET; diff --git a/src/test/unittest/unittest.sh b/src/test/unittest/unittest.sh index 6998f59e3ff..be077a9d1ba 100644 --- a/src/test/unittest/unittest.sh +++ b/src/test/unittest/unittest.sh @@ -127,7 +127,6 @@ LIB_TOOLS="../../tools" [ "$PMEMPOOL" ] || PMEMPOOL=$LIB_TOOLS/pmempool/pmempool [ "$DAXIO" ] || DAXIO=$LIB_TOOLS/daxio/daxio [ "$PMEMSPOIL" ] || PMEMSPOIL=$TOOLS/pmemspoil/pmemspoil.static-nondebug -[ "$BTTCREATE" ] || BTTCREATE=$TOOLS/bttcreate/bttcreate.static-nondebug [ "$PMEMWRITE" ] || PMEMWRITE=$TOOLS/pmemwrite/pmemwrite [ "$PMEMALLOC" ] || PMEMALLOC=$TOOLS/pmemalloc/pmemalloc [ "$PMEMOBJCLI" ] || PMEMOBJCLI=$TOOLS/pmemobjcli/pmemobjcli @@ -1938,15 +1937,6 @@ SIG_LEN=8 LAYOUT_OFFSET=$(getconf PAGE_SIZE) LAYOUT_LEN=1024 -# Length of arena's signature -ARENA_SIG_LEN=16 - -# Signature of BTT Arena -ARENA_SIG="BTT_ARENA_INFO" - -# Offset to first arena -ARENA_OFF=$(($(getconf PAGE_SIZE) * 2)) - # # check_file -- check if file exists and print error message if not # @@ -2085,20 +2075,6 @@ check_layout() fi } -# -# check_arena -- check if file contains specified arena signature -# -check_arena() -{ - local file=$1 - local sig=$($DD if=$file bs=1 skip=$ARENA_OFF count=$ARENA_SIG_LEN 2>/dev/null | tr -d \\0) - - if [[ $sig != $ARENA_SIG ]] - then - fatal "error: can't find arena signature" - fi -} - # # dump_pool_info -- dump selected pool metadata and/or user data #