summaryrefslogtreecommitdiffstats
path: root/tests/iptreemap.t
blob: 2e9fce7ff861f4912c472fa787a30d7a2686c885 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Create a set without timeout
0 ipset -N test iptreemap
# Add first random IP entry
0 ipset -A test 2.0.0.1
# Add second random IP entry
0 ipset -A test 192.168.68.69
# Test first random IP entry
0 ipset -T test 2.0.0.1
# Test second random IP entry
0 ipset -T test 192.168.68.69
# Test value not added to the set
1 ipset -T test 2.0.0.2
# Test value not added to the set
1 ipset -T test 192.168.68.70
# Add IP range
0 ipset -A test 3.0.0.0-3.0.0.2
# Test the three members of the range: first
0 ipset -T test 3.0.0.0
# Test the three members of the range: second
0 ipset -T test 3.0.0.1
# Test the three members of the range: third
0 ipset -T test 3.0.0.2
# Delete the middle of the range
0 ipset -D test 3.0.0.1
# Test the range: first
0 ipset -T test 3.0.0.0
# Test the range: second
1 ipset -T test 3.0.0.1
# Test the range: third
0 ipset -T test 3.0.0.2
# Add a network block
0 ipset -A test 192.168.68.69/27
# Test the lower bound of the network
0 ipset -T test 192.168.68.64
# Test the upper bound of the network
0 ipset -T test 192.168.68.95
# Test element from the middle
0 ipset -T test 192.168.68.71
# Delete a network from the middle
0 ipset -D test 192.168.68.70/30
# Test lower bound of deleted network
1 ipset -T test 192.168.68.68
# Test upper bound of deleted network
1 ipset -T test 192.168.68.71
# Test element before lower bound of deleted network
0 ipset -T test 192.168.68.67
# Test element after upper bound of deleted network
0 ipset -T test 192.168.68.72
# List set
0 ipset -L test > .foo
# Check listing
0 diff .foo iptreemap.t.list0 && rm .foo
# Flush test set
0 ipset -F test
# Delete test set
0 ipset -X test
# eof