summaryrefslogtreecommitdiffstats
path: root/tests/setlist.t
blob: ed21396d4e4c1f9daa14bde18902ba12f40d988e (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
# Setlist: Create base set foo
0 ipset -N foo ipmap --from 2.0.0.1 --to 2.1.0.0
# Setlist: Create base set bar
0 ipset -N bar iphash
# Setlist: Create setlist kind of set
0 ipset -N test setlist
# Setlist: Add foo set to setlist
0 ipset -A test foo
# Setlist: Test foo set in setlist
0 ipset -T test foo
# Setlist: Test nonexistent set in setlist
1 ipset -T test nonexistent
# Setlist: Try to delete foo set
1 ipset -X foo
# Setlist: Add bar set to setlist, after foo
0 ipset -A test bar
# Setlist: Test bar,after,foo
0 ipset -T test bar,after,foo
# Setlist: Test foo,before,bar
0 ipset -T test foo,before,bar
# Setlist: Test bar,before,foo
1 ipset -T test bar,before,foo
# Setlist: Test foo,after,bar
1 ipset -T test foo,after,bar
# Setlist: Save sets
0 ipset -S > setlist.t.restore
# Setlist: Delete bar,before,foo
1 ipset -D test bar,before,foo
# Setlist: Delete foo,after,bar
1 ipset -D test foo,after,bar
# Setlist: Delete bar,after,foo
0 ipset -D test bar,after,foo
# Setlist: Flush test set
0 ipset -F test
# Setlist: Delete test set
0 ipset -X test
# Setlist: Delete all sets
0 ipset -X
# Setlist: Restore saved sets
0 ipset -R < setlist.t.restore
# Setlist: List set
0 ipset -L test > .foo
# Setlist: Check listing
0 diff .foo setlist.t.list0 && rm .foo
# Setlist: Flush all sets
0 ipset -F
# Setlist: Delete all sets
0 ipset -X && rm setlist.t.restore
# eof