]> git.proxmox.com Git - mirror_qemu.git/commitdiff
tests: add oob-test for qapi-schema
authorPeter Xu <peterx@redhat.com>
Mon, 26 Mar 2018 06:38:59 +0000 (14:38 +0800)
committerEric Blake <eblake@redhat.com>
Tue, 27 Mar 2018 15:17:45 +0000 (10:17 -0500)
It simply tests the new OOB capability, and make sure the QAPISchema can
parse it correctly.

Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20180326063901.27425-7-peterx@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
tests/Makefile.include
tests/qapi-schema/oob-test.err [new file with mode: 0644]
tests/qapi-schema/oob-test.exit [new file with mode: 0644]
tests/qapi-schema/oob-test.json [new file with mode: 0644]
tests/qapi-schema/oob-test.out [new file with mode: 0644]
tests/qapi-schema/qapi-schema-test.json
tests/qapi-schema/qapi-schema-test.out
tests/test-qmp-cmds.c

index eb218a9539d605255078462d04ed5ede30b485ed..3b9a5e31a2c23966e767261e69033ca12910177e 100644 (file)
@@ -523,6 +523,7 @@ qapi-schema += missing-comma-object.json
 qapi-schema += missing-type.json
 qapi-schema += nested-struct-data.json
 qapi-schema += non-objects.json
+qapi-schema += oob-test.json
 qapi-schema += pragma-doc-required-crap.json
 qapi-schema += pragma-extra-junk.json
 qapi-schema += pragma-name-case-whitelist-crap.json
diff --git a/tests/qapi-schema/oob-test.err b/tests/qapi-schema/oob-test.err
new file mode 100644 (file)
index 0000000..35b60f7
--- /dev/null
@@ -0,0 +1 @@
+tests/qapi-schema/oob-test.json:2: 'allow-oob' of command 'oob-command-1' should only use true value
diff --git a/tests/qapi-schema/oob-test.exit b/tests/qapi-schema/oob-test.exit
new file mode 100644 (file)
index 0000000..d00491f
--- /dev/null
@@ -0,0 +1 @@
+1
diff --git a/tests/qapi-schema/oob-test.json b/tests/qapi-schema/oob-test.json
new file mode 100644 (file)
index 0000000..da96359
--- /dev/null
@@ -0,0 +1,2 @@
+# Check against oob illegal value
+{ 'command': 'oob-command-1', 'allow-oob': 'some-string' }
diff --git a/tests/qapi-schema/oob-test.out b/tests/qapi-schema/oob-test.out
new file mode 100644 (file)
index 0000000..e69de29
index c72dbd805092ebe008e932f20b956b5bc0fbdf4c..06e30f452ea2e3b2d6d8778a5969840e814f582b 100644 (file)
 { 'command': 'boxed-struct', 'boxed': true, 'data': 'UserDefZero' }
 { 'command': 'boxed-union', 'data': 'UserDefNativeListUnion', 'boxed': true }
 
+# Smoke test on Out-Of-Band
+{ 'command': 'an-oob-command', 'allow-oob': true }
+
 # For testing integer range flattening in opts-visitor. The following schema
 # corresponds to the option format:
 #
index 4f43370017c1b8cfbbab101e1a3bd4338cdabd7a..467577d770bd40f416c9cb9eb5486ad6b6021ad2 100644 (file)
@@ -166,6 +166,8 @@ command boxed-struct UserDefZero -> None
    gen=True success_response=True boxed=True oob=False
 command boxed-union UserDefNativeListUnion -> None
    gen=True success_response=True boxed=True oob=False
+command an-oob-command None -> None
+   gen=True success_response=True boxed=False oob=True
 object UserDefOptions
     member i64: intList optional=True
     member u64: uint64List optional=True
index 93fbbb1b733cb92e56db54f4e517326724917c34..db690cc5ae2971164efa1a68dfff1006a0cb7f76 100644 (file)
@@ -16,6 +16,10 @@ void qmp_user_def_cmd(Error **errp)
 {
 }
 
+void qmp_an_oob_command(Error **errp)
+{
+}
+
 Empty2 *qmp_user_def_cmd0(Error **errp)
 {
     return g_new0(Empty2, 1);