提交 f3b1b981 编写于 作者: J John Ferlan

tests: Add createVHBAByNodeDevice-parent-fabric-wwn to fchosttest

Add a test that allows providing the parent fabric_wwn in the input XML
in order to create the vHBA.

This also fixes a mixed setting of the fabric_wwn field from the read
test driver XML strings.
上级 19ff4361
...@@ -37,9 +37,12 @@ ...@@ -37,9 +37,12 @@
#include "virbuffer.h" #include "virbuffer.h"
#include "viruuid.h" #include "viruuid.h"
#include "virrandom.h" #include "virrandom.h"
#include "virlog.h"
#define VIR_FROM_THIS VIR_FROM_NODEDEV #define VIR_FROM_THIS VIR_FROM_NODEDEV
VIR_LOG_INIT("conf.node_device_conf");
VIR_ENUM_IMPL(virNodeDevDevnode, VIR_NODE_DEV_DEVNODE_LAST, VIR_ENUM_IMPL(virNodeDevDevnode, VIR_NODE_DEV_DEVNODE_LAST,
"dev", "dev",
"link") "link")
...@@ -1086,6 +1089,11 @@ virNodeDevCapSCSIHostParseXML(xmlXPathContextPtr ctxt, ...@@ -1086,6 +1089,11 @@ virNodeDevCapSCSIHostParseXML(xmlXPathContextPtr ctxt,
} }
} }
if (virNodeDevCapsDefParseString("string(./fabric_wwn[1])",
ctxt,
&data->scsi_host.fabric_wwn) < 0)
VIR_DEBUG("No fabric_wwn defined for '%s'", def->name);
ctxt->node = orignode2; ctxt->node = orignode2;
} else { } else {
......
...@@ -64,6 +64,17 @@ static const char test9_xml[] = ...@@ -64,6 +64,17 @@ static const char test9_xml[] =
" </capability>" " </capability>"
"</device>"; "</device>";
/* virNodeDeviceCreateXML using "<parent fabric_wwn='%s'/>" to find the
* vport capable HBA */
static const char test10_xml[] =
"<device>"
" <parent fabric_wwn='2000000043214321'/>"
" <capability type='scsi_host'>"
" <capability type='fc_host'>"
" </capability>"
" </capability>"
"</device>";
/* Test virIsVHBACapable */ /* Test virIsVHBACapable */
static int static int
test1(const void *data ATTRIBUTE_UNUSED) test1(const void *data ATTRIBUTE_UNUSED)
...@@ -296,6 +307,9 @@ mymain(void) ...@@ -296,6 +307,9 @@ mymain(void)
if (virTestRun("manageVHBAByNodeDevice-parent-wwn", manageVHBAByNodeDevice, if (virTestRun("manageVHBAByNodeDevice-parent-wwn", manageVHBAByNodeDevice,
test9_xml) < 0) test9_xml) < 0)
ret = -1; ret = -1;
if (virTestRun("manageVHBAByNodeDevice-parent-fabric-wwn",
manageVHBAByNodeDevice, test10_xml) < 0)
ret = -1;
cleanup: cleanup:
VIR_FREE(fchost_prefix); VIR_FREE(fchost_prefix);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册