diff options
author | Tony Hutter <[email protected]> | 2017-07-24 10:58:14 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-07-24 10:58:14 -0700 |
commit | c89a02a26ae8f314c621ffd5542a3502a196b7d0 (patch) | |
tree | a775da6cba4f5e622387874b670f5d76bb0e4768 /tests | |
parent | 829f9251cf03f1b385a46960539380dd70555270 (diff) |
Add new fsck return code to zvol_misc_002_pos
zvol_misc_002_pos was failing on Fedora 26 because its newer version
of fsck was returning a different code than previous versions. The
new fsck error code is valid and is been added to the test in this
patch.
Reviewed-by: Giuseppe Di Natale <[email protected]>
Reviewed-by: George Melikov <[email protected]>
Reviewed-by: Olaf Faaland <[email protected]>
Signed-off-by: Tony Hutter <[email protected]>
Closes #6350
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_002_pos.ksh | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_002_pos.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_002_pos.ksh index c58f71f49..81b3e627a 100755 --- a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_002_pos.ksh +++ b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_002_pos.ksh @@ -91,10 +91,8 @@ while (( 1 )); do done if is_linux; then - EXIT_STATUS=4 log_must sync else - EXIT_STATUS=39 log_must lockfs -f $TESTDIR fi @@ -104,8 +102,24 @@ block_device_wait fsck -n ${ZVOL_RDEVDIR}/$TESTPOOL/$TESTVOL@snap >/dev/null 2>&1 retval=$? -if [[ $retval -ne 0 && $retval -ne $EXIT_STATUS ]]; then - log_fail "fsck exited with wrong value $retval " + +if [ $retval -ne 0 ] ; then + if is_linux ; then + # Linux's fsck returns a different code for this test depending + # on the version: + # + # e2fsprogs-1.43.3 (Fedora 25 and older): returns 4 + # e2fsprogs-1.43.4 (Fedora 26): returns 8 + # + # https://github.com/zfsonlinux/zfs/issues/6297 + if [ $retval -ne 4 -a $retval -ne 8 ] ; then + log_fail "fsck exited with wrong value $retval" + fi + else + if [ $retval -ne 39 ] ; then + log_fail "fsck exited with wrong value $retval" + fi + fi fi log_pass "Verify that ZFS volume snapshot could be fscked" |