Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
bdbe26b5
L
libvirt
项目概览
openeuler
/
libvirt
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
libvirt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
bdbe26b5
编写于
4月 23, 2015
作者:
C
Cole Robinson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tests: Use *DefParseFile more
上级
01f2f6c6
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
31 addition
and
140 deletion
+31
-140
tests/bhyvexml2xmltest.c
tests/bhyvexml2xmltest.c
+2
-7
tests/domainconftest.c
tests/domainconftest.c
+1
-6
tests/lxcxml2xmltest.c
tests/lxcxml2xmltest.c
+2
-6
tests/networkxml2conftest.c
tests/networkxml2conftest.c
+1
-6
tests/networkxml2xmltest.c
tests/networkxml2xmltest.c
+1
-5
tests/networkxml2xmlupdatetest.c
tests/networkxml2xmlupdatetest.c
+1
-5
tests/nwfilterxml2xmltest.c
tests/nwfilterxml2xmltest.c
+1
-5
tests/qemuagenttest.c
tests/qemuagenttest.c
+2
-7
tests/secretxml2xmltest.c
tests/secretxml2xmltest.c
+1
-5
tests/securityselinuxlabeltest.c
tests/securityselinuxlabeltest.c
+1
-6
tests/storagebackendsheepdogtest.c
tests/storagebackendsheepdogtest.c
+3
-17
tests/storagepoolxml2xmltest.c
tests/storagepoolxml2xmltest.c
+1
-5
tests/storagevolxml2argvtest.c
tests/storagevolxml2argvtest.c
+4
-22
tests/storagevolxml2xmltest.c
tests/storagevolxml2xmltest.c
+2
-10
tests/xlconfigtest.c
tests/xlconfigtest.c
+2
-7
tests/xmconfigtest.c
tests/xmconfigtest.c
+2
-7
tests/xml2sexprtest.c
tests/xml2sexprtest.c
+2
-7
tests/xml2vmxtest.c
tests/xml2vmxtest.c
+2
-7
未找到文件。
tests/bhyvexml2xmltest.c
浏览文件 @
bdbe26b5
...
...
@@ -14,20 +14,16 @@ static bhyveConn driver;
static
int
testCompareXMLToXMLFiles
(
const
char
*
inxml
,
const
char
*
outxml
)
{
char
*
inXmlData
=
NULL
;
char
*
outXmlData
=
NULL
;
char
*
actual
=
NULL
;
virDomainDefPtr
def
=
NULL
;
int
ret
=
-
1
;
if
(
virtTestLoadFile
(
inxml
,
&
inXmlData
)
<
0
)
goto
fail
;
if
(
virtTestLoadFile
(
outxml
,
&
outXmlData
)
<
0
)
goto
fail
;
if
(
!
(
def
=
virDomainDefParse
String
(
inXmlData
,
driver
.
caps
,
driver
.
xmlopt
,
VIR_DOMAIN_DEF_PARSE_INACTIVE
)))
if
(
!
(
def
=
virDomainDefParse
File
(
inxml
,
driver
.
caps
,
driver
.
xmlopt
,
VIR_DOMAIN_DEF_PARSE_INACTIVE
)))
goto
fail
;
if
(
!
(
actual
=
virDomainDefFormat
(
def
,
VIR_DOMAIN_DEF_FORMAT_INACTIVE
)))
...
...
@@ -41,7 +37,6 @@ testCompareXMLToXMLFiles(const char *inxml, const char *outxml)
ret
=
0
;
fail:
VIR_FREE
(
inXmlData
);
VIR_FREE
(
outXmlData
);
VIR_FREE
(
actual
);
virDomainDefFree
(
def
);
...
...
tests/domainconftest.c
浏览文件 @
bdbe26b5
...
...
@@ -43,7 +43,6 @@ struct testGetFilesystemData {
static
int
testGetFilesystem
(
const
void
*
opaque
)
{
int
ret
=
-
1
;
char
*
xmlData
=
NULL
;
virDomainDefPtr
def
=
NULL
;
char
*
filename
=
NULL
;
const
struct
testGetFilesystemData
*
data
=
opaque
;
...
...
@@ -53,10 +52,7 @@ static int testGetFilesystem(const void *opaque)
abs_srcdir
,
data
->
filename
)
<
0
)
goto
cleanup
;
if
(
virtTestLoadFile
(
filename
,
&
xmlData
)
<
0
)
goto
cleanup
;
if
(
!
(
def
=
virDomainDefParseString
(
xmlData
,
caps
,
xmlopt
,
0
)))
if
(
!
(
def
=
virDomainDefParseFile
(
filename
,
caps
,
xmlopt
,
0
)))
goto
cleanup
;
fsdef
=
virDomainGetFilesystemForTarget
(
def
,
...
...
@@ -79,7 +75,6 @@ static int testGetFilesystem(const void *opaque)
cleanup:
virDomainDefFree
(
def
);
VIR_FREE
(
xmlData
);
VIR_FREE
(
filename
);
return
ret
;
}
...
...
tests/lxcxml2xmltest.c
浏览文件 @
bdbe26b5
...
...
@@ -25,19 +25,16 @@ static virDomainXMLOptionPtr xmlopt;
static
int
testCompareXMLToXMLFiles
(
const
char
*
inxml
,
const
char
*
outxml
,
bool
live
)
{
char
*
inXmlData
=
NULL
;
char
*
outXmlData
=
NULL
;
char
*
actual
=
NULL
;
int
ret
=
-
1
;
virDomainDefPtr
def
=
NULL
;
if
(
virtTestLoadFile
(
inxml
,
&
inXmlData
)
<
0
)
goto
fail
;
if
(
virtTestLoadFile
(
outxml
,
&
outXmlData
)
<
0
)
goto
fail
;
if
(
!
(
def
=
virDomainDefParse
String
(
inXmlData
,
caps
,
xmlopt
,
live
?
0
:
VIR_DOMAIN_DEF_PARSE_INACTIVE
)))
if
(
!
(
def
=
virDomainDefParse
File
(
inxml
,
caps
,
xmlopt
,
live
?
0
:
VIR_DOMAIN_DEF_PARSE_INACTIVE
)))
goto
fail
;
if
(
!
virDomainDefCheckABIStability
(
def
,
def
))
{
...
...
@@ -55,7 +52,6 @@ testCompareXMLToXMLFiles(const char *inxml, const char *outxml, bool live)
ret
=
0
;
fail:
VIR_FREE
(
inXmlData
);
VIR_FREE
(
outXmlData
);
VIR_FREE
(
actual
);
virDomainDefFree
(
def
);
...
...
tests/networkxml2conftest.c
浏览文件 @
bdbe26b5
...
...
@@ -21,7 +21,6 @@
static
int
testCompareXMLToConfFiles
(
const
char
*
inxml
,
const
char
*
outconf
,
dnsmasqCapsPtr
caps
)
{
char
*
inXmlData
=
NULL
;
char
*
outConfData
=
NULL
;
char
*
actual
=
NULL
;
int
ret
=
-
1
;
...
...
@@ -31,13 +30,10 @@ testCompareXMLToConfFiles(const char *inxml, const char *outconf, dnsmasqCapsPtr
char
*
pidfile
=
NULL
;
dnsmasqContext
*
dctx
=
NULL
;
if
(
virtTestLoadFile
(
inxml
,
&
inXmlData
)
<
0
)
goto
fail
;
if
(
virtTestLoadFile
(
outconf
,
&
outConfData
)
<
0
)
goto
fail
;
if
(
!
(
dev
=
virNetworkDefParse
String
(
inXmlData
)))
if
(
!
(
dev
=
virNetworkDefParse
File
(
inxml
)))
goto
fail
;
if
(
!
(
obj
=
virNetworkObjNew
()))
...
...
@@ -61,7 +57,6 @@ testCompareXMLToConfFiles(const char *inxml, const char *outconf, dnsmasqCapsPtr
ret
=
0
;
fail:
VIR_FREE
(
inXmlData
);
VIR_FREE
(
outConfData
);
VIR_FREE
(
actual
);
VIR_FREE
(
pidfile
);
...
...
tests/networkxml2xmltest.c
浏览文件 @
bdbe26b5
...
...
@@ -20,18 +20,15 @@ static int
testCompareXMLToXMLFiles
(
const
char
*
inxml
,
const
char
*
outxml
,
unsigned
int
flags
)
{
char
*
inXmlData
=
NULL
;
char
*
outXmlData
=
NULL
;
char
*
actual
=
NULL
;
int
ret
=
-
1
;
virNetworkDefPtr
dev
=
NULL
;
if
(
virtTestLoadFile
(
inxml
,
&
inXmlData
)
<
0
)
goto
fail
;
if
(
virtTestLoadFile
(
outxml
,
&
outXmlData
)
<
0
)
goto
fail
;
if
(
!
(
dev
=
virNetworkDefParse
String
(
inXmlData
)))
if
(
!
(
dev
=
virNetworkDefParse
File
(
inxml
)))
goto
fail
;
if
(
!
(
actual
=
virNetworkDefFormat
(
dev
,
flags
)))
...
...
@@ -45,7 +42,6 @@ testCompareXMLToXMLFiles(const char *inxml, const char *outxml,
ret
=
0
;
fail:
VIR_FREE
(
inXmlData
);
VIR_FREE
(
outXmlData
);
VIR_FREE
(
actual
);
virNetworkDefFree
(
dev
);
...
...
tests/networkxml2xmlupdatetest.c
浏览文件 @
bdbe26b5
...
...
@@ -22,19 +22,16 @@ testCompareXMLToXMLFiles(const char *netxml, const char *updatexml,
unsigned
int
command
,
unsigned
int
section
,
int
parentIndex
,
bool
expectFailure
)
{
char
*
netXmlData
=
NULL
;
char
*
updateXmlData
=
NULL
;
char
*
outXmlData
=
NULL
;
char
*
actual
=
NULL
;
int
ret
=
-
1
;
virNetworkDefPtr
def
=
NULL
;
if
(
virtTestLoadFile
(
netxml
,
&
netXmlData
)
<
0
)
goto
error
;
if
(
virtTestLoadFile
(
updatexml
,
&
updateXmlData
)
<
0
)
goto
error
;
if
(
!
(
def
=
virNetworkDefParse
String
(
netXmlData
)))
if
(
!
(
def
=
virNetworkDefParse
File
(
netxml
)))
goto
fail
;
if
(
virNetworkDefUpdateSection
(
def
,
command
,
section
,
parentIndex
,
...
...
@@ -67,7 +64,6 @@ testCompareXMLToXMLFiles(const char *netxml, const char *updatexml,
}
}
error:
VIR_FREE
(
netXmlData
);
VIR_FREE
(
updateXmlData
);
VIR_FREE
(
outXmlData
);
VIR_FREE
(
actual
);
...
...
tests/nwfilterxml2xmltest.c
浏览文件 @
bdbe26b5
...
...
@@ -23,20 +23,17 @@ static int
testCompareXMLToXMLFiles
(
const
char
*
inxml
,
const
char
*
outxml
,
bool
expect_error
)
{
char
*
inXmlData
=
NULL
;
char
*
outXmlData
=
NULL
;
char
*
actual
=
NULL
;
int
ret
=
-
1
;
virNWFilterDefPtr
dev
=
NULL
;
if
(
virtTestLoadFile
(
inxml
,
&
inXmlData
)
<
0
)
goto
fail
;
if
(
virtTestLoadFile
(
outxml
,
&
outXmlData
)
<
0
)
goto
fail
;
virResetLastError
();
if
(
!
(
dev
=
virNWFilterDefParse
String
(
inXmlData
)))
{
if
(
!
(
dev
=
virNWFilterDefParse
File
(
inxml
)))
{
if
(
expect_error
)
{
virResetLastError
();
goto
done
;
...
...
@@ -56,7 +53,6 @@ testCompareXMLToXMLFiles(const char *inxml, const char *outxml,
ret
=
0
;
fail:
VIR_FREE
(
inXmlData
);
VIR_FREE
(
outXmlData
);
VIR_FREE
(
actual
);
virNWFilterDefFree
(
dev
);
...
...
tests/qemuagenttest.c
浏览文件 @
bdbe26b5
...
...
@@ -170,7 +170,6 @@ testQemuAgentGetFSInfo(const void *data)
virCapsPtr
caps
=
testQemuCapsInit
();
qemuMonitorTestPtr
test
=
qemuMonitorTestNewAgent
(
xmlopt
);
char
*
domain_filename
=
NULL
;
char
*
domain_xml
=
NULL
;
virDomainDefPtr
def
=
NULL
;
virDomainFSInfoPtr
*
info
=
NULL
;
int
ret
=
-
1
,
ninfo
=
0
,
i
;
...
...
@@ -182,11 +181,8 @@ testQemuAgentGetFSInfo(const void *data)
abs_srcdir
)
<
0
)
goto
cleanup
;
if
(
virtTestLoadFile
(
domain_filename
,
&
domain_xml
)
<
0
)
goto
cleanup
;
if
(
!
(
def
=
virDomainDefParseString
(
domain_xml
,
caps
,
xmlopt
,
VIR_DOMAIN_DEF_PARSE_INACTIVE
)))
if
(
!
(
def
=
virDomainDefParseFile
(
domain_filename
,
caps
,
xmlopt
,
VIR_DOMAIN_DEF_PARSE_INACTIVE
)))
goto
cleanup
;
if
(
qemuMonitorTestAddAgentSyncResponse
(
test
)
<
0
)
...
...
@@ -297,7 +293,6 @@ testQemuAgentGetFSInfo(const void *data)
virDomainFSInfoFree
(
info
[
i
]);
VIR_FREE
(
info
);
VIR_FREE
(
domain_filename
);
VIR_FREE
(
domain_xml
);
virObjectUnref
(
caps
);
virDomainDefFree
(
def
);
qemuMonitorTestFree
(
test
);
...
...
tests/secretxml2xmltest.c
浏览文件 @
bdbe26b5
...
...
@@ -11,18 +11,15 @@
static
int
testCompareXMLToXMLFiles
(
const
char
*
inxml
,
const
char
*
outxml
)
{
char
*
inXmlData
=
NULL
;
char
*
outXmlData
=
NULL
;
char
*
actual
=
NULL
;
int
ret
=
-
1
;
virSecretDefPtr
secret
=
NULL
;
if
(
virtTestLoadFile
(
inxml
,
&
inXmlData
)
<
0
)
goto
fail
;
if
(
virtTestLoadFile
(
outxml
,
&
outXmlData
)
<
0
)
goto
fail
;
if
(
!
(
secret
=
virSecretDefParse
String
(
inXmlData
)))
if
(
!
(
secret
=
virSecretDefParse
File
(
inxml
)))
goto
fail
;
if
(
!
(
actual
=
virSecretDefFormat
(
secret
)))
...
...
@@ -36,7 +33,6 @@ testCompareXMLToXMLFiles(const char *inxml, const char *outxml)
ret
=
0
;
fail:
VIR_FREE
(
inXmlData
);
VIR_FREE
(
outXmlData
);
VIR_FREE
(
actual
);
virSecretDefFree
(
secret
);
...
...
tests/securityselinuxlabeltest.c
浏览文件 @
bdbe26b5
...
...
@@ -182,7 +182,6 @@ static virDomainDefPtr
testSELinuxLoadDef
(
const
char
*
testname
)
{
char
*
xmlfile
=
NULL
;
char
*
xmlstr
=
NULL
;
virDomainDefPtr
def
=
NULL
;
size_t
i
;
...
...
@@ -190,10 +189,7 @@ testSELinuxLoadDef(const char *testname)
abs_srcdir
,
testname
)
<
0
)
goto
cleanup
;
if
(
virFileReadAll
(
xmlfile
,
1024
*
1024
,
&
xmlstr
)
<
0
)
goto
cleanup
;
if
(
!
(
def
=
virDomainDefParseString
(
xmlstr
,
caps
,
xmlopt
,
0
)))
if
(
!
(
def
=
virDomainDefParseFile
(
xmlfile
,
caps
,
xmlopt
,
0
)))
goto
cleanup
;
for
(
i
=
0
;
i
<
def
->
ndisks
;
i
++
)
{
...
...
@@ -230,7 +226,6 @@ testSELinuxLoadDef(const char *testname)
cleanup:
VIR_FREE
(
xmlfile
);
VIR_FREE
(
xmlstr
);
return
def
;
}
...
...
tests/storagebackendsheepdogtest.c
浏览文件 @
bdbe26b5
...
...
@@ -50,13 +50,9 @@ test_node_info_parser(collie_test test, char *poolxml)
{
int
ret
=
-
1
;
char
*
output
=
NULL
;
char
*
poolXmlData
=
NULL
;
virStoragePoolDefPtr
pool
=
NULL
;
if
(
virtTestLoadFile
(
poolxml
,
&
poolXmlData
)
<
0
)
goto
cleanup
;
if
(
!
(
pool
=
virStoragePoolDefParseString
(
poolXmlData
)))
if
(
!
(
pool
=
virStoragePoolDefParseFile
(
poolxml
)))
goto
cleanup
;
if
(
VIR_STRDUP
(
output
,
test
.
output
)
<
0
)
...
...
@@ -77,7 +73,6 @@ test_node_info_parser(collie_test test, char *poolxml)
cleanup:
VIR_FREE
(
output
);
VIR_FREE
(
poolXmlData
);
virStoragePoolDefFree
(
pool
);
return
ret
;
}
...
...
@@ -86,21 +81,14 @@ static int
test_vdi_list_parser
(
collie_test
test
,
char
*
poolxml
,
char
*
volxml
)
{
int
ret
=
-
1
;
char
*
poolXmlData
=
NULL
;
char
*
volXmlData
=
NULL
;
char
*
output
=
NULL
;
virStoragePoolDefPtr
pool
=
NULL
;
virStorageVolDefPtr
vol
=
NULL
;
if
(
virtTestLoadFile
(
poolxml
,
&
poolXmlData
)
<
0
)
goto
cleanup
;
if
(
virtTestLoadFile
(
volxml
,
&
volXmlData
)
<
0
)
goto
cleanup
;
if
(
!
(
pool
=
virStoragePoolDefParseString
(
poolXmlData
)))
if
(
!
(
pool
=
virStoragePoolDefParseFile
(
poolxml
)))
goto
cleanup
;
if
(
!
(
vol
=
virStorageVolDefParse
String
(
pool
,
volXmlData
,
0
)))
if
(
!
(
vol
=
virStorageVolDefParse
File
(
pool
,
volxml
,
0
)))
goto
cleanup
;
if
(
VIR_STRDUP
(
output
,
test
.
output
)
<
0
)
...
...
@@ -121,8 +109,6 @@ test_vdi_list_parser(collie_test test, char *poolxml, char *volxml)
cleanup:
VIR_FREE
(
output
);
VIR_FREE
(
poolXmlData
);
VIR_FREE
(
volXmlData
);
virStoragePoolDefFree
(
pool
);
virStorageVolDefFree
(
vol
);
return
ret
;
...
...
tests/storagepoolxml2xmltest.c
浏览文件 @
bdbe26b5
...
...
@@ -19,18 +19,15 @@
static
int
testCompareXMLToXMLFiles
(
const
char
*
inxml
,
const
char
*
outxml
)
{
char
*
inXmlData
=
NULL
;
char
*
outXmlData
=
NULL
;
char
*
actual
=
NULL
;
int
ret
=
-
1
;
virStoragePoolDefPtr
dev
=
NULL
;
if
(
virtTestLoadFile
(
inxml
,
&
inXmlData
)
<
0
)
goto
fail
;
if
(
virtTestLoadFile
(
outxml
,
&
outXmlData
)
<
0
)
goto
fail
;
if
(
!
(
dev
=
virStoragePoolDefParse
String
(
inXmlData
)))
if
(
!
(
dev
=
virStoragePoolDefParse
File
(
inxml
)))
goto
fail
;
if
(
!
(
actual
=
virStoragePoolDefFormat
(
dev
)))
...
...
@@ -44,7 +41,6 @@ testCompareXMLToXMLFiles(const char *inxml, const char *outxml)
ret
=
0
;
fail:
VIR_FREE
(
inXmlData
);
VIR_FREE
(
outXmlData
);
VIR_FREE
(
actual
);
virStoragePoolDefFree
(
dev
);
...
...
tests/storagevolxml2argvtest.c
浏览文件 @
bdbe26b5
...
...
@@ -43,10 +43,6 @@ testCompareXMLToArgvFiles(bool shouldFail,
int
imgformat
,
unsigned
long
parse_flags
)
{
char
*
volXmlData
=
NULL
;
char
*
poolXmlData
=
NULL
;
char
*
inputpoolXmlData
=
NULL
;
char
*
inputvolXmlData
=
NULL
;
char
*
expectedCmdline
=
NULL
;
char
*
actualCmdline
=
NULL
;
int
ret
=
-
1
;
...
...
@@ -65,34 +61,24 @@ testCompareXMLToArgvFiles(bool shouldFail,
if
(
!
(
conn
=
virGetConnect
()))
goto
cleanup
;
if
(
virtTestLoadFile
(
poolxml
,
&
poolXmlData
)
<
0
)
goto
cleanup
;
if
(
virtTestLoadFile
(
volxml
,
&
volXmlData
)
<
0
)
goto
cleanup
;
if
(
inputvolxml
&&
virtTestLoadFile
(
inputvolxml
,
&
inputvolXmlData
)
<
0
)
goto
cleanup
;
if
(
!
(
pool
=
virStoragePoolDefParseString
(
poolXmlData
)))
if
(
!
(
pool
=
virStoragePoolDefParseFile
(
poolxml
)))
goto
cleanup
;
poolobj
.
def
=
pool
;
if
(
inputpoolxml
)
{
if
(
virtTestLoadFile
(
inputpoolxml
,
&
inputpoolXmlData
)
<
0
)
goto
cleanup
;
if
(
!
(
inputpool
=
virStoragePoolDefParseString
(
inputpoolXmlData
)))
if
(
!
(
inputpool
=
virStoragePoolDefParseFile
(
inputpoolxml
)))
goto
cleanup
;
}
if
(
inputvolxml
)
parse_flags
|=
VIR_VOL_XML_PARSE_NO_CAPACITY
;
if
(
!
(
vol
=
virStorageVolDefParse
String
(
pool
,
volXmlData
,
parse_flags
)))
if
(
!
(
vol
=
virStorageVolDefParse
File
(
pool
,
volxml
,
parse_flags
)))
goto
cleanup
;
if
(
inputvolxml
&&
!
(
inputvol
=
virStorageVolDefParse
String
(
inputpool
,
inputvolXmlData
,
0
)))
!
(
inputvol
=
virStorageVolDefParse
File
(
inputpool
,
inputvolxml
,
0
)))
goto
cleanup
;
testSetVolumeType
(
vol
,
pool
);
...
...
@@ -133,10 +119,6 @@ testCompareXMLToArgvFiles(bool shouldFail,
virCommandFree
(
cmd
);
VIR_FREE
(
actualCmdline
);
VIR_FREE
(
expectedCmdline
);
VIR_FREE
(
inputpoolXmlData
);
VIR_FREE
(
poolXmlData
);
VIR_FREE
(
volXmlData
);
VIR_FREE
(
inputvolXmlData
);
virObjectUnref
(
conn
);
return
ret
;
}
...
...
tests/storagevolxml2xmltest.c
浏览文件 @
bdbe26b5
...
...
@@ -20,25 +20,19 @@ static int
testCompareXMLToXMLFiles
(
const
char
*
poolxml
,
const
char
*
inxml
,
const
char
*
outxml
,
unsigned
int
flags
)
{
char
*
poolXmlData
=
NULL
;
char
*
inXmlData
=
NULL
;
char
*
outXmlData
=
NULL
;
char
*
actual
=
NULL
;
int
ret
=
-
1
;
virStoragePoolDefPtr
pool
=
NULL
;
virStorageVolDefPtr
dev
=
NULL
;
if
(
virtTestLoadFile
(
poolxml
,
&
poolXmlData
)
<
0
)
goto
fail
;
if
(
virtTestLoadFile
(
inxml
,
&
inXmlData
)
<
0
)
goto
fail
;
if
(
virtTestLoadFile
(
outxml
,
&
outXmlData
)
<
0
)
goto
fail
;
if
(
!
(
pool
=
virStoragePoolDefParse
String
(
poolXmlData
)))
if
(
!
(
pool
=
virStoragePoolDefParse
File
(
poolxml
)))
goto
fail
;
if
(
!
(
dev
=
virStorageVolDefParse
String
(
pool
,
inXmlData
,
flags
)))
if
(
!
(
dev
=
virStorageVolDefParse
File
(
pool
,
inxml
,
flags
)))
goto
fail
;
if
(
!
(
actual
=
virStorageVolDefFormat
(
pool
,
dev
)))
...
...
@@ -52,8 +46,6 @@ testCompareXMLToXMLFiles(const char *poolxml, const char *inxml,
ret
=
0
;
fail:
VIR_FREE
(
poolXmlData
);
VIR_FREE
(
inXmlData
);
VIR_FREE
(
outXmlData
);
VIR_FREE
(
actual
);
virStoragePoolDefFree
(
pool
);
...
...
tests/xlconfigtest.c
浏览文件 @
bdbe26b5
...
...
@@ -48,7 +48,6 @@ static virDomainXMLOptionPtr xmlopt;
static
int
testCompareParseXML
(
const
char
*
xmcfg
,
const
char
*
xml
,
int
xendConfigVersion
)
{
char
*
xmlData
=
NULL
;
char
*
xmcfgData
=
NULL
;
char
*
gotxmcfgData
=
NULL
;
virConfPtr
conf
=
NULL
;
...
...
@@ -63,14 +62,11 @@ testCompareParseXML(const char *xmcfg, const char *xml, int xendConfigVersion)
conn
=
virGetConnect
();
if
(
!
conn
)
goto
fail
;
if
(
virtTestLoadFile
(
xml
,
&
xmlData
)
<
0
)
goto
fail
;
if
(
virtTestLoadFile
(
xmcfg
,
&
xmcfgData
)
<
0
)
goto
fail
;
if
(
!
(
def
=
virDomainDefParse
String
(
xmlData
,
caps
,
xmlopt
,
VIR_DOMAIN_XML_INACTIVE
)))
if
(
!
(
def
=
virDomainDefParse
File
(
xml
,
caps
,
xmlopt
,
VIR_DOMAIN_XML_INACTIVE
)))
goto
fail
;
if
(
!
virDomainDefCheckABIStability
(
def
,
def
))
{
...
...
@@ -93,7 +89,6 @@ testCompareParseXML(const char *xmcfg, const char *xml, int xendConfigVersion)
ret
=
0
;
fail:
VIR_FREE
(
xmlData
);
VIR_FREE
(
xmcfgData
);
VIR_FREE
(
gotxmcfgData
);
if
(
conf
)
...
...
tests/xmconfigtest.c
浏览文件 @
bdbe26b5
...
...
@@ -45,7 +45,6 @@ static virDomainXMLOptionPtr xmlopt;
static
int
testCompareParseXML
(
const
char
*
xmcfg
,
const
char
*
xml
,
int
xendConfigVersion
)
{
char
*
xmlData
=
NULL
;
char
*
xmcfgData
=
NULL
;
char
*
gotxmcfgData
=
NULL
;
virConfPtr
conf
=
NULL
;
...
...
@@ -61,9 +60,6 @@ testCompareParseXML(const char *xmcfg, const char *xml, int xendConfigVersion)
conn
=
virGetConnect
();
if
(
!
conn
)
goto
fail
;
if
(
virtTestLoadFile
(
xml
,
&
xmlData
)
<
0
)
goto
fail
;
if
(
virtTestLoadFile
(
xmcfg
,
&
xmcfgData
)
<
0
)
goto
fail
;
...
...
@@ -72,8 +68,8 @@ testCompareParseXML(const char *xmcfg, const char *xml, int xendConfigVersion)
priv
.
caps
=
caps
;
conn
->
privateData
=
&
priv
;
if
(
!
(
def
=
virDomainDefParse
String
(
xmlData
,
caps
,
xmlopt
,
VIR_DOMAIN_DEF_PARSE_INACTIVE
)))
if
(
!
(
def
=
virDomainDefParse
File
(
xml
,
caps
,
xmlopt
,
VIR_DOMAIN_DEF_PARSE_INACTIVE
)))
goto
fail
;
if
(
!
virDomainDefCheckABIStability
(
def
,
def
))
{
...
...
@@ -96,7 +92,6 @@ testCompareParseXML(const char *xmcfg, const char *xml, int xendConfigVersion)
ret
=
0
;
fail:
VIR_FREE
(
xmlData
);
VIR_FREE
(
xmcfgData
);
VIR_FREE
(
gotxmcfgData
);
if
(
conf
)
...
...
tests/xml2sexprtest.c
浏览文件 @
bdbe26b5
...
...
@@ -23,20 +23,16 @@ static virDomainXMLOptionPtr xmlopt;
static
int
testCompareFiles
(
const
char
*
xml
,
const
char
*
sexpr
,
int
xendConfigVersion
)
{
char
*
xmlData
=
NULL
;
char
*
sexprData
=
NULL
;
char
*
gotsexpr
=
NULL
;
int
ret
=
-
1
;
virDomainDefPtr
def
=
NULL
;
if
(
virtTestLoadFile
(
xml
,
&
xmlData
)
<
0
)
goto
fail
;
if
(
virtTestLoadFile
(
sexpr
,
&
sexprData
)
<
0
)
goto
fail
;
if
(
!
(
def
=
virDomainDefParse
String
(
xmlData
,
caps
,
xmlopt
,
VIR_DOMAIN_DEF_PARSE_INACTIVE
)))
if
(
!
(
def
=
virDomainDefParse
File
(
xml
,
caps
,
xmlopt
,
VIR_DOMAIN_DEF_PARSE_INACTIVE
)))
goto
fail
;
if
(
!
virDomainDefCheckABIStability
(
def
,
def
))
{
...
...
@@ -55,7 +51,6 @@ testCompareFiles(const char *xml, const char *sexpr, int xendConfigVersion)
ret
=
0
;
fail:
VIR_FREE
(
xmlData
);
VIR_FREE
(
sexprData
);
VIR_FREE
(
gotsexpr
);
virDomainDefFree
(
def
);
...
...
tests/xml2vmxtest.c
浏览文件 @
bdbe26b5
...
...
@@ -73,19 +73,15 @@ static int
testCompareFiles
(
const
char
*
xml
,
const
char
*
vmx
,
int
virtualHW_version
)
{
int
result
=
-
1
;
char
*
xmlData
=
NULL
;
char
*
vmxData
=
NULL
;
char
*
formatted
=
NULL
;
virDomainDefPtr
def
=
NULL
;
if
(
virtTestLoadFile
(
xml
,
&
xmlData
)
<
0
)
goto
failure
;
if
(
virtTestLoadFile
(
vmx
,
&
vmxData
)
<
0
)
goto
failure
;
def
=
virDomainDefParse
String
(
xmlData
,
caps
,
xmlopt
,
VIR_DOMAIN_DEF_PARSE_INACTIVE
);
def
=
virDomainDefParse
File
(
xml
,
caps
,
xmlopt
,
VIR_DOMAIN_DEF_PARSE_INACTIVE
);
if
(
def
==
NULL
)
goto
failure
;
...
...
@@ -108,7 +104,6 @@ testCompareFiles(const char *xml, const char *vmx, int virtualHW_version)
result
=
0
;
failure:
VIR_FREE
(
xmlData
);
VIR_FREE
(
vmxData
);
VIR_FREE
(
formatted
);
virDomainDefFree
(
def
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录