summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/chains/0014rename_0
blob: bebe48d67af9ec01a0dc7564306154a0fa33a218 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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