Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
f19b3a5f
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f19b3a5f
编写于
3月 18, 2014
作者:
M
Martin Kletzander
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use K&R style for curly braces in tests/
Signed-off-by:
N
Martin Kletzander
<
mkletzan@redhat.com
>
上级
0099a4ae
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
84 addition
and
43 deletion
+84
-43
tests/commandhelper.c
tests/commandhelper.c
+3
-2
tests/qemuargv2xmltest.c
tests/qemuargv2xmltest.c
+2
-1
tests/shunloadhelper.c
tests/shunloadhelper.c
+3
-2
tests/testutils.c
tests/testutils.c
+10
-5
tests/testutilslxc.c
tests/testutilslxc.c
+2
-1
tests/testutilsqemu.c
tests/testutilsqemu.c
+2
-1
tests/testutilsxen.c
tests/testutilsxen.c
+2
-1
tests/virshtest.c
tests/virshtest.c
+36
-18
tests/virusbtest.c
tests/virusbtest.c
+2
-1
tests/xencapstest.c
tests/xencapstest.c
+22
-11
未找到文件。
tests/commandhelper.c
浏览文件 @
f19b3a5f
/*
* commandhelper.c: Auxiliary program for commandtest
*
* Copyright (C) 2010-201
3
Red Hat, Inc.
* Copyright (C) 2010-201
4
Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -37,7 +37,8 @@
# define VIR_FROM_THIS VIR_FROM_NONE
static
int
envsort
(
const
void
*
a
,
const
void
*
b
)
{
static
int
envsort
(
const
void
*
a
,
const
void
*
b
)
{
const
char
*
const
*
astrptr
=
a
;
const
char
*
const
*
bstrptr
=
b
;
const
char
*
astr
=
*
astrptr
;
...
...
tests/qemuargv2xmltest.c
浏览文件 @
f19b3a5f
...
...
@@ -36,7 +36,8 @@ static int blankProblemElements(char *data)
static
int
testCompareXMLToArgvFiles
(
const
char
*
xml
,
const
char
*
cmdfile
,
bool
expect_warning
)
{
bool
expect_warning
)
{
char
*
expectxml
=
NULL
;
char
*
actualxml
=
NULL
;
char
*
cmd
=
NULL
;
...
...
tests/shunloadhelper.c
浏览文件 @
f19b3a5f
/*
* Copyright (C) 2011 Red Hat, Inc.
* Copyright (C) 2011
, 2014
Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -38,7 +38,8 @@ static void shunloadError(void *userData ATTRIBUTE_UNUSED,
int
shunloadStart
(
void
);
int
shunloadStart
(
void
)
{
int
shunloadStart
(
void
)
{
virConnectPtr
conn
;
virSetErrorFunc
(
NULL
,
shunloadError
);
...
...
tests/testutils.c
浏览文件 @
f19b3a5f
...
...
@@ -362,7 +362,8 @@ virtTestLoadFile(const char *file, char **buf)
#ifndef WIN32
static
void
virtTestCaptureProgramExecChild
(
const
char
*
const
argv
[],
int
pipefd
)
{
int
pipefd
)
{
size_t
i
;
int
open_max
;
int
stdinfd
=
-
1
;
...
...
@@ -629,7 +630,8 @@ virtTestLogContentAndReset(void)
static
unsigned
int
virTestGetFlag
(
const
char
*
name
)
{
virTestGetFlag
(
const
char
*
name
)
{
char
*
flagStr
;
unsigned
int
flag
;
...
...
@@ -643,21 +645,24 @@ virTestGetFlag(const char *name) {
}
unsigned
int
virTestGetDebug
(
void
)
{
virTestGetDebug
(
void
)
{
if
(
testDebug
==
-
1
)
testDebug
=
virTestGetFlag
(
"VIR_TEST_DEBUG"
);
return
testDebug
;
}
unsigned
int
virTestGetVerbose
(
void
)
{
virTestGetVerbose
(
void
)
{
if
(
testVerbose
==
-
1
)
testVerbose
=
virTestGetFlag
(
"VIR_TEST_VERBOSE"
);
return
testVerbose
||
virTestGetDebug
();
}
unsigned
int
virTestGetExpensive
(
void
)
{
virTestGetExpensive
(
void
)
{
if
(
testExpensive
==
-
1
)
testExpensive
=
virTestGetFlag
(
"VIR_TEST_EXPENSIVE"
);
return
testExpensive
;
...
...
tests/testutilslxc.c
浏览文件 @
f19b3a5f
...
...
@@ -8,7 +8,8 @@
# include "domain_conf.h"
virCapsPtr
testLXCCapsInit
(
void
)
{
virCapsPtr
testLXCCapsInit
(
void
)
{
virCapsPtr
caps
;
virCapsGuestPtr
guest
;
...
...
tests/testutilsqemu.c
浏览文件 @
f19b3a5f
...
...
@@ -203,7 +203,8 @@ error:
return
-
1
;
}
virCapsPtr
testQemuCapsInit
(
void
)
{
virCapsPtr
testQemuCapsInit
(
void
)
{
virCapsPtr
caps
;
virCapsGuestPtr
guest
;
virCapsGuestMachinePtr
*
machines
=
NULL
;
...
...
tests/testutilsxen.c
浏览文件 @
f19b3a5f
...
...
@@ -7,7 +7,8 @@
#include "domain_conf.h"
virCapsPtr
testXenCapsInit
(
void
)
{
virCapsPtr
testXenCapsInit
(
void
)
{
struct
utsname
utsname
;
virCapsPtr
caps
;
virCapsGuestPtr
guest
;
...
...
tests/virshtest.c
浏览文件 @
f19b3a5f
...
...
@@ -42,7 +42,8 @@ static const char *domname_fc4 = "fc4\n\n";
static
const
char
*
domstate_fc4
=
"running
\n\n
"
;
static
int
testFilterLine
(
char
*
buffer
,
const
char
*
toRemove
)
{
const
char
*
toRemove
)
{
char
*
start
;
char
*
end
;
...
...
@@ -93,7 +94,8 @@ static char *custom_uri;
"--connect", \
custom_uri
static
int
testCompareListDefault
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
static
int
testCompareListDefault
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
const
char
*
const
argv
[]
=
{
VIRSH_DEFAULT
,
"list"
,
NULL
};
const
char
*
exp
=
"\
Id Name State
\n
\
...
...
@@ -103,7 +105,8 @@ static int testCompareListDefault(const void *data ATTRIBUTE_UNUSED) {
return
testCompareOutputLit
(
exp
,
NULL
,
argv
);
}
static
int
testCompareListCustom
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
static
int
testCompareListCustom
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
const
char
*
const
argv
[]
=
{
VIRSH_CUSTOM
,
"list"
,
NULL
};
const
char
*
exp
=
"\
Id Name State
\n
\
...
...
@@ -114,7 +117,8 @@ static int testCompareListCustom(const void *data ATTRIBUTE_UNUSED) {
return
testCompareOutputLit
(
exp
,
NULL
,
argv
);
}
static
int
testCompareNodeinfoDefault
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
static
int
testCompareNodeinfoDefault
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
const
char
*
const
argv
[]
=
{
VIRSH_DEFAULT
,
"nodeinfo"
,
NULL
};
const
char
*
exp
=
"\
CPU model: i686
\n
\
...
...
@@ -129,7 +133,8 @@ Memory size: 3145728 KiB\n\
return
testCompareOutputLit
(
exp
,
NULL
,
argv
);
}
static
int
testCompareNodeinfoCustom
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
static
int
testCompareNodeinfoCustom
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
const
char
*
const
argv
[]
=
{
VIRSH_CUSTOM
,
"nodeinfo"
,
...
...
@@ -148,73 +153,85 @@ Memory size: 8192000 KiB\n\
return
testCompareOutputLit
(
exp
,
NULL
,
argv
);
}
static
int
testCompareDominfoByID
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
static
int
testCompareDominfoByID
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
const
char
*
const
argv
[]
=
{
VIRSH_CUSTOM
,
"dominfo"
,
"2"
,
NULL
};
const
char
*
exp
=
dominfo_fc4
;
return
testCompareOutputLit
(
exp
,
"
\n
CPU time:"
,
argv
);
}
static
int
testCompareDominfoByUUID
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
static
int
testCompareDominfoByUUID
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
const
char
*
const
argv
[]
=
{
VIRSH_CUSTOM
,
"dominfo"
,
DOM_UUID
,
NULL
};
const
char
*
exp
=
dominfo_fc4
;
return
testCompareOutputLit
(
exp
,
"
\n
CPU time:"
,
argv
);
}
static
int
testCompareDominfoByName
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
static
int
testCompareDominfoByName
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
const
char
*
const
argv
[]
=
{
VIRSH_CUSTOM
,
"dominfo"
,
"fc4"
,
NULL
};
const
char
*
exp
=
dominfo_fc4
;
return
testCompareOutputLit
(
exp
,
"
\n
CPU time:"
,
argv
);
}
static
int
testCompareDomuuidByID
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
static
int
testCompareDomuuidByID
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
const
char
*
const
argv
[]
=
{
VIRSH_CUSTOM
,
"domuuid"
,
"2"
,
NULL
};
const
char
*
exp
=
domuuid_fc4
;
return
testCompareOutputLit
(
exp
,
NULL
,
argv
);
}
static
int
testCompareDomuuidByName
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
static
int
testCompareDomuuidByName
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
const
char
*
const
argv
[]
=
{
VIRSH_CUSTOM
,
"domuuid"
,
"fc4"
,
NULL
};
const
char
*
exp
=
domuuid_fc4
;
return
testCompareOutputLit
(
exp
,
NULL
,
argv
);
}
static
int
testCompareDomidByName
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
static
int
testCompareDomidByName
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
const
char
*
const
argv
[]
=
{
VIRSH_CUSTOM
,
"domid"
,
"fc4"
,
NULL
};
const
char
*
exp
=
domid_fc4
;
return
testCompareOutputLit
(
exp
,
NULL
,
argv
);
}
static
int
testCompareDomidByUUID
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
static
int
testCompareDomidByUUID
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
const
char
*
const
argv
[]
=
{
VIRSH_CUSTOM
,
"domid"
,
DOM_UUID
,
NULL
};
const
char
*
exp
=
domid_fc4
;
return
testCompareOutputLit
(
exp
,
NULL
,
argv
);
}
static
int
testCompareDomnameByID
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
static
int
testCompareDomnameByID
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
const
char
*
const
argv
[]
=
{
VIRSH_CUSTOM
,
"domname"
,
"2"
,
NULL
};
const
char
*
exp
=
domname_fc4
;
return
testCompareOutputLit
(
exp
,
NULL
,
argv
);
}
static
int
testCompareDomnameByUUID
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
static
int
testCompareDomnameByUUID
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
const
char
*
const
argv
[]
=
{
VIRSH_CUSTOM
,
"domname"
,
DOM_UUID
,
NULL
};
const
char
*
exp
=
domname_fc4
;
return
testCompareOutputLit
(
exp
,
NULL
,
argv
);
}
static
int
testCompareDomstateByID
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
static
int
testCompareDomstateByID
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
const
char
*
const
argv
[]
=
{
VIRSH_CUSTOM
,
"domstate"
,
"2"
,
NULL
};
const
char
*
exp
=
domstate_fc4
;
return
testCompareOutputLit
(
exp
,
NULL
,
argv
);
}
static
int
testCompareDomstateByUUID
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
static
int
testCompareDomstateByUUID
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
const
char
*
const
argv
[]
=
{
VIRSH_CUSTOM
,
"domstate"
,
DOM_UUID
,
NULL
};
const
char
*
exp
=
domstate_fc4
;
return
testCompareOutputLit
(
exp
,
NULL
,
argv
);
}
static
int
testCompareDomstateByName
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
static
int
testCompareDomstateByName
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
const
char
*
const
argv
[]
=
{
VIRSH_CUSTOM
,
"domstate"
,
"fc4"
,
NULL
};
const
char
*
exp
=
domstate_fc4
;
return
testCompareOutputLit
(
exp
,
NULL
,
argv
);
...
...
@@ -225,7 +242,8 @@ struct testInfo {
const
char
*
result
;
};
static
int
testCompareEcho
(
const
void
*
data
)
{
static
int
testCompareEcho
(
const
void
*
data
)
{
const
struct
testInfo
*
info
=
data
;
return
testCompareOutputLit
(
info
->
result
,
NULL
,
info
->
argv
);
}
...
...
tests/virusbtest.c
浏览文件 @
f19b3a5f
...
...
@@ -137,7 +137,8 @@ cleanup:
static
int
testCheckNdevs
(
const
char
*
occasion
,
size_t
got
,
size_t
expected
)
{
size_t
expected
)
{
if
(
got
!=
expected
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s: got %zu devices, expected %zu"
,
...
...
tests/xencapstest.c
浏览文件 @
f19b3a5f
...
...
@@ -69,21 +69,24 @@ testCompareFiles(virArch hostmachine, const char *xml_rel,
return
ret
;
}
static
int
testXeni686
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
static
int
testXeni686
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
return
testCompareFiles
(
VIR_ARCH_I686
,
"xencapsdata/xen-i686.xml"
,
"xencapsdata/xen-i686.cpuinfo"
,
"xencapsdata/xen-i686.caps"
);
}
static
int
testXeni686PAE
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
static
int
testXeni686PAE
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
return
testCompareFiles
(
VIR_ARCH_I686
,
"xencapsdata/xen-i686-pae.xml"
,
"xencapsdata/xen-i686-pae.cpuinfo"
,
"xencapsdata/xen-i686-pae.caps"
);
}
static
int
testXeni686PAEHVM
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
static
int
testXeni686PAEHVM
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
return
testCompareFiles
(
VIR_ARCH_I686
,
"xencapsdata/xen-i686-pae-hvm.xml"
,
"xencapsdata/xen-i686-pae-hvm.cpuinfo"
,
...
...
@@ -93,7 +96,8 @@ static int testXeni686PAEHVM(const void *data ATTRIBUTE_UNUSED) {
/* No PAE + HVM is non-sensical - all VMX capable
CPUs have PAE */
/*
static int testXeni686HVM(const void *data ATTRIBUTE_UNUSED) {
static int testXeni686HVM(const void *data ATTRIBUTE_UNUSED)
{
return testCompareFiles(VIR_ARCH_I686,
"xencapsdata/xen-i686-hvm.xml",
"xencapsdata/xen-i686.cpuinfo",
...
...
@@ -101,46 +105,53 @@ static int testXeni686HVM(const void *data ATTRIBUTE_UNUSED) {
}
*/
static
int
testXenx86_64
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
static
int
testXenx86_64
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
return
testCompareFiles
(
VIR_ARCH_X86_64
,
"xencapsdata/xen-x86_64.xml"
,
"xencapsdata/xen-x86_64.cpuinfo"
,
"xencapsdata/xen-x86_64.caps"
);
}
static
int
testXenx86_64HVM
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
static
int
testXenx86_64HVM
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
return
testCompareFiles
(
VIR_ARCH_X86_64
,
"xencapsdata/xen-x86_64-hvm.xml"
,
"xencapsdata/xen-x86_64-hvm.cpuinfo"
,
"xencapsdata/xen-x86_64-hvm.caps"
);
}
static
int
testXenia64
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
static
int
testXenia64
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
return
testCompareFiles
(
VIR_ARCH_ITANIUM
,
"xencapsdata/xen-ia64.xml"
,
"xencapsdata/xen-ia64.cpuinfo"
,
"xencapsdata/xen-ia64.caps"
);
}
static
int
testXenia64BE
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
static
int
testXenia64BE
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
return
testCompareFiles
(
VIR_ARCH_ITANIUM
,
"xencapsdata/xen-ia64-be.xml"
,
"xencapsdata/xen-ia64-be.cpuinfo"
,
"xencapsdata/xen-ia64-be.caps"
);
}
static
int
testXenia64HVM
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
static
int
testXenia64HVM
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
return
testCompareFiles
(
VIR_ARCH_ITANIUM
,
"xencapsdata/xen-ia64-hvm.xml"
,
"xencapsdata/xen-ia64-hvm.cpuinfo"
,
"xencapsdata/xen-ia64-hvm.caps"
);
}
static
int
testXenia64BEHVM
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
static
int
testXenia64BEHVM
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
return
testCompareFiles
(
VIR_ARCH_ITANIUM
,
"xencapsdata/xen-ia64-be-hvm.xml"
,
"xencapsdata/xen-ia64-be-hvm.cpuinfo"
,
"xencapsdata/xen-ia64-be-hvm.caps"
);
}
static
int
testXenppc64
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
static
int
testXenppc64
(
const
void
*
data
ATTRIBUTE_UNUSED
)
{
return
testCompareFiles
(
VIR_ARCH_PPC64
,
"xencapsdata/xen-ppc64.xml"
,
"xencapsdata/xen-ppc64.cpuinfo"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录