summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/listing/0003table_0
diff options
context:
space:
mode:
Diffstat (limited to 'tests/shell/testcases/listing/0003table_0')
-rwxr-xr-xtests/shell/testcases/listing/0003table_025
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/shell/testcases/listing/0003table_0 b/tests/shell/testcases/listing/0003table_0
new file mode 100755
index 00000000..1b288e43
--- /dev/null
+++ b/tests/shell/testcases/listing/0003table_0
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# list table show what is expected
+
+EXPECTED="table ip test {
+}"
+
+set -e
+
+$NFT add table test
+
+GET="$($NFT list table test)"
+if [ "$EXPECTED" != "$GET" ] ; then
+ DIFF="$(which diff)"
+ [ -x $DIFF ] && $DIFF -u <(echo "$EXPECTED") <(echo "$GET")
+ exit 1
+fi
+
+# also this way
+GET="$($NFT list table ip test)"
+if [ "$EXPECTED" != "$GET" ] ; then
+ DIFF="$(which diff)"
+ [ -x $DIFF ] && $DIFF -u <(echo "$EXPECTED") <(echo "$GET")
+ exit 1
+fi