# Hydropper:
Hydropper is a lightweight test framework based on pytest. It encapsulates virtualization-related test atoms and is used for stratovirt black-box tests.Hydropper has provided some testcases for lightweight virtualization and standard virtualization to help Developers find and locate Stratovirt problems.
## How to start
### Preparation
1. Ensure that python3 has been installed on your openEuler system.
2. The requirements.txt file contains the Python3 dependency package.
- pytest>5.0.0
- aexpect>1.5.0
- retrying
You can install these packages by running the following commands:
```sh
$ pip3 install -r requirements.txt
```
3. Network dependency package:
```sh
$ yum install nmap
$ yum install iperf3
$ yum install bridge-utils
```
4. Network configuration(template)
```sh
brctl addbr strato_br0
ip link set strato_br0 up
ip address add 1.1.1.1 dev strato_br0
```
5. For details about how to build a test image, see docs/IMAGE_BUILD.md.
### Parameter configuration
Set parameters and corresponding paths in the config/config.ini. Generally, the kernel and rootfs must be configured for test cases.
```ini
[env.params]
...
VM_USERNAME = <usrname>
VM_PASSWORD = <passwd>
...
[stratovirt.params]
...
STRATOVIRT_VMLINUX = /path/to/kernel
STRATOVIRT_ROOTFS = /path/to/rootfs
...
```
Configure IP_PREFIX and IP_3RD in the "config.ini" file,
which indicate the first 24 bits of the VM IPv4 address,
The last 8 bits are automatically configured by the hydropper.
Note that the VM and the host must be in the same network segment.
```ini
[network.params]
# such as 'IP_PREFIX.xxx.xxx'
IP_PREFIX = 1.1
# such as 'xxx.xxx.IP_3RD.xxx'
IP_3RD = 1
```
### Run testcases
You can run the following commands in the hydroper directory to execute cases:
```sh
# Run all cases
$ pytest
# Run all cases with the keyword microvm
$ pytest -k microvm
# Run all cases in test_microvm_cmdline.py
$ pytest testcases/microvm/functional/test_microvm_cmdline.py
# Run test_microvm_without_daemonize
$ pytest testcases/microvm/functional/test_microvm_cmdline.py::test_microvm_without_daemonize
```
### Add new testcases
Add customized cases to the microvm directory under testcases.You can add a python file or add a function to an existing python file.The file name and function name must be in the format of test_*.
```python
test_microvm_xxx.py
def test_microvm_xxx()
```
We have preset some virtual machine objects. You can test the virtual machine by generating their instances:
```python
def test_microvm_xxx(microvm):
test_vm = microvm
test_vm.launch()
```
In addition, Fixture is useful to write testcases.You can use Fixture in the following ways:
```python
# Mark the tag to system
@pytest.mark.system
def test_microvm_xxx(microvm):
test_vm = microvm
test_vm.launch()
```
Now you can use the pytest -m system command to run all the "system" cases.
You can use the basic_config() function to configure VM parameters:
```python
# Configure four vCPUs and 4 GB memory for the VM.
def test_microvm_xxx(microvm):
test_vm = microvm
test_vm.basic_config(vcpu_count=4, mem_size='4G')
test_vm.launch()
```
### Log
- pytest default log path: /var/log/pytest.log
- stratovirt default log path: /var/log/stratovirt
没有合适的资源?快使用搜索试试~ 我知道了~
StratoVirt是一个开源的VMM(虚拟机管理器),旨在执行下一代虚拟化 StratoVirt 基于 Rust 编程语言
共417个文件
rs:300个
py:46个
md:22个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 176 浏览量
2023-05-28
10:26:55
上传
评论
收藏 1.45MB ZIP 举报
温馨提示
StratoVirt是一个开源的VMM(虚拟机管理器),旨在执行下一代虚拟化。StratoVirt 基于 Rust 编程语言。StratoVirt重量轻,高效且安全。它还具有完全支持和模块灵活拆分等功能。StratoVirt是计算产业中面向云数据中心的企业级虚拟化平台,实现了一套架构统一支持虚拟机、容器、Serverless三种场景。StratoVirt在轻量低噪、软硬协同、Rust语言级安全等方面具备关键技术竞争优势。StratoVirt预留了接口和设计来支持更多特性,未来甚至向标准虚拟化演进。
资源推荐
资源详情
资源评论
收起资源包目录
StratoVirt是一个开源的VMM(虚拟机管理器),旨在执行下一代虚拟化 StratoVirt 基于 Rust 编程语言 (417个子文件)
kernel_config_5.10_aarch64 81KB
kernel_config_5.10_aarch64 60KB
kernel_config_5.10_x86_64 77KB
kernel_config_5.10_x86_64 63KB
kernel_config_4.19_aarch64 71KB
kernel_config_4.19_aarch64 51KB
kernel_config_4.19_x86_64 67KB
kernel_config_4.19_x86_64 58KB
config 736B
.gitignore 203B
config.ini 2KB
pytest.ini 180B
StratoVirt-arch.jpg 210KB
standvm_iothread.json 593B
stand_vm.json 533B
micro_vm.json 533B
microvm_boottime.json 402B
microvm_cpuhotplug.json 361B
microvm_seccomp.json 361B
microvm_largeinitrd.json 297B
microvm_initrd.json 279B
microvm_katacontainer_vnetplug.json 228B
microvm_katacontainer_vnetunplug.json 20B
LICENSE 9KB
Cargo.lock 38KB
Makefile 361B
config_guidebook.md 48KB
Third_Party_Open_Source_Software_Notice.md 19KB
boot.ch.md 10KB
boot.md 10KB
qmp.md 9KB
migration.md 5KB
interconnect_with_libvirt.ch.md 4KB
interconnect_with_libvirt.md 4KB
quickstart.ch.md 4KB
quickstart.md 3KB
snapshot.md 3KB
README.cn.md 3KB
README.md 3KB
design.md 3KB
vfio.md 3KB
design.ch.md 2KB
build_guide.ch.md 1KB
build_guide.md 1KB
IMAGE_BUILD.md 1KB
mk_initrd.ch.md 1KB
trace.md 1KB
mk_initrd.md 1KB
basevm.py 29KB
standvm.py 21KB
microvm.py 13KB
test_standvm_isula.py 10KB
test_microvm_cmdline.py 9KB
conftest.py 9KB
config.py 8KB
test_microvm_isula.py 8KB
utils_logging.py 7KB
session.py 7KB
resources.py 7KB
test_microvm_virtio_net.py 6KB
test_standvm_virtio_net.py 5KB
test_microvm_virtio_blk.py 5KB
test_microvm_vmlife.py 5KB
test_microvm_cpu_features.py 5KB
test_microvm_vhost_vsock.py 4KB
test_standvm_vhost_vsock.py 4KB
utils_network.py 4KB
exception.py 4KB
test_microvm_balloon.py 4KB
test_standvm_balloon.py 4KB
container.py 4KB
remote.py 3KB
test_standvm_vfio.py 3KB
utils_common.py 3KB
monitor_thread.py 3KB
test_standvm_vmlife.py 3KB
test_standvm_snapshot.py 3KB
test_microvm_snapshot.py 3KB
mem_usage_info.py 3KB
test_microvm_virtio_rng.py 2KB
test_standvm_virtio_rng.py 2KB
utils_qmp.py 2KB
monitor_info.py 2KB
test_microvm_concurrency.py 2KB
test_standvm_virtio_blk.py 2KB
test_standvm_cpu_feature.py 1KB
test_microvm_timer.py 1KB
test_standvm_pcie_root_port.py 993B
test_microvm_api.py 972B
decorators.py 910B
test_standvm_iothread.py 901B
__init__.py 761B
__init__.py 0B
__init__.py 0B
test_hextile_image_data.rs 110KB
usb_test.rs 102KB
pci_test.rs 92KB
scsi_test.rs 84KB
usb.rs 77KB
aml_compiler.rs 72KB
共 417 条
- 1
- 2
- 3
- 4
- 5
资源评论
Java程序员-张凯
- 粉丝: 1w+
- 资源: 6746
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功