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 29, 2023
1 parent 8220f51 commit 369a16e
Show file tree
Hide file tree
Showing 47 changed files with 164 additions and 556 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
30 changes: 14 additions & 16 deletions src/test/compat_incompat_features/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 2017-2019, Intel Corporation
# Copyright 2017-2023, Intel Corporation
#
#
# compat_incompat_features/TEST0 -- test for compat/incompat feature flags
Expand All @@ -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
36 changes: 17 additions & 19 deletions src/test/compat_incompat_features/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 2017-2018, Intel Corporation
# Copyright 2017-2023, Intel Corporation
#
#
# compat_incompat_features/TEST1 -- test for compat/incompat feature flags
Expand All @@ -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
# 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
# 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
# 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
# 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
# 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
40 changes: 19 additions & 21 deletions src/test/compat_incompat_features/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 2017-2018, Intel Corporation
# Copyright 2017-2023, Intel Corporation
#
#
# compat_incompat_features/TEST2 -- test for compat/incompat feature flags
Expand All @@ -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
78 changes: 38 additions & 40 deletions src/test/compat_incompat_features/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 2017-2018, Intel Corporation
# Copyright 2017-2023, Intel Corporation
#
#
# compat_incompat_features/TEST3 -- test for compat/incompat feature flags
Expand All @@ -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
36 changes: 17 additions & 19 deletions src/test/compat_incompat_features/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 2017-2018, Intel Corporation
# Copyright 2017-2023, Intel Corporation
#
#
# compat_incompat_features/TEST4 -- test for compat/incompat feature flags
Expand All @@ -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
Loading

0 comments on commit 369a16e

Please sign in to comment.