Skip to content

Commit

Permalink
test: replace deprecated libpmempool_api tests
Browse files Browse the repository at this point in the history
- drop tests if log, blk and btt specific
- replace log, blk and btt using tests with obj tests
- pmemwrite has been extended to support PMEMOBJ pools as well

Signed-off-by: Jan Michalski <jan.michalski@intel.com>
  • Loading branch information
janekmi committed Jun 26, 2023
1 parent 03e780b commit fc79fb4
Show file tree
Hide file tree
Showing 31 changed files with 103 additions and 282 deletions.
6 changes: 3 additions & 3 deletions src/test/libpmempool_api/TEST0
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2016-2018, Intel Corporation
# Copyright 2016-2023, Intel Corporation
#
#
# libpmempool_api/TEST0 -- test for checking API
Expand All @@ -18,12 +18,12 @@ POOL=$DIR/file.pool
LOG=out${UNITTEST_NUM}.log
rm -f $LOG && touch $LOG

expect_normal_exit $PMEMPOOL$EXESUFFIX create log $POOL
expect_normal_exit $PMEMPOOL$EXESUFFIX create obj $POOL
check_file $POOL
expect_normal_exit $PMEMWRITE$EXESUFFIX $POOL TEST

expect_normal_exit ./libpmempool_test$EXESUFFIX\
-d 1 -a 0 -r 1 $POOL >> $LOG
-d 1 -a 0 -r 1 -t obj $POOL >> $LOG
check

pass
6 changes: 3 additions & 3 deletions src/test/libpmempool_api/TEST1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2016-2018, Intel Corporation
# Copyright 2016-2023, Intel Corporation
#
#
# libpmempool_api/TEST1 -- test for checking API
Expand All @@ -18,12 +18,12 @@ POOL=$DIR/file.pool
LOG=out${UNITTEST_NUM}.log
rm -f $LOG && touch $LOG

expect_normal_exit $PMEMPOOL$EXESUFFIX create log $POOL
expect_normal_exit $PMEMPOOL$EXESUFFIX create obj $POOL
check_file $POOL
expect_normal_exit $PMEMWRITE$EXESUFFIX $POOL TEST

expect_normal_exit ./libpmempool_test$EXESUFFIX\
-d 0 -a 1 -r 1 $POOL >> $LOG
-d 0 -a 1 -r 1 -t obj $POOL >> $LOG
check

pass
10 changes: 5 additions & 5 deletions src/test/libpmempool_api/TEST10
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2016-2018, Intel Corporation
# Copyright 2016-2023, Intel Corporation
#
#
# libpmempool_api/TEST10 -- test for checking API
Expand All @@ -20,21 +20,21 @@ LOG_TEMP=out${UNITTEST_NUM}_part.log
rm -f $LOG && touch $LOG
rm -f $LOG_TEMP && touch $LOG_TEMP

expect_normal_exit $PMEMPOOL$EXESUFFIX create log $POOL >> $LOG_TEMP
expect_normal_exit $PMEMPOOL$EXESUFFIX create obj $POOL >> $LOG_TEMP
$PMEMSPOIL $POOL "pool_hdr.major=7" >> $LOG_TEMP
check_file $POOL

expect_normal_exit ./libpmempool_test$EXESUFFIX \
-d 0 -r 0 -y 0 $POOL >> $LOG
-d 0 -r 0 -y 0 -t obj $POOL >> $LOG
cat $LOG >> $LOG_TEMP
rm -f $POOL

expect_normal_exit $PMEMPOOL$EXESUFFIX create log $POOL >> $LOG_TEMP
expect_normal_exit $PMEMPOOL$EXESUFFIX create obj $POOL >> $LOG_TEMP
$PMEMSPOIL $POOL "pool_hdr.major=7" >> $LOG_TEMP
check_file $POOL

expect_normal_exit ./libpmempool_test$EXESUFFIX\
-d 0 -r 1 -y 1 $POOL >> $LOG
-d 0 -r 1 -y 1 -t obj $POOL >> $LOG
cat $LOG >> $LOG_TEMP

mv $LOG_TEMP $LOG
Expand Down
44 changes: 0 additions & 44 deletions src/test/libpmempool_api/TEST11

This file was deleted.

46 changes: 0 additions & 46 deletions src/test/libpmempool_api/TEST12

This file was deleted.

8 changes: 4 additions & 4 deletions src/test/libpmempool_api/TEST13
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2016-2018, Intel Corporation
# Copyright 2016-2023, Intel Corporation
#
#
# libpmempool_api/TEST13 -- test for checking API
Expand All @@ -20,11 +20,11 @@ LOG_TEMP=out${UNITTEST_NUM}_part.log
rm -f $LOG && touch $LOG
rm -f $LOG_TEMP && touch $LOG_TEMP

expect_normal_exit $PMEMPOOL$EXESUFFIX create log $POOL
expect_normal_exit $PMEMPOOL$EXESUFFIX create obj $POOL

expect_normal_exit ./libpmempool_test$EXESUFFIX -s 0 $POOL >> $LOG
expect_normal_exit ./libpmempool_test$EXESUFFIX -s 0 -t obj $POOL >> $LOG
cat $LOG >> $LOG_TEMP
expect_normal_exit ./libpmempool_test$EXESUFFIX -s 999999 $POOL >> $LOG
expect_normal_exit ./libpmempool_test$EXESUFFIX -s 999999 -t obj $POOL >> $LOG
cat $LOG >> $LOG_TEMP

mv $LOG_TEMP $LOG
Expand Down
6 changes: 3 additions & 3 deletions src/test/libpmempool_api/TEST2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2016-2018, Intel Corporation
# Copyright 2016-2023, Intel Corporation
#
#
# libpmempool_api/TEST2 -- test for checking API
Expand All @@ -18,12 +18,12 @@ POOL=$DIR/file.pool
LOG=out${UNITTEST_NUM}.log
rm -f $LOG && touch $LOG

expect_normal_exit $PMEMPOOL$EXESUFFIX create log $POOL
expect_normal_exit $PMEMPOOL$EXESUFFIX create obj $POOL
check_file $POOL
expect_normal_exit $PMEMWRITE$EXESUFFIX $POOL TEST

expect_normal_exit ./libpmempool_test$EXESUFFIX\
-d 0 -a 1 -r 0 $POOL>> $LOG
-d 0 -a 1 -r 0 -t obj $POOL>> $LOG
check

pass
6 changes: 3 additions & 3 deletions src/test/libpmempool_api/TEST3
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2016-2018, Intel Corporation
# Copyright 2016-2023, Intel Corporation
#
#
# libpmempool_api/TEST3 -- test for checking API
Expand All @@ -18,12 +18,12 @@ POOL=$DIR/file.pool
LOG=out${UNITTEST_NUM}.log
rm -f $LOG && touch $LOG

expect_normal_exit $PMEMPOOL$EXESUFFIX create log $POOL
expect_normal_exit $PMEMPOOL$EXESUFFIX create obj $POOL
check_file $POOL
expect_normal_exit $PMEMWRITE$EXESUFFIX $POOL TEST

expect_normal_exit ./libpmempool_test$EXESUFFIX\
-d 1 -a 0 -r 0 $POOL >> $LOG
-d 1 -a 0 -r 0 -t obj $POOL >> $LOG
check

pass
6 changes: 3 additions & 3 deletions src/test/libpmempool_api/TEST4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2016-2018, Intel Corporation
# Copyright 2016-2023, Intel Corporation
#
#
# libpmempool_api/TEST4 -- test for checking API
Expand All @@ -18,12 +18,12 @@ POOL=$DIR/file.pool
LOG=out${UNITTEST_NUM}.log
rm -f $LOG && touch $LOG

expect_normal_exit $PMEMPOOL$EXESUFFIX create log $POOL
expect_normal_exit $PMEMPOOL$EXESUFFIX create obj $POOL
check_file $POOL
expect_normal_exit $PMEMWRITE$EXESUFFIX $POOL TEST

expect_normal_exit ./libpmempool_test$EXESUFFIX\
-d 1 -a 1 -r 0 $POOL >> $LOG
-d 1 -a 1 -r 0 -t obj $POOL >> $LOG
check

pass
6 changes: 3 additions & 3 deletions src/test/libpmempool_api/TEST5
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2016-2018, Intel Corporation
# Copyright 2016-2023, Intel Corporation
#
#
# libpmempool_api/TEST5 -- test for checking API
Expand All @@ -18,12 +18,12 @@ POOL=$DIR/file.pool
LOG=out${UNITTEST_NUM}.log
rm -f $LOG && touch $LOG

expect_normal_exit $PMEMPOOL$EXESUFFIX create log $POOL
expect_normal_exit $PMEMPOOL$EXESUFFIX create obj $POOL
check_file $POOL
expect_normal_exit $PMEMWRITE$EXESUFFIX $POOL TEST

expect_normal_exit ./libpmempool_test$EXESUFFIX\
-d 1 -b $POOL.backup $POOL >> $LOG
-d 1 -b $POOL.backup -t obj $POOL >> $LOG
check

pass
6 changes: 3 additions & 3 deletions src/test/libpmempool_api/TEST6
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2016-2018, Intel Corporation
# Copyright 2016-2023, Intel Corporation
#
#
# libpmempool_api/TEST6 -- test for checking API
Expand All @@ -18,12 +18,12 @@ POOL=$DIR/file.pool
LOG=out${UNITTEST_NUM}.log
rm -f $LOG && touch $LOG

expect_normal_exit $PMEMPOOL$EXESUFFIX create log $POOL
expect_normal_exit $PMEMPOOL$EXESUFFIX create obj $POOL
check_file $POOL
expect_normal_exit $PMEMWRITE$EXESUFFIX $POOL TEST

expect_normal_exit ./libpmempool_test$EXESUFFIX\
-s 0 $POOL >> $LOG
-s 0 -t obj $POOL >> $LOG
check

pass
6 changes: 3 additions & 3 deletions src/test/libpmempool_api/TEST7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2016-2018, Intel Corporation
# Copyright 2016-2023, Intel Corporation
#
#
# libpmempool_api/TEST7 -- test for checking API
Expand All @@ -18,11 +18,11 @@ POOL=$DIR/file.pool
LOG=out${UNITTEST_NUM}.log
rm -f $LOG && touch $LOG

expect_normal_exit $PMEMPOOL$EXESUFFIX create log $POOL
expect_normal_exit $PMEMPOOL$EXESUFFIX create obj $POOL
check_file $POOL
expect_normal_exit $PMEMWRITE$EXESUFFIX $POOL TEST

expect_normal_exit ./libpmempool_test$EXESUFFIX -r 0 -y 1 $POOL >> $LOG
expect_normal_exit ./libpmempool_test$EXESUFFIX -r 0 -y 1 -t obj $POOL >> $LOG
check

pass
28 changes: 0 additions & 28 deletions src/test/libpmempool_api/TEST8

This file was deleted.

Loading

0 comments on commit fc79fb4

Please sign in to comment.