Skip to contentSkip to conversation

tests/shell: return 77/skip for tests that fail to create dummy device

PATCH New Thomas Haller 1 participant 1 message Sep 7, 2023 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/shell: return 77/skip for tests that fail to create dummy device

There are some existing tests, that skip operation when they fail to create a dummy interface. Use the new exit code 77 to indicate "SKIPPED".

I wonder why creating a dummy device would ever fail and why we don't just fail the test altogether in that case. But the patch does not change that.

---
 tests/shell/testcases/chains/netdev_chain_0   | 6 +++---
 tests/shell/testcases/json/netdev             | 2 +-
 tests/shell/testcases/listing/0020flowtable_0 | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
tests/shell/testcases/chains/netdev_chain_0 +3 -3
index 67cd715fc59f..41e724413528 100755
@@ -2,19 +2,19 @@
 
 ip link add d0 type dummy || {
         echo "Skipping, no dummy interface available"
-        exit 0
+        exit 77
 }
 trap "ip link del d0" EXIT
 
 ip link add d1 type dummy || {
         echo "Skipping, no dummy interface available"
-        exit 0
+        exit 77
 }
 trap "ip link del d1" EXIT
 
 ip link add d2 type dummy || {
         echo "Skipping, no dummy interface available"
-        exit 0
+        exit 77
 }
 trap "ip link del d2" EXIT
 
tests/shell/testcases/json/netdev +1 -1
index a16a4f5e030e..9f6033810b55 100755
@@ -2,7 +2,7 @@
 
 ip link add d0 type dummy || {
         echo "Skipping, no dummy interface available"
-        exit 0
+        exit 77
 }
 trap "ip link del d0" EXIT
 
tests/shell/testcases/listing/0020flowtable_0 +1 -1
index 47488d8ea92a..210289d70415 100755
@@ -43,7 +43,7 @@ EXPECTED3="table ip filter {
 
 ip link add d0 type dummy || {
 	echo "Skipping, no dummy interface available"
-	exit 0
+	exit 77
 }
 trap "ip link del d0" EXIT
 
Signature · 1 line
2.41.0