Skip to content

Commit b2ca510

Browse files
authored
ZTS: Fix zpool_reguid Makefile.am and tests
The zpool_reguid tests were not being included the dist tarball resulting in them not running. This is reported as a "failed verification" warning by the CI. Add the tests to the correct Makefile.am. Additionally, remove the usage of 'bc -e <expr>' from the tests. This option is only supported by the FreeBSD version of bc. Update the test case to reflect the 0 is not a valid GUID. Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes openzfs#16559
1 parent 05a7a95 commit b2ca510

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

tests/zfs-tests/tests/Makefile.am

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,6 +1185,10 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
11851185
functional/cli_root/zpool_prefetch/cleanup.ksh \
11861186
functional/cli_root/zpool_prefetch/setup.ksh \
11871187
functional/cli_root/zpool_prefetch/zpool_prefetch_001_pos.ksh \
1188+
functional/cli_root/zpool_reguid/cleanup.ksh \
1189+
functional/cli_root/zpool_reguid/setup.ksh \
1190+
functional/cli_root/zpool_reguid/zpool_reguid_001_pos.ksh \
1191+
functional/cli_root/zpool_reguid/zpool_reguid_002_neg.ksh \
11881192
functional/cli_root/zpool_remove/cleanup.ksh \
11891193
functional/cli_root/zpool_remove/setup.ksh \
11901194
functional/cli_root/zpool_remove/zpool_remove_001_neg.ksh \

tests/zfs-tests/tests/functional/cli_root/zpool_reguid/Makefile.am

Lines changed: 0 additions & 6 deletions
This file was deleted.

tests/zfs-tests/tests/functional/cli_root/zpool_reguid/zpool_reguid_001_pos.ksh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ if [[ "$initial_guid" == "$new_guid" ]]; then
6262
log_fail "GUID change failed; GUID has not changed: $initial_guid"
6363
fi
6464

65-
for g in "$(bc -e '2^64 - 1')" 0; do
65+
for g in "$(echo '2^64 - 1' | bc)" "314"; do
6666
set_guid "$g"
6767
done
6868
# zpool-reguid(8) will strip the leading 0.
6969
set_guid 0123 "123"
7070
# GUID "-1" is effectively 2^64 - 1 in value.
71-
set_guid -1 "$(bc -e '2^64 - 1')"
71+
set_guid -1 "$(echo '2^64 - 1' | bc)"
7272

7373
log_pass "'zpool reguid' changes GUID as expected."

tests/zfs-tests/tests/functional/cli_root/zpool_reguid/zpool_reguid_002_neg.ksh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ check_guid() {
4646

4747
log_assert "Verify 'zpool reguid' does not accept invalid GUIDs"
4848

49-
for ig in "$(bc -e '2^64')" 0xA 0xa; do
49+
for ig in "$(echo '2^64' | bc)" 0xA 0xa 0; do
5050
check_guid "$ig"
5151
done
5252

0 commit comments

Comments
 (0)