Skip to contentSkip to conversation

some random fixes and cleanups

PATCH New Eryu Guan 1 participant 5 messages Jan 11, 2016 – Jan 12, 2016

lore
Share & tools
lore

Eryu Guan

author
#0 lore raw

cover some random fixes and cleanups

Just some random fixes and cleanups.

Eryu Guan (3):
generic/23[23]: some cleanups
common: no need to parse config file in new
new: create a default .out file

 common/config     |  5 +++++
 new               |  6 ++++++
 tests/generic/232 | 17 ++++-------------
 tests/generic/233 | 20 ++++----------------
 4 files changed, 19 insertions(+), 29 deletions(-)
Signature · 1 line
2.5.0
author
#1 lore raw

PATCH 1/3 generic/23[23]: some cleanups

1. remove $seqres.full before test
2. no need to check return values of _fsstress and _check_quota_usage calls, the golden image could catch the failures.
3. remove unused FSX related variables

---
 tests/generic/232 | 17 ++++-------------
 tests/generic/233 | 20 ++++----------------
 2 files changed, 8 insertions(+), 29 deletions(-)
tests/generic/232 +4 -13
index b3f6b7e..1323809 100755
@@ -71,23 +71,14 @@ _require_scratch
 _require_quota
 _need_to_be_root
 
-_scratch_mkfs >> $seqres.full 2>&1
+_scratch_mkfs > $seqres.full 2>&1
 _scratch_mount "-o usrquota,grpquota"
 chmod 777 $SCRATCH_MNT
 quotacheck -u -g $SCRATCH_MNT 2>/dev/null
 quotaon -u -g $SCRATCH_MNT 2>/dev/null
 
-if ! _fsstress; then
-	_scratch_unmount 2>/dev/null
-	exit
-fi
-
-if ! _check_quota_usage; then
-	_scratch_unmount 2>/dev/null
-	status=1
-	exit
-fi
-
-_scratch_unmount 2>/dev/null
+_fsstress
+_check_quota_usage
+_scratch_unmount
 status=0
 exit
tests/generic/233 +4 -16
index 95255f8..d50d280 100755
@@ -38,9 +38,6 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 . ./common/filter
 . ./common/quota
 
-FSX_FILE_SIZE=64000000
-FSX_ARGS="-q -l $FSX_FILE_SIZE -o 65536 -S 191110531 -N 100000"
-
 _filter_num()
 {
 	tee -a $seqres.full |\
@@ -79,24 +76,15 @@ _require_quota
 _require_user
 _need_to_be_root
 
-_scratch_mkfs >> $seqres.full 2>&1
+_scratch_mkfs > $seqres.full 2>&1
 _scratch_mount "-o usrquota,grpquota"
 chmod 777 $SCRATCH_MNT
 quotacheck -u -g $SCRATCH_MNT 2>/dev/null
 quotaon -u -g $SCRATCH_MNT 2>/dev/null
 setquota -u $qa_user 32000 32000 1000 1000 $SCRATCH_MNT 2>/dev/null
 
-if ! _fsstress; then
-	_scratch_unmount 2>/dev/null
-	exit
-fi
-
-if ! _check_quota_usage; then
-	_scratch_unmount 2>/dev/null
-	status=1
-	exit
-fi
-
-_scratch_unmount 2>/dev/null
+_fsstress
+_check_quota_usage
+_scratch_unmount
 status=0
 exit
Signature · 1 line
2.5.0
author
#2 lore raw

PATCH 2/3 common: no need to parse config file in new

In reply to Eryu Guan

I saw "new" failed the TEST_DIR/SCRATCH_MNT validation when TEST_DIR or SCRATCH_MNT points to directory, which is needed in overlayfs testing.

"new" only generates test template and doesn't need common/config to parse and validate TEST_DEV/TEST_DIR etc., so just returns after setting all needed commands.

---
 common/config | 5 +++++
 1 file changed, 5 insertions(+)
common/config +5 -0
index cb34fd7..9aa06a3 100644
@@ -270,6 +270,11 @@ fi
 rm -f /tmp/crc_check.img
 export XFS_MKFS_HAS_NO_META_SUPPORT
 
+# new doesn't need config file parsed, we can stop here
+if [ "$iam" == "new" ]; then
+	return 0
+fi
+
 _mount_opts()
 {
 	case $FSTYP in
Signature · 1 line
2.5.0
author
#4 lore raw

PATCH 3/3 new: create a default .out file

In reply to Eryu Guan

Creating a default .out file in "new" to ease the new test creation process.

---
 new | 6 ++++++
 1 file changed, 6 insertions(+)
new +6 -0
index ab2af69..c21d8db 100755
@@ -228,6 +228,12 @@ echo ""
 chmod 755 $tdir/$id
 ${EDITOR-vi} $tdir/$id
 
+# Create default .out file
+cat <<End-of-File >$tdir/$id.out
+QA output created by $id
+Silence is golden
+End-of-File
+
 if [ $# -eq 0 ]
 then
 
Signature · 1 line
2.5.0
author
#3 lore raw

PATCH v2 1/1 common: no need to parse config file in new

In reply to Eryu Guan

I saw "new" failed the TEST_DEV/SCRATCH_DEV validation when TEST_DEV or SCRATCH_DEV points to directory, which is needed in overlayfs testing.

"new" only generates test template and doesn't need common/config to parse and validate TEST_DEV/SCRATCH_DEV etc., so just returns after setting all needed commands.

---
v2:
- update commit log, s/_DIR/_DEV/

 common/config | 5 +++++
 1 file changed, 5 insertions(+)
common/config +5 -0
index cb34fd7..9aa06a3 100644
@@ -270,6 +270,11 @@ fi
 rm -f /tmp/crc_check.img
 export XFS_MKFS_HAS_NO_META_SUPPORT
 
+# new doesn't need config file parsed, we can stop here
+if [ "$iam" == "new" ]; then
+	return 0
+fi
+
 _mount_opts()
 {
 	case $FSTYP in
Signature · 1 line
2.5.0