]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Add createVHBAByNodeDevice-no-parent to fchosttest
authorJohn Ferlan <jferlan@redhat.com>
Tue, 24 Jan 2017 18:45:48 +0000 (13:45 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Sun, 19 Feb 2017 11:45:09 +0000 (06:45 -0500)
Add a test that allows not providing a parent in the input XML, but still
being able to create finding a VPORT capable NPIV HBA.

tests/fchosttest.c

index 715571e32bb69d145b02a6b2933d43b562c982e9..15cda753a030c99b53732d8da3f173dd178c9587 100644 (file)
@@ -44,6 +44,15 @@ static const char test7_xml[] =
 "  </capability>"
 "</device>";
 
+/* virNodeDeviceCreateXML without "<parent>" to find the vport capable HBA */
+static const char test8_xml[] =
+"<device>"
+"  <capability type='scsi_host'>"
+"    <capability type='fc_host'>"
+"    </capability>"
+"  </capability>"
+"</device>";
+
 /* Test virIsVHBACapable */
 static int
 test1(const void *data ATTRIBUTE_UNUSED)
@@ -270,6 +279,9 @@ mymain(void)
     if (virTestRun("manageVHBAByNodeDevice-by-parent", manageVHBAByNodeDevice,
                    test7_xml) < 0)
         ret = -1;
+    if (virTestRun("manageVHBAByNodeDevice-no-parent", manageVHBAByNodeDevice,
+                   test8_xml) < 0)
+        ret = -1;
 
  cleanup:
     VIR_FREE(fchost_prefix);