Skip to content

Commit

Permalink
tests: mixed_create_failure: explicitly note the error
Browse files Browse the repository at this point in the history
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: John Kennedy <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Issue: openzfs#13215
Closes openzfs#13259
  • Loading branch information
nabijaczleweli authored and andrewc12 committed Sep 23, 2022
1 parent 1212726 commit 9d6f3e8
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions tests/zfs-tests/tests/functional/casenorm/mixed_create_failure.ksh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ function test_ops
{
typeset obj_type=$1
typeset testdir=$2
typeset save_name=

target_obj='target-file'

Expand All @@ -83,7 +84,7 @@ function test_ops
log_note "Created test dir $test_path"

if [[ $obj_type = "symlink" || $obj_type = "hardlink" ]]; then
touch $test_path/$target_obj
> $test_path/$target_obj
log_note "Created target: $test_path/$target_obj"
op="$op $test_path/$target_obj"
fi
Expand All @@ -104,21 +105,16 @@ function test_ops
fi
fi
done
[ -n "$save_name" ] || log_fail "Didn't ENOSPC!"

log_note 'Test rename \"sample_name\" rename'
log_note 'Test rename "sample_name" rename'
TMP_OBJ="$test_path/tmp_obj"
cmd="$op $TMP_OBJ"
out=$($cmd 2>&1)
ret=$?
if (($ret != 0)); then
log_fail "$cmd failed: $out"
fi
log_must $cmd

# Now, try to rename the tmp_obj to the name which we failed to add earlier.
# This should fail as well.
out=$(mv $TMP_OBJ $save_name 2>&1)
ret=$?
if (($ret != 0)); then
if ! out=$(mv $TMP_OBJ $save_name 2>&1); then
if [[ $out = *@(No space left on device)* ]]; then
log_note "$cmd failed as expected: $out"
else
Expand Down

0 comments on commit 9d6f3e8

Please sign in to comment.