public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] generic/074: _cleanup potentially removes local FS files
@ 2017-02-05  6:58 Omer Zilberberg
  0 siblings, 0 replies; only message in thread
From: Omer Zilberberg @ 2017-02-05  6:58 UTC (permalink / raw)
  To: fstests

fstest_dir is set after _cleanup() is defined and _require_test is
called. If _require_test fails (due to some unrelated bug in tested FS),
_cleanup will attempt to remove $fstest_dir.*, which expands to .*
This has the unfortunate effect of removing xfstests' .git and
.gitignore.

Here is the 074.out.bad file for this case:
QA output created by 074
mount: permission denied
common/rc: retrying test device mount with external set
mount: permission denied
common/rc: could not mount /dev/pmem0 on /mnt
rm: refusing to remove '.' or '..' directory: skipping '.'
rm: refusing to remove '.' or '..' directory: skipping '..'
----

The only other test which could face the same problem is generic/285.
However, that test defines _cleanup after the _require* calls, and so on
_require_test failure, 285.out.bad contains the harmless:
./common/rc: line 1: _cleanup: command not found

Signed-off-by: Omer Zilberberg <omzg@plexistor.com>
---
 tests/generic/074 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/generic/074 b/tests/generic/074
index 55264bd..737b49b 100755
--- a/tests/generic/074
+++ b/tests/generic/074
@@ -28,6 +28,7 @@ echo "QA output created by $seq"
 
 here=`pwd`
 tmp=/tmp/$$
+fstest_dir=$TEST_DIR/fstest
 status=0	# success is the default!
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
@@ -45,7 +46,6 @@ _supported_os IRIX Linux
 _require_test
 
 rm -f $seqres.full
-fstest_dir=$TEST_DIR/fstest
 
 _do_test()
 {
-- 
2.9.3


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-02-05  6:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-05  6:58 [PATCH v2] generic/074: _cleanup potentially removes local FS files Omer Zilberberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox