tests: Drop 'props' from object-add calls
The 'props' option has been deprecated in 5.0 in favour of a flattened object-add command. Time to change our test cases to drop the deprecated option. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
6f4b1996b4
commit
9695c3af3a
@ -230,14 +230,14 @@ static void test_object_add_failure_modes(void)
|
||||
/* attempt to create 2 objects with duplicate id */
|
||||
resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':"
|
||||
" {'qom-type': 'memory-backend-ram', 'id': 'ram1',"
|
||||
" 'props': {'size': 1048576 } } }");
|
||||
" 'size': 1048576 } }");
|
||||
g_assert_nonnull(resp);
|
||||
g_assert(qdict_haskey(resp, "return"));
|
||||
qobject_unref(resp);
|
||||
|
||||
resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':"
|
||||
" {'qom-type': 'memory-backend-ram', 'id': 'ram1',"
|
||||
" 'props': {'size': 1048576 } } }");
|
||||
" 'size': 1048576 } }");
|
||||
g_assert_nonnull(resp);
|
||||
qmp_expect_error_and_unref(resp, "GenericError");
|
||||
|
||||
@ -251,14 +251,14 @@ static void test_object_add_failure_modes(void)
|
||||
/* attempt to create an object with a property of a wrong type */
|
||||
resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':"
|
||||
" {'qom-type': 'memory-backend-ram', 'id': 'ram1',"
|
||||
" 'props': {'size': '1048576' } } }");
|
||||
" 'size': '1048576' } }");
|
||||
g_assert_nonnull(resp);
|
||||
/* now do it right */
|
||||
qmp_expect_error_and_unref(resp, "GenericError");
|
||||
|
||||
resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':"
|
||||
" {'qom-type': 'memory-backend-ram', 'id': 'ram1',"
|
||||
" 'props': {'size': 1048576 } } }");
|
||||
" 'size': 1048576 } }");
|
||||
g_assert_nonnull(resp);
|
||||
g_assert(qdict_haskey(resp, "return"));
|
||||
qobject_unref(resp);
|
||||
@ -273,14 +273,14 @@ static void test_object_add_failure_modes(void)
|
||||
/* attempt to create an object without the id */
|
||||
resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':"
|
||||
" {'qom-type': 'memory-backend-ram',"
|
||||
" 'props': {'size': 1048576 } } }");
|
||||
" 'size': 1048576 } }");
|
||||
g_assert_nonnull(resp);
|
||||
qmp_expect_error_and_unref(resp, "GenericError");
|
||||
|
||||
/* now do it right */
|
||||
resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':"
|
||||
" {'qom-type': 'memory-backend-ram', 'id': 'ram1',"
|
||||
" 'props': {'size': 1048576 } } }");
|
||||
" 'size': 1048576 } }");
|
||||
g_assert_nonnull(resp);
|
||||
g_assert(qdict_haskey(resp, "return"));
|
||||
qobject_unref(resp);
|
||||
@ -295,14 +295,14 @@ static void test_object_add_failure_modes(void)
|
||||
/* attempt to set a non existing property */
|
||||
resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':"
|
||||
" {'qom-type': 'memory-backend-ram', 'id': 'ram1',"
|
||||
" 'props': {'sized': 1048576 } } }");
|
||||
" 'sized': 1048576 } }");
|
||||
g_assert_nonnull(resp);
|
||||
qmp_expect_error_and_unref(resp, "GenericError");
|
||||
|
||||
/* now do it right */
|
||||
resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':"
|
||||
" {'qom-type': 'memory-backend-ram', 'id': 'ram1',"
|
||||
" 'props': {'size': 1048576 } } }");
|
||||
" 'size': 1048576 } }");
|
||||
g_assert_nonnull(resp);
|
||||
g_assert(qdict_haskey(resp, "return"));
|
||||
qobject_unref(resp);
|
||||
|
@ -21,11 +21,10 @@ static void add_one_netfilter(void)
|
||||
" 'arguments': {"
|
||||
" 'qom-type': 'filter-buffer',"
|
||||
" 'id': 'qtest-f0',"
|
||||
" 'props': {"
|
||||
" 'netdev': 'qtest-bn0',"
|
||||
" 'queue': 'rx',"
|
||||
" 'interval': 1000"
|
||||
"}}}");
|
||||
" 'netdev': 'qtest-bn0',"
|
||||
" 'queue': 'rx',"
|
||||
" 'interval': 1000"
|
||||
"}}");
|
||||
|
||||
g_assert(response);
|
||||
g_assert(!qdict_haskey(response, "error"));
|
||||
@ -49,11 +48,10 @@ static void remove_netdev_with_one_netfilter(void)
|
||||
" 'arguments': {"
|
||||
" 'qom-type': 'filter-buffer',"
|
||||
" 'id': 'qtest-f0',"
|
||||
" 'props': {"
|
||||
" 'netdev': 'qtest-bn0',"
|
||||
" 'queue': 'rx',"
|
||||
" 'interval': 1000"
|
||||
"}}}");
|
||||
" 'netdev': 'qtest-bn0',"
|
||||
" 'queue': 'rx',"
|
||||
" 'interval': 1000"
|
||||
"}}");
|
||||
|
||||
g_assert(response);
|
||||
g_assert(!qdict_haskey(response, "error"));
|
||||
@ -87,11 +85,10 @@ static void add_multi_netfilter(void)
|
||||
" 'arguments': {"
|
||||
" 'qom-type': 'filter-buffer',"
|
||||
" 'id': 'qtest-f0',"
|
||||
" 'props': {"
|
||||
" 'netdev': 'qtest-bn0',"
|
||||
" 'queue': 'rx',"
|
||||
" 'interval': 1000"
|
||||
"}}}");
|
||||
" 'netdev': 'qtest-bn0',"
|
||||
" 'queue': 'rx',"
|
||||
" 'interval': 1000"
|
||||
"}}");
|
||||
|
||||
g_assert(response);
|
||||
g_assert(!qdict_haskey(response, "error"));
|
||||
@ -101,11 +98,10 @@ static void add_multi_netfilter(void)
|
||||
" 'arguments': {"
|
||||
" 'qom-type': 'filter-buffer',"
|
||||
" 'id': 'qtest-f1',"
|
||||
" 'props': {"
|
||||
" 'netdev': 'qtest-bn0',"
|
||||
" 'queue': 'rx',"
|
||||
" 'interval': 1000"
|
||||
"}}}");
|
||||
" 'netdev': 'qtest-bn0',"
|
||||
" 'queue': 'rx',"
|
||||
" 'interval': 1000"
|
||||
"}}");
|
||||
|
||||
g_assert(response);
|
||||
g_assert(!qdict_haskey(response, "error"));
|
||||
@ -137,11 +133,10 @@ static void remove_netdev_with_multi_netfilter(void)
|
||||
" 'arguments': {"
|
||||
" 'qom-type': 'filter-buffer',"
|
||||
" 'id': 'qtest-f0',"
|
||||
" 'props': {"
|
||||
" 'netdev': 'qtest-bn0',"
|
||||
" 'queue': 'rx',"
|
||||
" 'interval': 1000"
|
||||
"}}}");
|
||||
" 'netdev': 'qtest-bn0',"
|
||||
" 'queue': 'rx',"
|
||||
" 'interval': 1000"
|
||||
"}}");
|
||||
|
||||
g_assert(response);
|
||||
g_assert(!qdict_haskey(response, "error"));
|
||||
@ -151,11 +146,10 @@ static void remove_netdev_with_multi_netfilter(void)
|
||||
" 'arguments': {"
|
||||
" 'qom-type': 'filter-buffer',"
|
||||
" 'id': 'qtest-f1',"
|
||||
" 'props': {"
|
||||
" 'netdev': 'qtest-bn0',"
|
||||
" 'queue': 'rx',"
|
||||
" 'interval': 1000"
|
||||
"}}}");
|
||||
" 'netdev': 'qtest-bn0',"
|
||||
" 'queue': 'rx',"
|
||||
" 'interval': 1000"
|
||||
"}}");
|
||||
|
||||
g_assert(response);
|
||||
g_assert(!qdict_haskey(response, "error"));
|
||||
|
Loading…
Reference in New Issue
Block a user