summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/chains/0016delete_handle_0
blob: 8fd1ad864672c3599f20d3396a7439b267f01a12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

set -e
$NFT add table test-ip
$NFT add chain test-ip x
$NFT add chain test-ip y
$NFT add chain test-ip z
$NFT add table ip6 test-ip6
$NFT add chain ip6 test-ip6 x
$NFT add chain ip6 test-ip6 y
$NFT add chain ip6 test-ip6 z

chain_y_handle=$($NFT -a list ruleset | awk -v n=1 '/chain y/ && !--n {print $NF; exit}');
chain_z_handle=$($NFT -a list ruleset | awk -v n=2 '/chain z/ && !--n {print $NF; exit}');

$NFT delete chain test-ip handle $chain_y_handle
$NFT delete chain ip6 test-ip6 handle $chain_z_handle