@@ -18,88 +18,40 @@ cargo build
1818Our Continuous Integration (CI) pipeline is implemented on top of
1919[ Buildkite] ( https://buildkite.com/ ) .
2020For the complete list of tests, check our
21- [ CI pipeline] ( https://buildkite.com/rust-vmm/vm-virtio -ci ) .
21+ [ CI pipeline] ( https://buildkite.com/rust-vmm/rust-vmm -ci ) .
2222
2323Each individual test runs in a container. To reproduce a test locally, you can
2424use the dev-container on both x86 and arm64.
2525
2626``` bash
27+ container_version=5
2728docker run -it \
2829 --security-opt seccomp=unconfined \
2930 --volume $( pwd) :/linux-loader \
30- rustvmm/dev:v2
31+ rustvmm/dev:v ${container_version}
3132cd linux-loader/
3233cargo test
3334```
3435
35- ### Test Profiles
36-
37- The integration tests support two test profiles:
38- - ** devel** : this is the recommended profile for running the integration tests
39- on a local development machine.
40- - ** ci** (default option): this is the profile used when running the
41- integration tests as part of the the Continuous Integration (CI).
42-
43- The test profiles are applicable to tests that run using pytest. Currently only
44- the [ coverage test] ( tests/test_coverage.py ) follows this model as all the other
45- integration tests are run using the
46- [ Buildkite pipeline] ( https://buildkite.com/rust-vmm/vm-virtio-ci ) .
47-
48- The difference between is declaring tests as passed or failed:
49- - with the ** devel** profile the coverage test passes if the current coverage
50- is equal or higher than the upstream coverage value. In case the current
51- coverage is higher, the coverage file is updated to the new coverage value.
52- - with the ** ci** profile the coverage test passes only if the current coverage
53- is equal to the upstream coverage value.
54-
55- Further details about the coverage test can be found in the
56- [ Adaptive Coverage] ( #adaptive-coverage ) section.
57-
58- ### Adaptive Coverage
36+ ### bzImage test
5937
60- The line coverage is saved in [ tests/coverage] ( tests/coverage ) . To update the
61- coverage before submitting a PR, run the coverage test:
38+ As we don't want to distribute an entire kernel bzImage, the ` load_bzImage `
39+ test is ignored by default. In order to test the bzImage support, one needs to
40+ locally build a bzImage, copy it to the ` src/loader ` directory and run
41+ ` cargo test ` :
6242
6343``` bash
44+ # Assuming your linux-loader and linux-stable are both under ${LINUX_LOADER}:
45+ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git ${LINUX_LOADER} /linux-stable
46+ cd linux-stable
47+ make bzImage
48+ cp linux-stable/arch/x86/boot/bzImage ${LINUX_LOADER} /linux-loader/src/loader/
49+ cd ${LINUX_LOADER} /linux-loader
50+ container_version=5
6451docker run -it \
6552 --security-opt seccomp=unconfined \
6653 --volume $( pwd) :/linux-loader \
67- rustvmm/dev:v2
54+ rustvmm/dev:v ${container_version}
6855cd linux-loader/
69- pytest --profile=devel tests/test_coverage.py
70- ```
71-
72- If the PR coverage is higher than the upstream coverage, the coverage file
73- needs to be manually added to the commit before submitting the PR:
74-
75- ``` bash
76- git add tests/coverage
77- ```
78-
79- Failing to do so will generate a fail on the CI pipeline when publishing the
80- PR.
81-
82- ** NOTE:** The coverage file is only updated in the ` devel ` test profile. In
83- the ` ci ` profile the coverage test will fail if the current coverage is higher
84- than the coverage reported in [ tests/coverage] ( tests/coverage ) .
85-
86- ### bzImage test
87-
88- As we don't want to distribute an entire kernel bzImage, the ` load_bzImage ` test is ignored by
89- default. In order to test the bzImage support, one needs to locally build a bzImage, copy it
90- to the ` src/loader ` directory and run cargo test:
91-
92- ``` shell
93- # Assuming your linux-loader and linux-stable are both under $LINUX_LOADER
94- $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git $LINUX_LOADER /linux-stable
95- $ cd linux-stable
96- $ make bzImage
97- $ cp linux-stable/arch/x86/boot/bzImage $LINUX_LOADER /linux-loader/src/loader/
98- $ cd $LINUX_LOADER /linux-loader
99- $ docker run -it \
100- --security-opt seccomp=unconfined \
101- --volume $( pwd) :/linux-loader \
102- rustvmm/dev:v2
103- $ cd linux-loader/
104- $ cargo test
56+ cargo test
10557```
0 commit comments