Debian Codegraph @

tests/shell/testcases/chains/0014rename_0

raw
1 #!/bin/bash
2
3 $NFT add table t || exit 1
4 $NFT add chain t c1 || exit 1
5 $NFT add chain t c2 || exit 1
6 # kernel should return EEXIST
7 $NFT rename chain t c1 c2
8
9 if [ $? -eq 0 ] ; then
10 echo "E: Renamed with existing chain" >&2
11 exit 1
12 fi
13
14 # same, should return EEXIST
15 $NFT 'rename chain t c1 c3;rename chain t c2 c3'
16 if [ $? -eq 0 ] ; then
17 echo "E: Renamed two chains to same name" >&2
18 exit 1
19 fi