Skip to contentSkip to conversation

_require_prjquota: Disable tests only when using realtime fs

PATCH In review Chandan Rajendra 2 participants 3 messages Mar 20, 2019 – Mar 24, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 _require_prjquota: Disable tests only when using realtime fs

$USE_EXTERNAL needs to be set when using external log devices. In such a setup, tests which have "_require_prjquota
$SCRATCH_DEV" (e.g. generic/383) incorrectly end up being marked as "not run" since the test "[ "$USE_EXTERNAL" = yes -a ! -z "$_dev" ]" evaluates to true.

This commit fixes the bug by marking the test as "not run" only when $USE_EXTERNAL is set and one of $TEST_RTDEV or $SCRATCH_RTDEV is set.

---
 common/quota | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
common/quota +3 -2
index 9309e786..cb627f19 100644
@@ -86,8 +86,9 @@ _require_prjquota()
     fi
     src/feature -P $_dev
     [ $? -ne 0 ] && _notrun "Installed kernel does not support project quotas"
-    if [ "$USE_EXTERNAL" = yes -a ! -z "$_dev" ]; then
-	_notrun "Project quotas not supported on realtime filesystem"
+    if [ "$USE_EXTERNAL" = yes -a \
+		 \( ! -z "$TEST_RTDEV" \-o ! -z "$SCRATCH_RTDEV" \) ]; then
+        _notrun "Project quotas not supported on realtime filesystem"
     fi
 }
 
Signature · 1 line
2.19.1
#1 lore raw
Quoted 19 lines · Chandan Rajendra

$USE_EXTERNAL needs to be set when using external log devices. In such a setup, tests which have "_require_prjquota
$SCRATCH_DEV" (e.g. generic/383) incorrectly end up being marked as "not run" since the test "[ "$USE_EXTERNAL" = yes -a ! -z "$_dev" ]" evaluates to true.

This commit fixes the bug by marking the test as "not run" only when $USE_EXTERNAL is set and one of $TEST_RTDEV or $SCRATCH_RTDEV is set.

---
 common/quota | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
common/quota +0 -0
index 9309e786..cb627f19 100644

common/quota _require_prjquota() · line 91

Quoted 8 lines
common/quota +3 -2
@@ -86,8 +86,9 @@ _require_prjquota()
     fi
     src/feature -P $_dev
     [ $? -ne 0 ] && _notrun "Installed kernel does not support project quotas"
-    if [ "$USE_EXTERNAL" = yes -a ! -z "$_dev" ]; then
-	_notrun "Project quotas not supported on realtime filesystem"
+    if [ "$USE_EXTERNAL" = yes -a \
+		 \( ! -z "$TEST_RTDEV" \-o ! -z "$SCRATCH_RTDEV" \) ]; then
+        _notrun "Project quotas not supported on realtime filesystem"

I changed this to

if [ "$USE_EXTERNAL" = yes ]; then
if [ -n "$TEST_RTDEV" -o -n "$SCRATCH_RTDEV" ]; then
_notrun "Project quotas not supported on realtime filesystem"
fi
fi

which seems easier to read.

Thanks,
Eryu

Quoted 6 lines
common/quota +0 -0
     fi
 }
 
Signature · 1 line
2.19.1
#2 lore raw
Quoted 31 lines · IST Eryu Guan
Quoted 19 lines · Chandan Rajendra

$USE_EXTERNAL needs to be set when using external log devices. In such a setup, tests which have "_require_prjquota
$SCRATCH_DEV" (e.g. generic/383) incorrectly end up being marked as "not run" since the test "[ "$USE_EXTERNAL" = yes -a ! -z "$_dev" ]" evaluates to true.

This commit fixes the bug by marking the test as "not run" only when $USE_EXTERNAL is set and one of $TEST_RTDEV or $SCRATCH_RTDEV is set.

---
 common/quota | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
common/quota +0 -0
index 9309e786..cb627f19 100644

common/quota _require_prjquota() · line 91

Quoted 8 lines
common/quota +3 -2
@@ -86,8 +86,9 @@ _require_prjquota()
     fi
     src/feature -P $_dev
     [ $? -ne 0 ] && _notrun "Installed kernel does not support project quotas"
-    if [ "$USE_EXTERNAL" = yes -a ! -z "$_dev" ]; then
-	_notrun "Project quotas not supported on realtime filesystem"
+    if [ "$USE_EXTERNAL" = yes -a \
+		 \( ! -z "$TEST_RTDEV" \-o ! -z "$SCRATCH_RTDEV" \) ]; then
+        _notrun "Project quotas not supported on realtime filesystem"

I changed this to

Quoted 8 lines

if [ "$USE_EXTERNAL" = yes ]; then
if [ -n "$TEST_RTDEV" -o -n "$SCRATCH_RTDEV" ]; then
_notrun "Project quotas not supported on realtime filesystem"
fi
fi

which seems easier to read.

I agree that the above change makes the code more readable.

Signature · 1 line
chandan