Project

General

Profile

Actions

Bug #11245

closed

zfstest rename_dirs_001_pos RENAME_DIRS is undefined

Added by Mike Gerdts almost 3 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
zfs - Zettabyte File System
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

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.

Actions #1

Updated by Mike Gerdts almost 3 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.

Actions #2

Updated by Mike Gerdts almost 3 years ago

  • Assignee set to Mike Gerdts
  • Difficulty changed from Medium to Bite-size
Actions #3

Updated by John Kennedy almost 3 years ago

$RENAME_DIRS should have been changed to "rename_dir" in 7290.

Actions #4

Updated by Mike Gerdts almost 3 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.

Actions #5

Updated by Yuri Pankov over 1 year 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:

https://github.com/openzfs/zfs/blob/master/tests/zfs-tests/tests/functional/rename_dirs/rename_dirs_001_pos.ksh#L61

Actions #6

Updated by Electric Monk about 1 year ago

  • Gerrit CR set to 1461
Actions #7

Updated by Matt Fiddaman about 1 year ago

  • Assignee set to Matt Fiddaman
Actions #8

Updated by Matt Fiddaman about 1 year 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`.

Actions #9

Updated by Electric Monk about 1 year 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>

Actions

Also available in: Atom PDF