Bug #11245
closedzfstest rename_dirs_001_pos RENAME_DIRS is undefined
100%
Description
rename_dirs_001_pos contains the following after stripping comments:
. $STF_SUITE/include/libtest.shlib ... cd $TESTDIR mkdir -p 1/2/3/4/5 a/b/c/d/e $RENAME_DIRS & sleep 500 typeset -i retval=1 pgrep $RENAME_DIRS >/dev/null 2>&1 retval=$? if (( $retval == 0 )); then pkill -9 $RENAME_DIRS >/dev/null 2>&1 fi log_pass "ZFS handle race directory rename operation as expected."
However, RENAME_DIRS is never defined.
$ (cd $(git root)/usr/src/test/zfs-tests && git ls-files | xargs grep RENAME_DIRS) tests/functional/rename_dirs/rename_dirs_001_pos.ksh:$RENAME_DIRS & tests/functional/rename_dirs/rename_dirs_001_pos.ksh:pgrep $RENAME_DIRS >/dev/null 2>&1 tests/functional/rename_dirs/rename_dirs_001_pos.ksh: pkill -9 $RENAME_DIRS >/dev/null 2>&1
So, this test backgrounds nothing, sleeps 500 seconds, then declares success.
Updated by Mike Gerdts over 4 years ago
illumos lacks any history of what RENAME_DIRS used to be.
$ git log -p $(git root)/usr/src/test/zfs-tests | grep RENAME_DIRS $RENAME_DIRS & -$PGREP $RENAME_DIRS >/dev/null 2>&1 +pgrep $RENAME_DIRS >/dev/null 2>&1 - $PKILL -9 $RENAME_DIRS >/dev/null 2>&1 + pkill -9 $RENAME_DIRS >/dev/null 2>&1 +$RENAME_DIRS & +$PGREP $RENAME_DIRS >/dev/null 2>&1 + $PKILL -9 $RENAME_DIRS >/dev/null 2>&1
Since this is the only test in tests/functional/rename_dirs
, the entire directory could be whacked without losing coverage.
Updated by Mike Gerdts over 4 years ago
- Assignee set to Mike Gerdts
- Difficulty changed from Medium to Bite-size
Updated by John Kennedy over 4 years ago
$RENAME_DIRS should have been changed to "rename_dir" in 7290.
Updated by Mike Gerdts over 4 years ago
- Subject changed from zfstest rename_dirs_001_pos is pointless and always passes 500 sec later to zfstest rename_dirs_001_pos RENAME_DIRS is undefined
- Assignee deleted (
Mike Gerdts)
As John mentions, ripping this test out is the wrong approach.
Updated by Yuri Pankov over 2 years ago
Just noticed this as well, and it looks the test case is fixed in openzfs long time ago; the sleep interval is greatly reduced as well:
Updated by Matt Fiddaman over 2 years ago
To test this change I ran the test after the change, and confirmed that it still passed, and while it was running I ran prstat to check that the processes spawned and were running, I then checked the output of the test and confirmed it was the expected output from `rename_dir`.
Updated by Electric Monk over 2 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
git commit 8459c777fc1aaabb2f7dad05de1313aa169417cd
commit 8459c777fc1aaabb2f7dad05de1313aa169417cd Author: Brian Behlendorf <behlendorf1@llnl.gov> Date: 2021-05-10T14:38:01.000Z 11245 zfstest rename_dirs_001_pos RENAME_DIRS is undefined Reviewed by: Yuri Pankov <ypankov@tintri.com> Approved by: Dan McDonald <danmcd@joyent.com>