@@ -3,13 +3,13 @@ test_warnings() {
3
3
incus query --wait /1.0/warnings\? recursion=1 | jq -r ' .[].uuid' | xargs -n1 incus warning delete
4
4
5
5
# Create a global warning (no node and no project)
6
- incus query --wait -X POST -d ' {\"type_code\": 0, \"message\": \"global warning\"}' /internal/testing /warnings
6
+ incus query --wait -X POST -d ' {\"type_code\": 0, \"message\": \"global warning\"}' /internal/debug /warnings
7
7
8
8
# More valid queries
9
- incus query --wait -X POST -d ' {\"type_code\": 0, \"message\": \"global warning\", \"project\": \"default\"}' /internal/testing /warnings
9
+ incus query --wait -X POST -d ' {\"type_code\": 0, \"message\": \"global warning\", \"project\": \"default\"}' /internal/debug /warnings
10
10
11
11
# Update the last warning. This will not create a new warning.
12
- incus query --wait -X POST -d ' {\"type_code\": 0, \"message\": \"global warning 2\", \"project\": \"default\"}' /internal/testing /warnings
12
+ incus query --wait -X POST -d ' {\"type_code\": 0, \"message\": \"global warning 2\", \"project\": \"default\"}' /internal/debug /warnings
13
13
14
14
# There should be two warnings now.
15
15
count=$( incus query --wait /1.0/warnings | jq ' length' )
@@ -19,21 +19,21 @@ test_warnings() {
19
19
[ " ${count} " -eq 2 ] || false
20
20
21
21
# Invalid query (unknown project)
22
- ! incus query --wait -X POST -d ' {\"type_code\": 0, \"message\": \"global warning\", \"project\": \"foo\"}' /internal/testing /warnings || false
22
+ ! incus query --wait -X POST -d ' {\"type_code\": 0, \"message\": \"global warning\", \"project\": \"foo\"}' /internal/debug /warnings || false
23
23
24
24
# Invalid query (unknown type code)
25
- ! incus query --wait -X POST -d ' {\"type_code\": 999, \"message\": \"global warning\"}' /internal/testing /warnings || false
25
+ ! incus query --wait -X POST -d ' {\"type_code\": 999, \"message\": \"global warning\"}' /internal/debug /warnings || false
26
26
27
27
# Both entity type code as entity ID need to be valid otherwise no warning will be created. Note that empty/null values are valid as well.
28
- ! incus query --wait -X POST -d ' {\"type_code\": 0, \"message\": \"global warning\", \"entity_type_code\": 0, \"entity_id\": 0}' /internal/testing /warnings || false
28
+ ! incus query --wait -X POST -d ' {\"type_code\": 0, \"message\": \"global warning\", \"entity_type_code\": 0, \"entity_id\": 0}' /internal/debug /warnings || false
29
29
30
30
ensure_import_testimage
31
31
32
32
# Get image ID from database instead of assuming it
33
33
image_id=$( echo ' select image_id from images_aliases where name="testimage"' | incus admin sql global - | grep -Eo ' [[:digit:]]+' )
34
34
35
35
# Create a warning with entity type "image" and entity ID ${image_id} (the imported testimage)
36
- incus query --wait -X POST -d " {\\\" type_code\\\" : 0, \\\" message\\\" : \\\" global warning\\\" , \\\" entity_type_code\\\" : 1, \\\" entity_id\\\" : ${image_id} }" /internal/testing /warnings
36
+ incus query --wait -X POST -d " {\\\" type_code\\\" : 0, \\\" message\\\" : \\\" global warning\\\" , \\\" entity_type_code\\\" : 1, \\\" entity_id\\\" : ${image_id} }" /internal/debug /warnings
37
37
38
38
# There should be three warnings now.
39
39
count=$( incus warning list --format json | jq ' length' )
0 commit comments