stratovirt/0009-README-update-readme.patch
Fei Xu 5118a146a4 StratoVirt: synchronize 20.03 LTS SP2 branch to master
Signed-off-by: Fei Xu <xufei30@huawei.com>
2021-06-16 17:33:15 +08:00

169 lines
4.6 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

From 6caa22c9928e2450032c1359922e4e87e1e798ce Mon Sep 17 00:00:00 2001
From: Zhu Huankai <zhuhuankai1@huawei.com>
Date: Tue, 18 May 2021 10:11:48 +0800
Subject: [PATCH] README: update readme
Update Preparation and add Log module.
Signed-off-by: Zhu Huankai <zhuhuankai1@huawei.com>
---
tests/hydropper/README.cn.md | 34 ++++++++++++++++++++++++++--------
tests/hydropper/README.md | 30 ++++++++++++++++++++++++------
2 files changed, 50 insertions(+), 14 deletions(-)
diff --git a/tests/hydropper/README.cn.md b/tests/hydropper/README.cn.md
index 8d397cf..c74493d 100644
--- a/tests/hydropper/README.cn.md
+++ b/tests/hydropper/README.cn.md
@@ -3,9 +3,10 @@ hydropper是一个基于pytest的轻量级测试框架在其基础上封装
## 如何开始
-
### 环境准备
-requirements.txt里面包含了python3依赖包。
+1. 请确保你的openEuler系统已经安装python3。
+
+2. requirements.txt里面包含了hydropper的依赖包。
- pytest>5.0.0
- aexpect>1.5.0
@@ -13,15 +14,26 @@ requirements.txt里面包含了python3依赖包。
你可以通过下面的命令来安装这些包:
```sh
-$ pip install -r config/requirements.txt
+$ pip3 install -r requirements.txt
```
-网络依赖包:
+3. 请在你的openEuler系统上安装下列网络依赖包以支持用例执行
+
```sh
$ yum install nmap
$ yum install iperf3
```
+4. 网络配置(可参考以下模板):
+
+```sh
+brctl addbr strato_br0
+ifconfig strato_br0 up
+ifconfig strato_br0 1.1.1.1
+```
+
+5. 构建测试镜像请参考 docs/IMAGE_BUILD.md。
+
### 参数配置
请在config目录下的config.ini里配置参数和对应路径通常的用例都需要配置好kernel和rootfs
```ini
@@ -39,16 +51,17 @@ STRATOVIRT_ROOTFS = /path/to/rootfs
请在config.ini中配置好IP_PREFIX和IP_3RD这两项表示虚拟机IPv4地址的前24位
最后8位会由hydropper来自动配置。请注意虚拟机需要和主机在同一网段。
+
```ini
[network.params]
# such as 'IP_PREFIX.xxx.xxx'
-IP_PREFIX = xxx.xxx
+IP_PREFIX = 1.1
# such as 'xxx.xxx.IP_3RD.xxx'
-IP_3RD = xxx
+IP_3RD = 1
```
### 运行测试用例
-你可以hydropper目录下通过以下的命令来执行用例
+你可以在hydropper目录下通过以下的命令来执行用例
```sh
# 执行所有用例
$ pytest
@@ -95,4 +108,9 @@ def test_microvm_xxx(microvm):
test_vm = microvm
test_vm.basic_config(vcpu_count=4, mem_size='4G')
test_vm.launch()
-```
\ No newline at end of file
+```
+
+### 日志
+
+- pytest默认日志路径/var/log/pytest.log
+- stratovirt默认日志路径/var/log/stratovirt
\ No newline at end of file
diff --git a/tests/hydropper/README.md b/tests/hydropper/README.md
index 3bdb169..a44ab42 100644
--- a/tests/hydropper/README.md
+++ b/tests/hydropper/README.md
@@ -5,7 +5,9 @@ Hydropper is a lightweight test framework based on pytest. It encapsulates virtu
### Preparation
-The requirements.txt file contains the Python3 dependency package.
+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
@@ -13,15 +15,25 @@ The requirements.txt file contains the Python3 dependency package.
You can install these packages by running the following commands:
```sh
-$ pip install -r config/requirements.txt
+$ pip3 install -r requirements.txt
```
-Network dependency package:
+3. Network dependency package:
```sh
$ yum install nmap
$ yum install iperf3
```
+4. Network configurationtemplate
+
+```sh
+brctl addbr strato_br0
+ifconfig strato_br0 up
+ifconfig strato_br0 1.1.1.1
+```
+
+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
@@ -41,12 +53,13 @@ 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 = xxx.xxx
+IP_PREFIX = 1.1
# such as 'xxx.xxx.IP_3RD.xxx'
-IP_3RD = xxx
+IP_3RD = 1
```
### Run testcases
@@ -97,4 +110,9 @@ def test_microvm_xxx(microvm):
test_vm = microvm
test_vm.basic_config(vcpu_count=4, mem_size='4G')
test_vm.launch()
-```
\ No newline at end of file
+```
+
+### Log
+
+- pytest default log path: /var/log/pytest.log
+- stratovirt default log path: /var/log/stratovirt
\ No newline at end of file
--
2.25.1