Skip to content

Commit

Permalink
Merge pull request #5746 from janekmi/remove_deprecated_pmempool_check
Browse files Browse the repository at this point in the history
test: cleanup pmempool_check from deprecated tests
  • Loading branch information
janekmi authored Jun 28, 2023
2 parents b95f2a1 + 775d429 commit 9a490e5
Show file tree
Hide file tree
Showing 40 changed files with 143 additions and 878 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

This release:
- removes libpmempool API tests that use log/blk/btt pool types (partially)
- removes pmempool check tests that use log/blk/btt pool types
- ...

Wed May 31 2023 Oksana Sałyk <oksana.salyk@intel.com>
Expand Down
28 changes: 7 additions & 21 deletions src/test/pmempool_check/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 2014-2018, Intel Corporation
# Copyright 2014-2023, Intel Corporation
#
#
# pmempool_check/TEST0 -- test for checking pools
Expand All @@ -18,39 +18,25 @@ POOL=$DIR/file.pool
LOG=out${UNITTEST_NUM}.log
rm -f $LOG && touch $LOG

echo "PMEMLOG: consistent" >> $LOG
echo "PMEMOBJ: consistent" >> $LOG
rm -f $POOL
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 $PMEMPOOL$EXESUFFIX check $POOL >> $LOG

echo "PMEMBLK: consistent" >> $LOG
echo "PMEMOBJ: consistent" >> $LOG
rm -f $POOL
expect_normal_exit $PMEMPOOL$EXESUFFIX create blk 512 $POOL
expect_normal_exit $PMEMPOOL$EXESUFFIX create obj $POOL
check_file $POOL
expect_normal_exit $PMEMWRITE$EXESUFFIX $POOL 0:w:TEST0
expect_normal_exit $PMEMWRITE$EXESUFFIX $POOL 1:w:TEST0
expect_normal_exit $PMEMWRITE$EXESUFFIX $POOL 2:w:TEST0
expect_normal_exit $PMEMPOOL$EXESUFFIX check $POOL >> $LOG

echo "PMEMLOG: pool_hdr" >> $LOG
echo "PMEMOBJ: pool_hdr" >> $LOG
rm -f $POOL
expect_normal_exit $PMEMPOOL$EXESUFFIX create log $POOL
check_file $POOL
$PMEMSPOIL -v $POOL pool_hdr.signature=ERROR >> $LOG
expect_abnormal_exit $PMEMPOOL$EXESUFFIX check $POOL >> $LOG

echo "PMEMLOG: pmemlog" >> $LOG
rm -f $POOL
expect_normal_exit $PMEMPOOL$EXESUFFIX create log $POOL
check_file $POOL
$PMEMSPOIL -v $POOL pmemlog.start_offset=0 pmemlog.end_offset=0 >> $LOG
expect_abnormal_exit $PMEMPOOL$EXESUFFIX check $POOL >> $LOG

echo "PMEMBLK: pool_hdr" >> $LOG
rm -f $POOL
expect_normal_exit $PMEMPOOL$EXESUFFIX create blk 512 $POOL
expect_normal_exit $PMEMPOOL$EXESUFFIX create obj $POOL
check_file $POOL
$PMEMSPOIL -v $POOL pool_hdr.signature=ERROR >> $LOG
expect_abnormal_exit $PMEMPOOL$EXESUFFIX check $POOL >> $LOG
Expand Down
30 changes: 7 additions & 23 deletions src/test/pmempool_check/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 2014-2019, Intel Corporation
# Copyright 2014-2023, Intel Corporation
#
#
# pmempool_check/TEST1 -- test for checking pools
Expand All @@ -18,8 +18,8 @@ POOL=$DIR/file.pool
LOG=out${UNITTEST_NUM}.log
rm -f $LOG && touch $LOG

echo "PMEMLOG: pool_hdr" >> $LOG
expect_normal_exit $PMEMPOOL$EXESUFFIX create log $POOL
echo "PMEMOBJ: pool_hdr" >> $LOG
expect_normal_exit $PMEMPOOL$EXESUFFIX create obj $POOL
check_file $POOL
$PMEMSPOIL -v $POOL pool_hdr.major=0x0\
pool_hdr.features.compat=0xfe\
Expand All @@ -29,35 +29,19 @@ $PMEMSPOIL -v $POOL pool_hdr.major=0x0\
pool_hdr.shutdown_state.uuid=0\
'pool_hdr.shutdown_state.f:checksum_gen'\
pool_hdr.unused=ERROR >> $LOG
expect_normal_exit $PMEMPOOL$EXESUFFIX check -vry $POOL >> $LOG
expect_abnormal_exit $PMEMPOOL$EXESUFFIX check -vry $POOL >> $LOG

echo "PMEMLOG: pmemlog" >> $LOG
echo "PMEMOBJ: pool_hdr" >> $LOG
rm -f $POOL
expect_normal_exit $PMEMPOOL$EXESUFFIX create log $POOL
check_file $POOL
$PMEMSPOIL -v $POOL pmemlog.start_offset=0\
pmemlog.end_offset=0 >> $LOG
expect_normal_exit $PMEMPOOL$EXESUFFIX check -vry $POOL >> $LOG

echo "PMEMBLK: pool_hdr" >> $LOG
rm -f $POOL
expect_normal_exit $PMEMPOOL$EXESUFFIX create -w blk 512 $POOL
expect_normal_exit $PMEMPOOL$EXESUFFIX create obj $POOL
check_file $POOL
$PMEMSPOIL -v $POOL pool_hdr.signature=ERROR\
pool_hdr.major=0xff\
pool_hdr.features.compat=0xfe\
pool_hdr.features.incompat=0xfb\
pool_hdr.features.ro_compat=0xff\
pool_hdr.unused=ERROR >> $LOG
expect_normal_exit $PMEMPOOL$EXESUFFIX check -vry $POOL >> $LOG

echo "PMEMBLK: pmemblk" >> $LOG
rm -f $POOL
expect_normal_exit $PMEMPOOL$EXESUFFIX create -w blk 512 $POOL
check_file $POOL
$PMEMSPOIL -v $POOL pool_hdr.signature=ERROR\
pmemblk.bsize=0 >> $LOG
expect_normal_exit $PMEMPOOL$EXESUFFIX check -vry $POOL >> $LOG
expect_abnormal_exit $PMEMPOOL$EXESUFFIX check -vry $POOL >> $LOG

check

Expand Down
37 changes: 0 additions & 37 deletions src/test/pmempool_check/TEST13

This file was deleted.

11 changes: 1 addition & 10 deletions src/test/pmempool_check/TEST14
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
#
#
# pmempool_check/TEST14 -- test for checking pools with device dax
Expand Down Expand Up @@ -28,20 +28,11 @@ expect_normal_exit $PMEMPOOL$EXESUFFIX create obj $POOLSET
expect_normal_exit $PMEMPOOL$EXESUFFIX check -v $POOLSET >> $LOG
expect_normal_exit $PMEMPOOL$EXESUFFIX info $POOLSET &> /dev/null

expect_normal_exit $PMEMPOOL$EXESUFFIX rm $DEVICE_DAX_PATH
expect_normal_exit $PMEMPOOL$EXESUFFIX create log $POOLSET
expect_normal_exit $PMEMPOOL$EXESUFFIX check -v $POOLSET >> $LOG
expect_normal_exit $PMEMPOOL$EXESUFFIX info $POOLSET &> /dev/null

#remove the pools in the poolset while preserving the file itself
expect_normal_exit $PMEMPOOL$EXESUFFIX rm -s $POOLSET
#verify that the poolset still exists
check_files $POOLSET

expect_normal_exit $PMEMPOOL$EXESUFFIX create -w blk 512 $POOLSET
expect_normal_exit $PMEMPOOL$EXESUFFIX check -v $POOLSET >> $LOG
expect_normal_exit $PMEMPOOL$EXESUFFIX info $POOLSET &> /dev/null

check

pass
84 changes: 38 additions & 46 deletions src/test/pmempool_check/TEST15
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
#
#
# pmempool_check/TEST15 -- test for checking poolset with valid parts but with
Expand All @@ -27,61 +27,53 @@ PARTS="$PART1 $PART2 $PART3 $PART4"
LOG=out${UNITTEST_NUM}.log
rm -f $LOG && touch $LOG

for args in "log" "blk 512" "obj" ; do
echo "Arguments: create $args" >> $LOG
echo "Arguments: create obj" >> $LOG
input_types=`seq 2`
output_types=`seq 3`

if [ "$args" == "obj" ]; then
input_types=`seq 2`
output_types=`seq 3`
else
input_types=1
output_types=1
fi
for input_type in $input_types; do

for input_type in $input_types; do
case "$input_type" in
1)
echo "Input: two parts per poolset" >> $LOG
create_poolset $POOLSET1 32M:$PART1 32M:$PART2
create_poolset $POOLSET2 32M:$PART3 32M:$PART4
;;
2)
echo "Input: two replicas per poolset" >> $LOG
create_poolset $POOLSET1 32M:$PART1 R 32M:$PART2
create_poolset $POOLSET2 32M:$PART3 R 32M:$PART4
;;
esac

case "$input_type" in
for output_type in $output_types; do

case "$output_type" in
1)
echo "Input: two parts per poolset" >> $LOG
create_poolset $POOLSET1 32M:$PART1 32M:$PART2
create_poolset $POOLSET2 32M:$PART3 32M:$PART4
echo "Output: four parts in poolset" >> $LOG
create_poolset $POOLSET 32M:$PART1 32M:$PART2 \
32M:$PART3 32M:$PART4
;;
2)
echo "Input: two replicas per poolset" >> $LOG
create_poolset $POOLSET1 32M:$PART1 R 32M:$PART2
create_poolset $POOLSET2 32M:$PART3 R 32M:$PART4
echo "Output: two replicas with two parts each in poolset" >> $LOG
create_poolset $POOLSET 32M:$PART1 32M:$PART2 \
R 32M:$PART3 32M:$PART4
;;
3)
echo "Output: four replicas in poolset" >> $LOG
create_poolset $POOLSET 32M:$PART1 R 32M:$PART2 \
R 32M:$PART3 R 32M:$PART4
;;
esac

for output_type in $output_types; do

case "$output_type" in
1)
echo "Output: four parts in poolset" >> $LOG
create_poolset $POOLSET 32M:$PART1 32M:$PART2 \
32M:$PART3 32M:$PART4
;;
2)
echo "Output: two replicas with two parts each in poolset" >> $LOG
create_poolset $POOLSET 32M:$PART1 32M:$PART2 \
R 32M:$PART3 32M:$PART4
;;
3)
echo "Output: four replicas in poolset" >> $LOG
create_poolset $POOLSET 32M:$PART1 R 32M:$PART2 \
R 32M:$PART3 R 32M:$PART4
;;
esac

rm -f $PARTS
expect_normal_exit $PMEMPOOL$EXESUFFIX create $args $POOLSET1
expect_normal_exit $PMEMPOOL$EXESUFFIX create $args $POOLSET2
check_files $PARTS
rm -f $PARTS
expect_normal_exit $PMEMPOOL$EXESUFFIX create obj $POOLSET1
expect_normal_exit $PMEMPOOL$EXESUFFIX create obj $POOLSET2
check_files $PARTS

expect_abnormal_exit $PMEMPOOL$EXESUFFIX check -v $POOLSET >> $LOG
expect_abnormal_exit $PMEMPOOL$EXESUFFIX check -vry $POOLSET >> $LOG
expect_abnormal_exit $PMEMPOOL$EXESUFFIX check -vary $POOLSET >> $LOG
done
expect_abnormal_exit $PMEMPOOL$EXESUFFIX check -v $POOLSET >> $LOG
expect_abnormal_exit $PMEMPOOL$EXESUFFIX check -vry $POOLSET >> $LOG
expect_abnormal_exit $PMEMPOOL$EXESUFFIX check -vary $POOLSET >> $LOG
done
done

Expand Down
8 changes: 4 additions & 4 deletions src/test/pmempool_check/TEST16
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
#
#
# pmempool_check/TEST16 -- test for checking and fixing pool files crtime
Expand All @@ -21,7 +21,7 @@ LOG=out${UNITTEST_NUM}.log
rm -f $LOG && touch $LOG

create_poolset $POOLSET 20M:$POOL_P1:z 20M:$POOL_P2:z
expect_normal_exit $PMEMPOOL$EXESUFFIX create log $POOLSET
expect_normal_exit $PMEMPOOL$EXESUFFIX create obj $POOLSET

TIME=$($DATE +"%s")
let "FUTURE_TIME=$TIME+60*60"
Expand All @@ -32,8 +32,8 @@ touch -mt $PAST_TIME $POOL_P1

expect_abnormal_exit $PMEMPOOL$EXESUFFIX check -v $POOLSET >> $LOG
expect_abnormal_exit $PMEMPOOL$EXESUFFIX check -vry $POOLSET >> $LOG
expect_normal_exit $PMEMPOOL$EXESUFFIX check -vrya $POOLSET >> $LOG
expect_normal_exit $PMEMPOOL$EXESUFFIX info $POOLSET &> /dev/null
expect_abnormal_exit $PMEMPOOL$EXESUFFIX check -vrya $POOLSET >> $LOG
expect_abnormal_exit $PMEMPOOL$EXESUFFIX info $POOLSET &> /dev/null

check

Expand Down
8 changes: 4 additions & 4 deletions src/test/pmempool_check/TEST17
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 2014-2018, Intel Corporation
# Copyright 2014-2023, Intel Corporation
#
#
# pmempool_check/TEST17 -- test for limit checksum generation to check run with
Expand All @@ -22,7 +22,7 @@ LOG=out${UNITTEST_NUM}.log
rm -f $LOG && touch $LOG

create_poolset $POOLSET 20M:$POOL_P1:z 20M:$POOL_P2:z
expect_normal_exit $PMEMPOOL$EXESUFFIX create log $POOLSET
expect_normal_exit $PMEMPOOL$EXESUFFIX create obj $POOLSET

$PMEMSPOIL -v $POOL_P1 pool_hdr.checksum=0x0 >> $LOG

Expand All @@ -33,8 +33,8 @@ $PMEMSPOIL -v $POOL_P1 pool_hdr.uuid=ERROR >> $LOG
expect_abnormal_exit $PMEMPOOL$EXESUFFIX check -vry $POOLSET >> $LOG
expect_abnormal_exit $PMEMPOOL$EXESUFFIX info $POOLSET &> /dev/null

expect_normal_exit $PMEMPOOL$EXESUFFIX check -avry $POOLSET >> $LOG
expect_normal_exit $PMEMPOOL$EXESUFFIX info $POOLSET &> /dev/null
expect_abnormal_exit $PMEMPOOL$EXESUFFIX check -avry $POOLSET >> $LOG
expect_abnormal_exit $PMEMPOOL$EXESUFFIX info $POOLSET &> /dev/null

check

Expand Down
8 changes: 4 additions & 4 deletions src/test/pmempool_check/TEST18
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 2014-2018, Intel Corporation
# Copyright 2014-2023, Intel Corporation
#
#
# pmempool_check/TEST18 -- test for fixing various fields repairability without
Expand All @@ -23,16 +23,16 @@ rm -f $LOG && touch $LOG

create_poolset $POOLSET 20M:$POOL_P1:z 50M:$POOL_P2:z

expect_normal_exit $PMEMPOOL$EXESUFFIX create log $POOLSET
expect_normal_exit $PMEMPOOL$EXESUFFIX create obj $POOLSET

$PMEMSPOIL -v $POOL_P1\
pool_hdr.major=0x0\
pool_hdr.poolset_uuid=0x0\
pool_hdr.uuid=0x0\
>> $LOG

expect_normal_exit $PMEMPOOL$EXESUFFIX check -rvy $POOLSET >> $LOG
expect_normal_exit $PMEMPOOL$EXESUFFIX info $POOLSET &> /dev/null
expect_abnormal_exit $PMEMPOOL$EXESUFFIX check -rvy $POOLSET >> $LOG
expect_abnormal_exit $PMEMPOOL$EXESUFFIX info $POOLSET &> /dev/null

check

Expand Down
Loading

0 comments on commit 9a490e5

Please sign in to comment.