summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/rule_management/0002addinsertlocation_1
blob: b48d3d664be200e0e88c5ae409a3f0a430aeda8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

# test rule adding with invalid position/handle/index value

RULESET="flush ruleset
table ip t {
	chain c {
		accept
		accept
	}
}"

$NFT -f - <<< "$RULESET"

for cmd in add insert; do
	for keyword in position handle index; do
		$NFT $cmd rule t c $keyword 5 drop 2>/dev/null || continue

		echo "E: invalid $keyword value allowed in $cmd command" >&2
		exit 0
	done
done
exit 1