Skip to contentSkip to conversation

xfstests: don't use TEST_DIR before initialized in generic/313

PATCH In review Brian Foster 2 participants 2 messages Jan 28, 2014 – Jan 29, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfstests: don't use TEST_DIR before initialized in generic/313

The 'testfile' environment variable is initialized before the xfstests environment is included into generic/313. TEST_DIR is not defined at this point and causes the test to operate on the root. Move the testfile initialization down after the general environment is sourced.

---
 tests/generic/313 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/generic/313 +2 -1
index 1237ded..623c777 100755
@@ -29,7 +29,6 @@ seqres=$RESULT_DIR/$seq
 echo "QA output created by $seq"
 
 here=`pwd`
-testfile=$TEST_DIR/testfile.$seq
 status=1	# failure is the default!
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
@@ -47,6 +46,8 @@ _cleanup()
 _supported_fs generic
 _supported_os IRIX Linux
 
+testfile=$TEST_DIR/testfile.$seq
+
 echo "Silence is golden"
 
 $here/src/t_truncate_cmtime $testfile 2>&1
Signature · 6 lines
1.8.1.4

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on v1 1/1
#1 lore raw
Quoted 24 lines · Brian Foster

The 'testfile' environment variable is initialized before the xfstests environment is included into generic/313. TEST_DIR is not defined at this point and causes the test to operate on the root. Move the testfile initialization down after the general environment is sourced.

---
 tests/generic/313 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/generic/313 +0 -1
index 1237ded..623c777 100755
@@ -29,7 +29,6 @@ seqres=$RESULT_DIR/$seq
 echo "QA output created by $seq"
 
 here=`pwd`
-testfile=$TEST_DIR/testfile.$seq
 status=1	# failure is the default!
 trap "_cleanup; exit \$status" 0 1 2 3 15
 

tests/generic/313 _cleanup() · line 53

Quoted 8 lines
tests/generic/313 +2 -0
@@ -47,6 +46,8 @@ _cleanup()
 _supported_fs generic
 _supported_os IRIX Linux
 
+testfile=$TEST_DIR/testfile.$seq
+
 echo "Silence is golden"
 
 $here/src/t_truncate_cmtime $testfile 2>&1

Thanks,
-Jeff

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs