Skip to contentSkip to conversation

generic: use _qmount_option and _qmount

PATCH In review Su Yue 2 participants 4 messages Dec 8, 2025 – Jan 6

lore
Share & tools
lore

Su Yue

author
#0 lore raw

PATCH v2 1/1 generic: use _qmount_option and _qmount

This commit touches generic tests call _scratch_mount -o usrquota then chmod 777, quotacheck and quotaon. They can be simpilfied to _qmount_option and _qmount. _qmount already calls quotacheck, quota and chmod ugo+rwx. The conversions can save a few lines.

---
Changelog:
v2:
Only convert the tests calling chmod 777.

---
 tests/generic/231 | 6 ++----
 tests/generic/232 | 6 ++----
 tests/generic/233 | 6 ++----
 tests/generic/270 | 6 ++----
 4 files changed, 8 insertions(+), 16 deletions(-)
tests/generic/231 +2 -4
index ce7e62ea1886..02910523d0b5 100755
@@ -47,10 +47,8 @@ _require_quota
 _require_user
 
 _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
+_qmount_option "usrquota,grpquota"
+_qmount
 
 if ! _fsx 1; then
 	_scratch_unmount 2>/dev/null
tests/generic/232 +2 -4
index c903a5619045..21375809d299 100755
@@ -44,10 +44,8 @@ _require_scratch
 _require_quota
 
 _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
+_qmount_option "usrquota,grpquota"
+_qmount
 
 _fsstress
 _check_quota_usage
tests/generic/233 +2 -4
index 3fc1b63abb24..4606f3bde2ab 100755
@@ -59,10 +59,8 @@ _require_quota
 _require_user
 
 _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
+_qmount_option "usrquota,grpquota"
+_qmount
 setquota -u $qa_user 32000 32000 1000 1000 $SCRATCH_MNT 2>/dev/null
 
 _fsstress
tests/generic/270 +2 -4
index c3d5127a0b51..9ac829a7379f 100755
@@ -62,10 +62,8 @@ _require_command "$SETCAP_PROG" setcap
 _require_attrs security
 
 _scratch_mkfs_sized $((512 * 1024 * 1024)) >> $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
+_qmount_option "usrquota,grpquota"
+_qmount
 
 if ! _workout; then
 	_scratch_unmount 2>/dev/null
Signature · 1 line
2.50.1 (Apple Git-155)
Reviewed-by on v2 1/1
#1 lore raw
Quoted 10 lines · Su Yue

This commit touches generic tests call _scratch_mount -o usrquota then chmod 777, quotacheck and quotaon. They can be simpilfied to _qmount_option and _qmount. _qmount already calls quotacheck, quota and chmod ugo+rwx. The conversions can save a few lines.

---
Changelog:
v2:
Only convert the tests calling chmod 777.

LGTM

--D

Quoted 79 lines
---
 tests/generic/231 | 6 ++----
 tests/generic/232 | 6 ++----
 tests/generic/233 | 6 ++----
 tests/generic/270 | 6 ++----
 4 files changed, 8 insertions(+), 16 deletions(-)
tests/generic/231 +2 -4
index ce7e62ea1886..02910523d0b5 100755
@@ -47,10 +47,8 @@ _require_quota
 _require_user
 
 _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
+_qmount_option "usrquota,grpquota"
+_qmount
 
 if ! _fsx 1; then
 	_scratch_unmount 2>/dev/null
tests/generic/232 +2 -4
index c903a5619045..21375809d299 100755
@@ -44,10 +44,8 @@ _require_scratch
 _require_quota
 
 _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
+_qmount_option "usrquota,grpquota"
+_qmount
 
 _fsstress
 _check_quota_usage
tests/generic/233 +2 -4
index 3fc1b63abb24..4606f3bde2ab 100755
@@ -59,10 +59,8 @@ _require_quota
 _require_user
 
 _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
+_qmount_option "usrquota,grpquota"
+_qmount
 setquota -u $qa_user 32000 32000 1000 1000 $SCRATCH_MNT 2>/dev/null
 
 _fsstress
tests/generic/270 +2 -4
index c3d5127a0b51..9ac829a7379f 100755
@@ -62,10 +62,8 @@ _require_command "$SETCAP_PROG" setcap
 _require_attrs security
 
 _scratch_mkfs_sized $((512 * 1024 * 1024)) >> $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
+_qmount_option "usrquota,grpquota"
+_qmount
 
 if ! _workout; then
 	_scratch_unmount 2>/dev/null
Signature · 1 line
2.50.1 (Apple Git-155)
author
#2 lore raw
In reply to Su Yue
Quoted 10 lines · Su Yue

This commit touches generic tests call _scratch_mount -o usrquota then chmod 777, quotacheck and quotaon. They can be simpilfied to _qmount_option and _qmount. _qmount already calls quotacheck, quota and chmod ugo+rwx. The conversions can save a few lines.

Gentle ping.

—
Su

Quoted 82 lines

---
Changelog:
v2:
Only convert the tests calling chmod 777.
---

tests/generic/231 | 6 ++----
tests/generic/232 | 6 ++----
tests/generic/233 | 6 ++----
tests/generic/270 | 6 ++----
4 files changed, 8 insertions(+), 16 deletions(-)
tests/generic/231 +0 -0
index ce7e62ea1886..02910523d0b5 100755
@@ -47,10 +47,8 @@ _require_quota

_require_user

_scratch_mkfs >> $seqres.full 2>&1

tests/generic/231 +2 -4
-_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
+_qmount_option "usrquota,grpquota"
+_qmount

if ! _fsx 1; then
_scratch_unmount 2>/dev/null

tests/generic/232 +0 -0
index c903a5619045..21375809d299 100755
@@ -44,10 +44,8 @@ _require_scratch

_require_quota

_scratch_mkfs > $seqres.full 2>&1

tests/generic/232 +2 -4
-_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
+_qmount_option "usrquota,grpquota"
+_qmount

_fsstress
_check_quota_usage

tests/generic/233 +0 -0
index 3fc1b63abb24..4606f3bde2ab 100755
@@ -59,10 +59,8 @@ _require_quota

_require_user

_scratch_mkfs > $seqres.full 2>&1

tests/generic/233 +2 -4
-_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
+_qmount_option "usrquota,grpquota"
+_qmount

setquota -u $qa_user 32000 32000 1000 1000 $SCRATCH_MNT 2>/dev/null

_fsstress

tests/generic/270 +0 -0
index c3d5127a0b51..9ac829a7379f 100755
@@ -62,10 +62,8 @@ _require_command "$SETCAP_PROG" setcap

_require_attrs security

_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1

tests/generic/270 +2 -4
-_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
+_qmount_option "usrquota,grpquota"
+_qmount

if ! _workout; then
_scratch_unmount 2>/dev/null

Signature · 1 line
2.50.1 (Apple Git-155)
Reviewed-by
#3 lore raw
Quoted 4 lines · Glass Su
Quoted 4 lines · Su Yue
Quoted 8 lines
Quoted 6 lines

This commit touches generic tests call _scratch_mount -o usrquota then chmod 777, quotacheck and quotaon. They can be simpilfied to _qmount_option and _qmount. _qmount already calls quotacheck, quota and chmod ugo+rwx. The conversions can save a few lines.

Gentle ping.

Sorry, I've been on vacation.

--D

Quoted 86 lines

—
Su

Quoted 82 lines

---
Changelog:
v2:
Only convert the tests calling chmod 777.
---

tests/generic/231 | 6 ++----
tests/generic/232 | 6 ++----
tests/generic/233 | 6 ++----
tests/generic/270 | 6 ++----
4 files changed, 8 insertions(+), 16 deletions(-)
tests/generic/231 +0 -0
index ce7e62ea1886..02910523d0b5 100755
@@ -47,10 +47,8 @@ _require_quota

_require_user

_scratch_mkfs >> $seqres.full 2>&1

tests/generic/231 +2 -4
-_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
+_qmount_option "usrquota,grpquota"
+_qmount

if ! _fsx 1; then
_scratch_unmount 2>/dev/null

tests/generic/232 +0 -0
index c903a5619045..21375809d299 100755
@@ -44,10 +44,8 @@ _require_scratch

_require_quota

_scratch_mkfs > $seqres.full 2>&1

tests/generic/232 +2 -4
-_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
+_qmount_option "usrquota,grpquota"
+_qmount

_fsstress
_check_quota_usage

tests/generic/233 +0 -0
index 3fc1b63abb24..4606f3bde2ab 100755
@@ -59,10 +59,8 @@ _require_quota

_require_user

_scratch_mkfs > $seqres.full 2>&1

tests/generic/233 +2 -4
-_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
+_qmount_option "usrquota,grpquota"
+_qmount

setquota -u $qa_user 32000 32000 1000 1000 $SCRATCH_MNT 2>/dev/null

_fsstress

tests/generic/270 +0 -0
index c3d5127a0b51..9ac829a7379f 100755
@@ -62,10 +62,8 @@ _require_command "$SETCAP_PROG" setcap

_require_attrs security

_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1

tests/generic/270 +2 -4
-_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
+_qmount_option "usrquota,grpquota"
+_qmount

if ! _workout; then
_scratch_unmount 2>/dev/null

Signature · 1 line
2.50.1 (Apple Git-155)