Skip to contentSkip to conversation

tests: add qmp/missing-any-arg test

PATCH In review Marc-André Lureau 3 participants 4 messages Oct 29, 2018 – Oct 31, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests: add qmp/missing-any-arg test

test_qmp_missing_any_arg() is about a bug in infrastructure used by the QMP core, fixed in commit c489780203. We covered the bug in infrastructure unit tests (commit bce3035a44). I wrote that test earlier, to cover QMP level as well, the test could go into qmp-test.

---
 tests/qmp-test.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
tests/qmp-test.c +14 -0
index 6c419f6023..7517be4654 100644
@@ -318,6 +318,19 @@ static void test_qmp_preconfig(void)
     qtest_quit(qs);
 }
 
+static void test_qmp_missing_any_arg(void)
+{
+    QTestState *qts;
+    QDict *resp;
+
+    qts = qtest_init(common_args);
+    resp = qtest_qmp(qts, "{'execute': 'qom-set', 'arguments':"
+                     " { 'path': '/machine', 'property': 'rtc-time' } }");
+    g_assert_nonnull(resp);
+    qmp_assert_error_class(resp, "GenericError");
+    qtest_quit(qts);
+}
+
 int main(int argc, char *argv[])
 {
     g_test_init(&argc, &argv, NULL);
@@ -325,6 +338,7 @@ int main(int argc, char *argv[])
     qtest_add_func("qmp/protocol", test_qmp_protocol);
     qtest_add_func("qmp/oob", test_qmp_oob);
     qtest_add_func("qmp/preconfig", test_qmp_preconfig);
+    qtest_add_func("qmp/missing-any-arg", test_qmp_missing_any_arg);
 
     return g_test_run();
 }
Signature · 1 line
2.19.0.271.gfe8321ec05
#1 lore raw
Quoted 4 lines · Marc-André Lureau

test_qmp_missing_any_arg() is about a bug in infrastructure used by the QMP core, fixed in commit c489780203. We covered the bug in infrastructure unit tests (commit bce3035a44). I wrote that test earlier, to cover QMP level as well, the test could go into qmp-test.

The last sentence is confusing. What about replacing it by "Let's test it at the QMP level as well"?

Quoted 32 lines
---
 tests/qmp-test.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
tests/qmp-test.c +13 -0
index 6c419f6023..7517be4654 100644
@@ -318,6 +318,19 @@ static void test_qmp_preconfig(void)
     qtest_quit(qs);
 }
 
+static void test_qmp_missing_any_arg(void)
+{
+    QTestState *qts;
+    QDict *resp;
+
+    qts = qtest_init(common_args);
+    resp = qtest_qmp(qts, "{'execute': 'qom-set', 'arguments':"
+                     " { 'path': '/machine', 'property': 'rtc-time' } }");
+    g_assert_nonnull(resp);
+    qmp_assert_error_class(resp, "GenericError");
+    qtest_quit(qts);
+}
+
 int main(int argc, char *argv[])
 {
     g_test_init(&argc, &argv, NULL);

tests/qmp-test.c int main(int argc, char *argv[]) · line 344

Quoted 7 lines
tests/qmp-test.c +1 -0
@@ -325,6 +338,7 @@ int main(int argc, char *argv[])
     qtest_add_func("qmp/protocol", test_qmp_protocol);
     qtest_add_func("qmp/oob", test_qmp_oob);
     qtest_add_func("qmp/preconfig", test_qmp_preconfig);
+    qtest_add_func("qmp/missing-any-arg", test_qmp_missing_any_arg);
 
     return g_test_run();
 }

Patch looks good to me.

#2 lore raw

Hi

Quoted 10 lines · Markus Armbruster
Quoted 4 lines · Marc-André Lureau

test_qmp_missing_any_arg() is about a bug in infrastructure used by the QMP core, fixed in commit c489780203. We covered the bug in infrastructure unit tests (commit bce3035a44). I wrote that test earlier, to cover QMP level as well, the test could go into qmp-test.

The last sentence is confusing. What about replacing it by "Let's test it at the QMP level as well"?

sure, I assume you do that on commit thanks

Quoted 43 lines
Quoted 33 lines
---
 tests/qmp-test.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
tests/qmp-test.c +13 -0
index 6c419f6023..7517be4654 100644
@@ -318,6 +318,19 @@ static void test_qmp_preconfig(void)
     qtest_quit(qs);
 }
 
+static void test_qmp_missing_any_arg(void)
+{
+    QTestState *qts;
+    QDict *resp;
+
+    qts = qtest_init(common_args);
+    resp = qtest_qmp(qts, "{'execute': 'qom-set', 'arguments':"
+                     " { 'path': '/machine', 'property': 'rtc-time' } }");
+    g_assert_nonnull(resp);
+    qmp_assert_error_class(resp, "GenericError");
+    qtest_quit(qts);
+}
+
 int main(int argc, char *argv[])
 {
     g_test_init(&argc, &argv, NULL);

tests/qmp-test.c int main(int argc, char *argv[]) · line 344

Quoted 7 lines
tests/qmp-test.c +1 -0
@@ -325,6 +338,7 @@ int main(int argc, char *argv[])
     qtest_add_func("qmp/protocol", test_qmp_protocol);
     qtest_add_func("qmp/oob", test_qmp_oob);
     qtest_add_func("qmp/preconfig", test_qmp_preconfig);
+    qtest_add_func("qmp/missing-any-arg", test_qmp_missing_any_arg);
 
     return g_test_run();
 }

Patch looks good to me.

Signature · 1 line
Marc-André Lureau
Reviewed-by
#3 lore raw
Quoted 10 lines · Marc-André Lureau

Hi

Quoted 8 lines · Markus Armbruster
Quoted 4 lines · Marc-André Lureau

test_qmp_missing_any_arg() is about a bug in infrastructure used by the QMP core, fixed in commit c489780203. We covered the bug in infrastructure unit tests (commit bce3035a44). I wrote that test earlier, to cover QMP level as well, the test could go into qmp-test.

Quoted 4 lines
Quoted 2 lines

The last sentence is confusing. What about replacing it by "Let's test it at the QMP level as well"?

sure, I assume you do that on commit thanks

Can do.

Meanwhile,