Skip to content

Commit

Permalink
test: cleanup pmempool_check from deprecated tests
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Michalski <jan.michalski@intel.com>
  • Loading branch information
janekmi committed Jun 23, 2023
1 parent b6a5f5e commit e62a732
Show file tree
Hide file tree
Showing 38 changed files with 75 additions and 1,161 deletions.
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
40 changes: 0 additions & 40 deletions src/test/pmempool_check/TEST16

This file was deleted.

41 changes: 0 additions & 41 deletions src/test/pmempool_check/TEST17

This file was deleted.

Loading

0 comments on commit e62a732

Please sign in to comment.