summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/chains/0014rename_0
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2018-07-17 07:11:12 +0200
committerFlorian Westphal <fw@strlen.de>2018-07-18 16:07:31 +0200
commit0b97683b33be6f703fa93222d0b35a6abad0b514 (patch)
treec4df3eee8bc13921bc19041d08f9f6291cbab786 /tests/shell/testcases/chains/0014rename_0
parent3454caff67cc3641770f90e4adb2e77eede2c683 (diff)
tests: add test case for rename-to-same-name
kernel currently permits chains with same name when a transaction renames 2 chains to the same new name. Add a test case for this. Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests/shell/testcases/chains/0014rename_0')
-rwxr-xr-xtests/shell/testcases/chains/0014rename_019
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/shell/testcases/chains/0014rename_0 b/tests/shell/testcases/chains/0014rename_0
new file mode 100755
index 00000000..bebe48d6
--- /dev/null
+++ b/tests/shell/testcases/chains/0014rename_0
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+$NFT add table t || exit 1
+$NFT add chain t c1 || exit 1
+$NFT add chain t c2 || exit 1
+# kernel should return EEXIST
+$NFT rename chain t c1 c2
+
+if [ $? -eq 0 ] ; then
+ echo "E: Renamed with existing chain" >&2
+ exit 1
+fi
+
+# same, should return EEXIST
+$NFT 'rename chain t c1 c3;rename chain t c2 c3'
+if [ $? -eq 0 ] ; then
+ echo "E: Renamed two chains to same name" >&2
+ exit 1
+fi