@@ -16,6 +16,14 @@ test_filtering() {
16
16
17
17
incus init testimage c1
18
18
incus init testimage c2
19
+ incus project create foo
20
+ incus profile create foo
21
+ incus network zone create foo
22
+ incus network zone record create foo foo
23
+ incus network zone record create foo bar
24
+ incus network zone create bar
25
+ incus network integration create foo ovn
26
+ incus network integration create bar ovn
19
27
20
28
count=$( curl -G --unix-socket " $INCUS_DIR /unix.socket" " incus/1.0/instances" --data-urlencode " recursion=0" --data-urlencode " filter=name eq c1" | jq " .metadata | length" )
21
29
[ " ${count} " = " 1" ] || false
@@ -32,8 +40,32 @@ test_filtering() {
32
40
count=$( curl -G --unix-socket " $INCUS_DIR /unix.socket" " incus/1.0/images" --data-urlencode " recursion=1" --data-urlencode " filter=properties.os eq Ubuntu" | jq " .metadata | length" )
33
41
[ " ${count} " = " 0" ] || false
34
42
43
+ count=$( curl -G --unix-socket " $INCUS_DIR /unix.socket" " incus/1.0/images" --data-urlencode " recursion=0" --data-urlencode " filter=properties.os eq BusyBox" | jq " .metadata | length" )
44
+ [ " ${count} " = " 1" ] || false
45
+
46
+ count=$( curl -G --unix-socket " $INCUS_DIR /unix.socket" " incus/1.0/projects" --data-urlencode " recursion=0" --data-urlencode " filter=name eq foo" | jq " .metadata | length" )
47
+ [ " ${count} " = " 1" ] || false
48
+
49
+ count=$( curl -G --unix-socket " $INCUS_DIR /unix.socket" " incus/1.0/profiles" --data-urlencode " recursion=0" --data-urlencode " filter=name eq foo" | jq " .metadata | length" )
50
+ [ " ${count} " = " 1" ] || false
51
+
52
+ count=$( curl -G --unix-socket " $INCUS_DIR /unix.socket" " incus/1.0/network-zones" --data-urlencode " recursion=0" --data-urlencode " filter=name eq foo" | jq " .metadata | length" )
53
+ [ " ${count} " = " 1" ] || false
54
+
55
+ count=$( curl -G --unix-socket " $INCUS_DIR /unix.socket" " incus/1.0/network-zones/foo/records" --data-urlencode " recursion=0" --data-urlencode " filter=name eq foo" | jq " .metadata | length" )
56
+ [ " ${count} " = " 1" ] || false
57
+
58
+ count=$( curl -G --unix-socket " $INCUS_DIR /unix.socket" " incus/1.0/network-integrations" --data-urlencode " recursion=0" --data-urlencode " filter=name eq foo" | jq " .metadata | length" )
59
+ [ " ${count} " = " 1" ] || false
60
+
35
61
incus delete c1
36
62
incus delete c2
63
+ incus project delete foo
64
+ incus profile delete foo
65
+ incus network zone delete foo
66
+ incus network zone delete bar
67
+ incus network integration delete foo
68
+ incus network integration delete bar
37
69
)
38
70
39
71
kill_incus " ${INCUS_FILTERING_DIR} "
0 commit comments