[libvirt] [PATCH] tests: remove use of virTestOOMActive from bhyve testsuite

Daniel P. Berrangé posted 1 patch 4 years, 7 months ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20190913150343.11344-1-berrange@redhat.com
tests/bhyveargv2xmltest.c | 44 +++++++++++++++++++--------------------
1 file changed, 21 insertions(+), 23 deletions(-)
[libvirt] [PATCH] tests: remove use of virTestOOMActive from bhyve testsuite
Posted by Daniel P. Berrangé 4 years, 7 months ago
The virTestOOMActive method was deleted in

  commit 2c52ecd96086b4643b99b4570b5823d40ce2787b
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   Thu Aug 29 13:04:07 2019 +0100

    util: purge all code for testing OOM handling

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---

Pushed as a CI build fix for FreeBSD

 tests/bhyveargv2xmltest.c | 44 +++++++++++++++++++--------------------
 1 file changed, 21 insertions(+), 23 deletions(-)

diff --git a/tests/bhyveargv2xmltest.c b/tests/bhyveargv2xmltest.c
index 1684f03355..d108366682 100644
--- a/tests/bhyveargv2xmltest.c
+++ b/tests/bhyveargv2xmltest.c
@@ -39,38 +39,36 @@ testCompareXMLToArgvFiles(const char *xmlfile,
 
     if (!(vmdef = bhyveParseCommandLineString(cmd, driver.bhyvecaps,
                                               driver.xmlopt))) {
-        if ((flags & FLAG_EXPECT_FAILURE) && !virTestOOMActive()) {
-                VIR_TEST_DEBUG("Got expected failure from "
-                               "bhyveParseCommandLineString.");
+        if ((flags & FLAG_EXPECT_FAILURE)) {
+            VIR_TEST_DEBUG("Got expected failure from "
+                           "bhyveParseCommandLineString.");
         } else {
             goto fail;
         }
-    } else if ((flags & FLAG_EXPECT_FAILURE) && !virTestOOMActive()) {
+    } else if ((flags & FLAG_EXPECT_FAILURE)) {
         VIR_TEST_DEBUG("Did not get expected failure from "
                        "bhyveParseCommandLineString.");
         goto fail;
     }
 
-    if (!virTestOOMActive()) {
-        if ((log = virTestLogContentAndReset()) == NULL)
+    if ((log = virTestLogContentAndReset()) == NULL)
+        goto fail;
+    if (flags & FLAG_EXPECT_WARNING) {
+        if (*log) {
+            VIR_TEST_DEBUG("Got expected warning from "
+                           "bhyveParseCommandLineString:\n%s",
+                           log);
+        } else {
+            VIR_TEST_DEBUG("bhyveParseCommandLineString "
+                           "should have logged a warning");
+            goto fail;
+        }
+    } else { /* didn't expect a warning */
+        if (*log) {
+            VIR_TEST_DEBUG("Got unexpected warning from "
+                           "bhyveParseCommandLineString:\n%s",
+                           log);
             goto fail;
-        if (flags & FLAG_EXPECT_WARNING) {
-            if (*log) {
-                VIR_TEST_DEBUG("Got expected warning from "
-                            "bhyveParseCommandLineString:\n%s",
-                            log);
-            } else {
-                VIR_TEST_DEBUG("bhyveParseCommandLineString "
-                        "should have logged a warning");
-                goto fail;
-            }
-        } else { /* didn't expect a warning */
-            if (*log) {
-                VIR_TEST_DEBUG("Got unexpected warning from "
-                            "bhyveParseCommandLineString:\n%s",
-                            log);
-                goto fail;
-            }
         }
     }
 
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list