Skip to contentSkip to conversation

tests: shell: Add test for chain rename.

PATCH Superseded Varsha Rao 2 participants 2 messages Oct 2, 2017 netfilter

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Varsha Rao

author
#0 lore raw

PATCH 1/1 tests: shell: Add test for chain rename.

This patch adds test for chain rename use case.

---
 tests/shell/testcases/chains/0013rename_1 | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100755 tests/shell/testcases/chains/0013rename_1
tests/shell/testcases/chains/0013rename_1 new file +9 -0
new file mode 100755
index 0000000..a69d855
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+set -e
+
+$NFT add table t
+$NFT add chain t c1
+# kernel should return EEXIST
+$NFT rename chain t c1 c2 2>/dev/null
+echo "E: Renamed chain with non existing chain" >&2
Signature · 1 line
2.13.6
#1 lore raw
Quoted 14 lines · Varsha Rao

This patch adds test for chain rename use case.

---
 tests/shell/testcases/chains/0013rename_1 | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100755 tests/shell/testcases/chains/0013rename_1
tests/shell/testcases/chains/0013rename_1 new file +0 -0
new file mode 100755
index 0000000..a69d855

tests/shell/testcases/chains/0013rename_1 line 7

Quoted 7 lines
tests/shell/testcases/chains/0013rename_1 new file +7 -0
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+set -e
+
+$NFT add table t
+$NFT add chain t c1
+# kernel should return EEXIST

Wait, I guess you mean here: "kernel should not return EEXIST as per 0d18779be13766b33c69cbc26df38383598da373", right? I can mangle this line here before applying.

tests/shell/testcases/chains/0013rename_1 line 9

Quoted 2 lines
tests/shell/testcases/chains/0013rename_1 new file +2 -0
+$NFT rename chain t c1 c2 2>/dev/null
+echo "E: Renamed chain with non existing chain" >&2

BTW, could you also add a test to make sure we don't allow a rename from 'c1' to 'c2' if chain 'c2' already exists.