summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/sets/0040get_host_endian_elements_0
blob: caf6a4af326a25b6eda847403ee9ee3aadac3b8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash

RULESET="table ip t {
	set s {
		type mark
		flags interval
		elements = {
			0x23-0x42, 0x1337
		}
	}
}"

$NFT -f - <<< "$RULESET" || { echo "can't apply basic ruleset"; exit 1; }

$NFT get element ip t s '{ 0x23-0x42 }' || {
	echo "can't find existing range 0x23-0x42"
	exit 1
}

$NFT get element ip t s '{ 0x26-0x28 }' || {
	echo "can't find existing sub-range 0x26-0x28"
	exit 1
}

$NFT get element ip t s '{ 0x26-0x99 }' && {
	echo "found non-existing range 0x26-0x99"
	exit 1
}

$NFT get element ip t s '{ 0x55-0x99 }' && {
	echo "found non-existing range 0x55-0x99"
	exit 1
}

$NFT get element ip t s '{ 0x55 }' && {
	echo "found non-existing element 0x55"
	exit 1
}

$NFT get element ip t s '{ 0x1337 }' || {
	echo "can't find existing element 0x1337"
	exit 1
}