Skip to content

Commit

Permalink
test: adjust tests to not use libpmemblk
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 28, 2023
1 parent 8220f51 commit 7ae4518
Show file tree
Hide file tree
Showing 52 changed files with 149 additions and 536 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- removes btt specific test and related btt tests tools
- removes btt support from pmemspoil
- removes libpmemlog tests and examples
- removes libpmemblk tests (partially)
- ...

Wed May 31 2023 Oksana Sałyk <oksana.salyk@intel.com>
Expand Down
1 change: 0 additions & 1 deletion src/test/compat_incompat_features/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ TARGET = pool_open
OBJS = pool_open.o

LIBPMEMOBJ=y
LIBPMEMBLK=y
USE_PMEMSPOIL=y

include ../Makefile.inc
Expand Down
28 changes: 13 additions & 15 deletions src/test/compat_incompat_features/TEST0
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,19 @@ create_poolset $POOLSET \
20M:$DIR/part0:x \
20M:$DIR/part1:x

for type in ${POOL_TYPES[@]}; do
expect_normal_exit $PMEMPOOL$EXESUFFIX rm -f $POOLSET >> $LOG_TEMP
expect_normal_exit $PMEMPOOL$EXESUFFIX create ${create_args[$type]} \
>> $LOG_TEMP

for flag in ${UNKNOWN_COMPAT[@]}; do
# Set compat/incompat flags in headers
set_compat $DIR/part0 $flag >> $LOG_TEMP
set_compat $DIR/part1 $flag >> $LOG_TEMP

# Check if pool opens
expect_normal_exit ./pool_open$EXESUFFIX $type $POOLSET 2>&1
cat $LOG >> $LOG_TEMP
cat $ERR >> $ERR_TEMP
done
expect_normal_exit $PMEMPOOL$EXESUFFIX rm -f $POOLSET >> $LOG_TEMP
expect_normal_exit $PMEMPOOL$EXESUFFIX create ${create_args[obj]} \
>> $LOG_TEMP

for flag in ${UNKNOWN_COMPAT[@]}; do
# Set compat/incompat flags in headers
set_compat $DIR/part0 $flag >> $LOG_TEMP
set_compat $DIR/part1 $flag >> $LOG_TEMP

# Check if pool opens
expect_normal_exit ./pool_open$EXESUFFIX $POOLSET 2>&1
cat $LOG >> $LOG_TEMP
cat $ERR >> $ERR_TEMP
done

mv $LOG_TEMP $LOG
Expand Down
42 changes: 20 additions & 22 deletions src/test/compat_incompat_features/TEST1
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,26 @@ create_poolset $POOLSET \
20M:$DIR/part0:x \
20M:$DIR/part1:x

for type in ${POOL_TYPES[@]}; do
# Create poolset
expect_normal_exit $PMEMPOOL$EXESUFFIX rm -f $POOLSET >> $LOG_TEMP
expect_normal_exit $PMEMPOOL$EXESUFFIX create ${create_args[$type]} \
>> $LOG_TEMP

# Set compat flag in part 0 header
set_compat $DIR/part0 ${UNKNOWN_COMPAT[0]} >> $LOG_TEMP

# Check if pool opens
expect_abnormal_exit ./pool_open$EXESUFFIX $type $POOLSET 2>&1
cat $LOG >> $LOG_TEMP
cat $ERR >> $ERR_TEMP

# Set compat flag in part 1 headers
set_compat $DIR/part1 ${UNKNOWN_COMPAT[1]} >> $LOG_TEMP

# Check if pool opens
expect_abnormal_exit ./pool_open$EXESUFFIX $type $POOLSET 2>&1
cat $LOG >> $LOG_TEMP
cat $ERR >> $ERR_TEMP
done
# Create poolset
expect_normal_exit $PMEMPOOL$EXESUFFIX rm -f $POOLSET >> $LOG_TEMP
expect_normal_exit $PMEMPOOL$EXESUFFIX create ${create_args[obj]} \
>> $LOG_TEMP

# Set compat flag in part 0 header
set_compat $DIR/part0 ${UNKNOWN_COMPAT[0]} >> $LOG_TEMP

# Check if pool opens
expect_abnormal_exit ./pool_open$EXESUFFIX $POOLSET 2>&1
cat $LOG >> $LOG_TEMP
cat $ERR >> $ERR_TEMP

# Set compat flag in part 1 headers
set_compat $DIR/part1 ${UNKNOWN_COMPAT[1]} >> $LOG_TEMP

# Check if pool opens
expect_abnormal_exit ./pool_open$EXESUFFIX $POOLSET 2>&1
cat $LOG >> $LOG_TEMP
cat $ERR >> $ERR_TEMP

mv $LOG_TEMP $LOG
mv $ERR_TEMP $ERR
Expand Down
38 changes: 18 additions & 20 deletions src/test/compat_incompat_features/TEST2
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,29 @@ create_poolset $POOLSET \
20M:$DIR/part0:x \
20M:$DIR/part1:x

for type in ${POOL_TYPES[@]}; do
# Create poolset
expect_normal_exit $PMEMPOOL$EXESUFFIX rm -f $POOLSET >> $LOG_TEMP
expect_normal_exit $PMEMPOOL$EXESUFFIX create ${create_args[$type]} \
>> $LOG_TEMP
# Create poolset
expect_normal_exit $PMEMPOOL$EXESUFFIX rm -f $POOLSET >> $LOG_TEMP
expect_normal_exit $PMEMPOOL$EXESUFFIX create ${create_args[obj]} \
>> $LOG_TEMP

# Set POOL_FEAT_SINGLEHDR incompat flag in headers
set_incompat $DIR/part0 $POOL_FEAT_SINGLEHDR >> $LOG_TEMP
set_incompat $DIR/part1 $POOL_FEAT_SINGLEHDR >> $LOG_TEMP
# Set POOL_FEAT_SINGLEHDR incompat flag in headers
set_incompat $DIR/part0 $POOL_FEAT_SINGLEHDR >> $LOG_TEMP
set_incompat $DIR/part1 $POOL_FEAT_SINGLEHDR >> $LOG_TEMP

# Check if pool fails to open
expect_abnormal_exit ./pool_open$EXESUFFIX $POOLSET 2>&1
cat $LOG >> $LOG_TEMP
cat $ERR >> $ERR_TEMP

for flag in ${UNKNOWN_INCOMPAT[@]}; do
# Set compat/incompat flags in headers
set_incompat $DIR/part0 $flag >> $LOG_TEMP
set_incompat $DIR/part1 $flag >> $LOG_TEMP

# Check if pool fails to open
expect_abnormal_exit ./pool_open$EXESUFFIX $type $POOLSET 2>&1
expect_abnormal_exit ./pool_open$EXESUFFIX $POOLSET 2>&1
cat $LOG >> $LOG_TEMP
cat $ERR >> $ERR_TEMP

for flag in ${UNKNOWN_INCOMPAT[@]}; do
# Set compat/incompat flags in headers
set_incompat $DIR/part0 $flag >> $LOG_TEMP
set_incompat $DIR/part1 $flag >> $LOG_TEMP

# Check if pool fails to open
expect_abnormal_exit ./pool_open$EXESUFFIX $type $POOLSET 2>&1
cat $LOG >> $LOG_TEMP
cat $ERR >> $ERR_TEMP
done
done

mv $LOG_TEMP $LOG
Expand Down
76 changes: 37 additions & 39 deletions src/test/compat_incompat_features/TEST3
Original file line number Diff line number Diff line change
Expand Up @@ -22,45 +22,43 @@ create_poolset $POOLSET \
20M:$DIR/part0:x \
20M:$DIR/part1:x

for type in ${POOL_TYPES[@]}; do
# Create poolset
expect_normal_exit $PMEMPOOL$EXESUFFIX rm -f $POOLSET >> $LOG_TEMP
expect_normal_exit $PMEMPOOL$EXESUFFIX create ${create_args[$type]} \
>> $LOG_TEMP

# Set compat/incompat flags in headers
set_incompat $DIR/part0 $POOL_FEAT_SINGLEHDR >> $LOG_TEMP

# Check if pool fails to open
expect_abnormal_exit ./pool_open$EXESUFFIX $type $POOLSET 2>&1
cat $LOG >> $LOG_TEMP
cat $ERR >> $ERR_TEMP

# Set compat/incompat flags in headers
set_incompat $DIR/part0 0 >> $LOG_TEMP
set_incompat $DIR/part1 $POOL_FEAT_SINGLEHDR >> $LOG_TEMP

# Check if pool fails to open
expect_abnormal_exit ./pool_open$EXESUFFIX $type $POOLSET 2>&1
cat $LOG >> $LOG_TEMP
cat $ERR >> $ERR_TEMP

# Set compat/incompat flags in headers
set_incompat $DIR/part0 ${UNKNOWN_INCOMPAT[0]} >> $LOG_TEMP

# Check if pool fails to open
expect_abnormal_exit ./pool_open$EXESUFFIX $type $POOLSET 2>&1
cat $LOG >> $LOG_TEMP
cat $ERR >> $ERR_TEMP

# Set compat/incompat flags in headers
set_incompat $DIR/part1 ${UNKNOWN_INCOMPAT[1]} >> $LOG_TEMP

# Check if pool fails to open
expect_abnormal_exit ./pool_open$EXESUFFIX $type $POOLSET 2>&1
cat $LOG >> $LOG_TEMP
cat $ERR >> $ERR_TEMP
done
# Create poolset
expect_normal_exit $PMEMPOOL$EXESUFFIX rm -f $POOLSET >> $LOG_TEMP
expect_normal_exit $PMEMPOOL$EXESUFFIX create ${create_args[obj]} \
>> $LOG_TEMP

# Set compat/incompat flags in headers
set_incompat $DIR/part0 $POOL_FEAT_SINGLEHDR >> $LOG_TEMP

# Check if pool fails to open
expect_abnormal_exit ./pool_open$EXESUFFIX $POOLSET 2>&1
cat $LOG >> $LOG_TEMP
cat $ERR >> $ERR_TEMP

# Set compat/incompat flags in headers
set_incompat $DIR/part0 0 >> $LOG_TEMP
set_incompat $DIR/part1 $POOL_FEAT_SINGLEHDR >> $LOG_TEMP

# Check if pool fails to open
expect_abnormal_exit ./pool_open$EXESUFFIX $POOLSET 2>&1
cat $LOG >> $LOG_TEMP
cat $ERR >> $ERR_TEMP

# Set compat/incompat flags in headers
set_incompat $DIR/part0 ${UNKNOWN_INCOMPAT[0]} >> $LOG_TEMP

# Check if pool fails to open
expect_abnormal_exit ./pool_open$EXESUFFIX $POOLSET 2>&1
cat $LOG >> $LOG_TEMP
cat $ERR >> $ERR_TEMP

# Set compat/incompat flags in headers
set_incompat $DIR/part1 ${UNKNOWN_INCOMPAT[1]} >> $LOG_TEMP

# Check if pool fails to open
expect_abnormal_exit ./pool_open$EXESUFFIX $POOLSET 2>&1
cat $LOG >> $LOG_TEMP
cat $ERR >> $ERR_TEMP

mv $LOG_TEMP $LOG
mv $ERR_TEMP $ERR
Expand Down
34 changes: 16 additions & 18 deletions src/test/compat_incompat_features/TEST4
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,27 @@ create_poolset $POOLSET \
20M:$DIR/part0:x \
20M:$DIR/part1:x

for type in ${POOL_TYPES[@]}; do
# Create poolset
expect_normal_exit $PMEMPOOL$EXESUFFIX rm -f $POOLSET >> $LOG_TEMP
expect_normal_exit $PMEMPOOL$EXESUFFIX create ${create_args[$type]} \
>> $LOG_TEMP
# Create poolset
expect_normal_exit $PMEMPOOL$EXESUFFIX rm -f $POOLSET >> $LOG_TEMP
expect_normal_exit $PMEMPOOL$EXESUFFIX create ${create_args[obj]} \
>> $LOG_TEMP

# Clear POOL_FEAT_SINGLEHDR incompat flag in header
set_incompat $DIR/part0 0 >> $LOG_TEMP
# Clear POOL_FEAT_SINGLEHDR incompat flag in header
set_incompat $DIR/part0 0 >> $LOG_TEMP

# Check if pool fails to open
expect_abnormal_exit ./pool_open$EXESUFFIX $POOLSET 2>&1
cat $LOG >> $LOG_TEMP
cat $ERR >> $ERR_TEMP

for flag in ${UNKNOWN_INCOMPAT[@]}; do
# Set compat/incompat flags in headers
set_incompat $DIR/part0 $flag >> $LOG_TEMP

# Check if pool fails to open
expect_abnormal_exit ./pool_open$EXESUFFIX $type $POOLSET 2>&1
expect_abnormal_exit ./pool_open$EXESUFFIX $POOLSET 2>&1
cat $LOG >> $LOG_TEMP
cat $ERR >> $ERR_TEMP

for flag in ${UNKNOWN_INCOMPAT[@]}; do
# Set compat/incompat flags in headers
set_incompat $DIR/part0 $flag >> $LOG_TEMP

# Check if pool fails to open
expect_abnormal_exit ./pool_open$EXESUFFIX $type $POOLSET 2>&1
cat $LOG >> $LOG_TEMP
cat $ERR >> $ERR_TEMP
done
done

mv $LOG_TEMP $LOG
Expand Down
3 changes: 1 addition & 2 deletions src/test/compat_incompat_features/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ rm -f $ERR_TEMP && touch $ERR_TEMP
LAYOUT=OBJ_LAYOUT$SUFFIX
POOLSET=$DIR/pool.set

POOL_TYPES=(obj blk)
POOL_TYPES=(obj)

# pmempool create arguments:
declare -A create_args
create_args[obj]="obj $POOLSET"
create_args[blk]="blk 512 $POOLSET"

# Known compat flags:

Expand Down
2 changes: 0 additions & 2 deletions src/test/compat_incompat_features/err1.log.match
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
{$(nW) main} compat_incompat_features/TEST1: Error: $(nW)pool.set: pmemobj_open failed: Invalid argument
{$(nW) main} compat_incompat_features/TEST1: Error: $(nW)pool.set: pmemobj_open failed: Invalid argument
{$(nW) main} compat_incompat_features/TEST1: Error: $(nW)pool.set: pmemblk_open failed: Invalid argument
{$(nW) main} compat_incompat_features/TEST1: Error: $(nW)pool.set: pmemblk_open failed: Invalid argument
4 changes: 0 additions & 4 deletions src/test/compat_incompat_features/err2.log.match
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,3 @@
{$(nW) main} compat_incompat_features/TEST2: Error: $(nW)pool.set: pmemobj_open failed: Invalid argument
{$(nW) main} compat_incompat_features/TEST2: Error: $(nW)pool.set: pmemobj_open failed: Invalid argument
{$(nW) main} compat_incompat_features/TEST2: Error: $(nW)pool.set: pmemobj_open failed: Invalid argument
{$(nW) main} compat_incompat_features/TEST2: Error: $(nW)pool.set: pmemblk_open failed: Invalid argument
{$(nW) main} compat_incompat_features/TEST2: Error: $(nW)pool.set: pmemblk_open failed: Invalid argument
{$(nW) main} compat_incompat_features/TEST2: Error: $(nW)pool.set: pmemblk_open failed: Invalid argument
{$(nW) main} compat_incompat_features/TEST2: Error: $(nW)pool.set: pmemblk_open failed: Invalid argument
4 changes: 0 additions & 4 deletions src/test/compat_incompat_features/err3.log.match
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,3 @@
{$(nW) main} compat_incompat_features/TEST3: Error: $(nW)pool.set: pmemobj_open failed: Invalid argument
{$(nW) main} compat_incompat_features/TEST3: Error: $(nW)pool.set: pmemobj_open failed: Invalid argument
{$(nW) main} compat_incompat_features/TEST3: Error: $(nW)pool.set: pmemobj_open failed: Invalid argument
{$(nW) main} compat_incompat_features/TEST3: Error: $(nW)pool.set: pmemblk_open failed: Invalid argument
{$(nW) main} compat_incompat_features/TEST3: Error: $(nW)pool.set: pmemblk_open failed: Invalid argument
{$(nW) main} compat_incompat_features/TEST3: Error: $(nW)pool.set: pmemblk_open failed: Invalid argument
{$(nW) main} compat_incompat_features/TEST3: Error: $(nW)pool.set: pmemblk_open failed: Invalid argument
4 changes: 0 additions & 4 deletions src/test/compat_incompat_features/err4.log.match
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,3 @@
{$(nW) main} compat_incompat_features/TEST4: Error: $(nW)pool.set: pmemobj_open failed: Invalid argument
{$(nW) main} compat_incompat_features/TEST4: Error: $(nW)pool.set: pmemobj_open failed: Invalid argument
{$(nW) main} compat_incompat_features/TEST4: Error: $(nW)pool.set: pmemobj_open failed: Invalid argument
{$(nW) main} compat_incompat_features/TEST4: Error: $(nW)pool.set: pmemblk_open failed: Invalid argument
{$(nW) main} compat_incompat_features/TEST4: Error: $(nW)pool.set: pmemblk_open failed: Invalid argument
{$(nW) main} compat_incompat_features/TEST4: Error: $(nW)pool.set: pmemblk_open failed: Invalid argument
{$(nW) main} compat_incompat_features/TEST4: Error: $(nW)pool.set: pmemblk_open failed: Invalid argument
24 changes: 4 additions & 20 deletions src/test/compat_incompat_features/out0.log.match
Original file line number Diff line number Diff line change
@@ -1,32 +1,16 @@
compat_incompat_features/TEST0: START: compat_incompat_features
$(nW)pool_open$(nW) obj $(nW)
$(nW)pool_open$(nW) $(nW)
$(nW)pool.set: pmemobj_open succeeded
compat_incompat_features/TEST0: DONE
compat_incompat_features/TEST0: START: compat_incompat_features
$(nW)pool_open$(nW) obj $(nW)
$(nW)pool_open$(nW) $(nW)
$(nW)pool.set: pmemobj_open succeeded
compat_incompat_features/TEST0: DONE
compat_incompat_features/TEST0: START: compat_incompat_features
$(nW)pool_open$(nW) obj $(nW)
$(nW)pool_open$(nW) $(nW)
$(nW)pool.set: pmemobj_open succeeded
compat_incompat_features/TEST0: DONE
compat_incompat_features/TEST0: START: compat_incompat_features
$(nW)pool_open$(nW) obj $(nW)
$(nW)pool_open$(nW) $(nW)
$(nW)pool.set: pmemobj_open succeeded
compat_incompat_features/TEST0: DONE
compat_incompat_features/TEST0: START: compat_incompat_features
$(nW)pool_open$(nW) blk $(nW)
$(nW)pool.set: pmemblk_open succeeded
compat_incompat_features/TEST0: DONE
compat_incompat_features/TEST0: START: compat_incompat_features
$(nW)pool_open$(nW) blk $(nW)
$(nW)pool.set: pmemblk_open succeeded
compat_incompat_features/TEST0: DONE
compat_incompat_features/TEST0: START: compat_incompat_features
$(nW)pool_open$(nW) blk $(nW)
$(nW)pool.set: pmemblk_open succeeded
compat_incompat_features/TEST0: DONE
compat_incompat_features/TEST0: START: compat_incompat_features
$(nW)pool_open$(nW) blk $(nW)
$(nW)pool.set: pmemblk_open succeeded
compat_incompat_features/TEST0: DONE
8 changes: 2 additions & 6 deletions src/test/compat_incompat_features/out1.log.match
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
compat_incompat_features/TEST1: START: compat_incompat_features
$(nW)pool_open$(nW) obj $(nW)pool.set
$(nW)pool_open$(nW) $(nW)pool.set
compat_incompat_features/TEST1: START: compat_incompat_features
$(nW)pool_open$(nW) obj $(nW)pool.set
compat_incompat_features/TEST1: START: compat_incompat_features
$(nW)pool_open$(nW) blk $(nW)pool.set
compat_incompat_features/TEST1: START: compat_incompat_features
$(nW)pool_open$(nW) blk $(nW)pool.set
$(nW)pool_open$(nW) $(nW)pool.set
16 changes: 4 additions & 12 deletions src/test/compat_incompat_features/out2.log.match
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
compat_incompat_features/TEST2: START: compat_incompat_features
$(nW)pool_open$(nW) obj $(nW)pool.set
$(nW)pool_open$(nW) $(nW)pool.set
compat_incompat_features/TEST2: START: compat_incompat_features
$(nW)pool_open$(nW) obj $(nW)pool.set
$(nW)pool_open$(nW) $(nW)pool.set
compat_incompat_features/TEST2: START: compat_incompat_features
$(nW)pool_open$(nW) obj $(nW)pool.set
$(nW)pool_open$(nW) $(nW)pool.set
compat_incompat_features/TEST2: START: compat_incompat_features
$(nW)pool_open$(nW) obj $(nW)pool.set
compat_incompat_features/TEST2: START: compat_incompat_features
$(nW)pool_open$(nW) blk $(nW)pool.set
compat_incompat_features/TEST2: START: compat_incompat_features
$(nW)pool_open$(nW) blk $(nW)pool.set
compat_incompat_features/TEST2: START: compat_incompat_features
$(nW)pool_open$(nW) blk $(nW)pool.set
compat_incompat_features/TEST2: START: compat_incompat_features
$(nW)pool_open$(nW) blk $(nW)pool.set
$(nW)pool_open$(nW) $(nW)pool.set
Loading

0 comments on commit 7ae4518

Please sign in to comment.