From 0b97683b33be6f703fa93222d0b35a6abad0b514 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Tue, 17 Jul 2018 07:11:12 +0200 Subject: 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 --- tests/shell/testcases/chains/0014rename_0 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 tests/shell/testcases/chains/0014rename_0 (limited to 'tests/shell/testcases/chains/0014rename_0') 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 -- cgit v1.2.3