Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
660174fc
Q
qemu
项目概览
openeuler
/
qemu
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
660174fc
编写于
6月 01, 2017
作者:
P
Paolo Bonzini
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
megasas: add qtest
Signed-off-by:
N
Paolo Bonzini
<
pbonzini@redhat.com
>
上级
6b9911d0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
54 addition
and
0 deletion
+54
-0
tests/Makefile.include
tests/Makefile.include
+3
-0
tests/megasas-test.c
tests/megasas-test.c
+51
-0
未找到文件。
tests/Makefile.include
浏览文件 @
660174fc
...
...
@@ -205,6 +205,8 @@ check-qtest-pci-y += tests/intel-hda-test$(EXESUF)
gcov-files-pci-y
+=
hw/audio/intel-hda.c hw/audio/hda-codec.c
check-qtest-pci-$(CONFIG_EVENTFD)
+=
tests/ivshmem-test
$(EXESUF)
gcov-files-pci-y
+=
hw/misc/ivshmem.c
check-qtest-pci-y
+=
tests/megasas-test
$(EXESUF)
gcov-files-pci-y
+=
hw/scsi/megasas.c
check-qtest-i386-y
=
tests/endianness-test
$(EXESUF)
check-qtest-i386-y
+=
tests/fdc-test
$(EXESUF)
...
...
@@ -755,6 +757,7 @@ tests/test-filter-mirror$(EXESUF): tests/test-filter-mirror.o $(qtest-obj-y)
tests/test-filter-redirector$(EXESUF)
:
tests/test-filter-redirector.o $(qtest-obj-y)
tests/test-x86-cpuid-compat$(EXESUF)
:
tests/test-x86-cpuid-compat.o $(qtest-obj-y)
tests/ivshmem-test$(EXESUF)
:
tests/ivshmem-test.o contrib/ivshmem-server/ivshmem-server.o $(libqos-pc-obj-y) $(libqos-spapr-obj-y)
tests/megasas-test$(EXESUF)
:
tests/megasas-test.o $(libqos-spapr-obj-y) $(libqos-pc-obj-y)
tests/vhost-user-bridge$(EXESUF)
:
tests/vhost-user-bridge.o contrib/libvhost-user/libvhost-user.o $(test-util-obj-y)
tests/test-uuid$(EXESUF)
:
tests/test-uuid.o $(test-util-obj-y)
tests/test-arm-mptimer$(EXESUF)
:
tests/test-arm-mptimer.o
...
...
tests/megasas-test.c
0 → 100644
浏览文件 @
660174fc
/*
* QTest testcase for LSI MegaRAID
*
* Copyright (c) 2017 Red Hat Inc.
*
* This work is licensed under the terms of the GNU GPL, version 2 or later.
* See the COPYING file in the top-level directory.
*/
#include "qemu/osdep.h"
#include "libqtest.h"
#include "qemu/bswap.h"
#include "libqos/libqos-pc.h"
#include "libqos/libqos-spapr.h"
static
QOSState
*
qmegasas_start
(
const
char
*
extra_opts
)
{
const
char
*
arch
=
qtest_get_arch
();
const
char
*
cmd
=
"-drive id=hd0,if=none,file=null-co://,format=raw "
"-device megasas,id=scsi0,addr=04.0 "
"-device scsi-hd,bus=scsi0.0,drive=hd0 %s"
;
if
(
strcmp
(
arch
,
"i386"
)
==
0
||
strcmp
(
arch
,
"x86_64"
)
==
0
)
{
return
qtest_pc_boot
(
cmd
,
extra_opts
?
:
""
);
}
g_printerr
(
"virtio-scsi tests are only available on x86 or ppc64
\n
"
);
exit
(
EXIT_FAILURE
);
}
static
void
qmegasas_stop
(
QOSState
*
qs
)
{
qtest_shutdown
(
qs
);
}
/* Tests only initialization so far. TODO: Replace with functional tests */
static
void
pci_nop
(
void
)
{
QOSState
*
qs
;
qs
=
qmegasas_start
(
NULL
);
qmegasas_stop
(
qs
);
}
int
main
(
int
argc
,
char
**
argv
)
{
g_test_init
(
&
argc
,
&
argv
,
NULL
);
qtest_add_func
(
"/megasas/pci/nop"
,
pci_nop
);
return
g_test_run
();
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录