Skip to content
This repository was archived by the owner on Jul 17, 2025. It is now read-only.

Commit 9b7b5b2

Browse files
committed
Remove integrations-tests.rs to avoid re-running integration tests
1 parent 980021b commit 9b7b5b2

10 files changed

Lines changed: 34 additions & 61 deletions

File tree

doc/src/benchmarking/ArtifactEvaluation.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Please follow the given steps to reproduce Figure 3 in the paper.
101101
To execute the benchmark, run:
102102

103103
```bash
104-
RUST_TEST_THREADS=1 cargo test --test integration-test -- s10_fxmark_bench --nocapture
104+
RUST_TEST_THREADS=1 cargo test --test s10* -- s10_fxmark_bench --nocapture
105105
```
106106

107107
The command runs all NR-FS microbenchmarks and stores the results in a CSV file
@@ -172,7 +172,7 @@ To run the LevelDB benchmark on NrOS execute:
172172

173173
```bash
174174
cd $HOME/nrk/kernel
175-
RUST_TEST_THREADS=1 cargo test --test integration-test -- s10_leveldb_benchmark --nocapture
175+
RUST_TEST_THREADS=1 cargo test --test s10* -- s10_leveldb_benchmark --nocapture
176176
```
177177

178178
This step will take ~15-20min. If everything worked, you should see an output like this one at the end:
@@ -229,7 +229,7 @@ To run the throughput benchmark (Figure 5) on NrOS execute:
229229

230230
```bash
231231
cd $HOME/nrk/kernel
232-
RUST_TEST_THREADS=1 cargo test --test integration-test -- s10_vmops_benchmark --nocapture
232+
RUST_TEST_THREADS=1 cargo test --test s10* -- s10_vmops_benchmark --nocapture
233233
```
234234

235235
This step will take ~3min. If everything worked, you should see an output like this one at the end:
@@ -246,7 +246,7 @@ The results will be stored in `vmops_benchmark.csv`.
246246
To run the latency benchmark (Figure 6a) on NrOS execute:
247247

248248
```bash
249-
RUST_TEST_THREADS=1 cargo test --test integration-test -- s10_vmops_latency_benchmark --nocapture
249+
RUST_TEST_THREADS=1 cargo test --test s10* -- s10_vmops_latency_benchmark --nocapture
250250
```
251251

252252
This step will take ~2min. If everything worked, you should see an output like this one at the end:
@@ -264,7 +264,7 @@ To run the unmap latency benchmark (Figure 6c) on NrOS execute:
264264

265265
```bash
266266
cd $HOME/nrk/kernel
267-
RUST_TEST_THREADS=1 cargo test --test integration-test -- s10_vmops_unmaplat_latency_benchmark --nocapture
267+
RUST_TEST_THREADS=1 cargo test --test s10* -- s10_vmops_unmaplat_latency_benchmark --nocapture
268268
```
269269

270270
This step will take ~2min. If everything worked, you should see an output like this one at the end:

doc/src/benchmarking/LevelDb.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ directly:
1111

1212
```bash
1313
cd kernel
14-
RUST_TEST_THREADS=1 cargo test --test integration-test -- s10_leveldb_benchmark
14+
RUST_TEST_THREADS=1 cargo test --test s10* -- s10_leveldb_benchmark
1515
```
1616

1717
This test will run the db-bench binary for LevelDB which runs various benchmarks

doc/src/benchmarking/Memcached.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ directly:
1010

1111
```bash
1212
cd kernel
13-
RUST_TEST_THREADS=1 cargo test --test integration-test -- s10_memcached_benchmark
13+
RUST_TEST_THREADS=1 cargo test --test s10* -- s10_memcached_benchmark
1414
```
1515

1616
This test will spawn memcached on one, two and four threads and measure

doc/src/benchmarking/Microbenchmarks.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ benchmark suite. The benchmark code is located at `usr/init/src/fxmark`.
99
To run the fxmark benchmarks invoke the following command:
1010

1111
```bash
12-
RUST_TEST_THREADS=1 cargo test --test integration-test -- s10_fxmark_bench --nocapture
12+
RUST_TEST_THREADS=1 cargo test --test s10* -- s10_fxmark_bench --nocapture
1313
```
1414

1515
fxmark supports several different file benchmarks:
@@ -53,10 +53,10 @@ The benchmark code is located at `usr/init/src/vmops/`. To invoke the
5353
benchmarks, run:
5454

5555
```bash
56-
RUST_TEST_THREADS=1 cargo test --test integration-test -- s10_vmops_benchmark --nocapture
57-
RUST_TEST_THREADS=1 cargo test --test integration-test -- s10_vmops_latency_benchmark --nocapture
58-
RUST_TEST_THREADS=1 cargo test --test integration-test -- s10_vmops_unmaplat_latency_benchmark --nocapture
59-
RUST_TEST_THREADS=1 cargo test --test integration-test -- s10_shootdown_simple --nocapture
56+
RUST_TEST_THREADS=1 cargo test --test s10* -- s10_vmops_benchmark --nocapture
57+
RUST_TEST_THREADS=1 cargo test --test s10* -- s10_vmops_latency_benchmark --nocapture
58+
RUST_TEST_THREADS=1 cargo test --test s10* -- s10_vmops_unmaplat_latency_benchmark --nocapture
59+
RUST_TEST_THREADS=1 cargo test --test s10* -- s10_shootdown_simple --nocapture
6060
```
6161

6262
## Network

doc/src/benchmarking/Redis.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ directly:
1919
```bash
2020
cd kernel
2121
# Runs both _virtio and _e1000 redis benchmark tests
22-
RUST_TEST_THREADS=1 cargo test --test integration-test -- s10_redis_benchmark
22+
RUST_TEST_THREADS=1 cargo test --test s10* -- s10_redis_benchmark
2323
```
2424

2525
## Launch redis manually
2626

27-
You can also do the steps that the integration-test does manually. We start a
27+
You can also do the steps that the integration test does manually. We start a
2828
DHCP server first. The `apparmor teardown` is necessary if you don't have a
2929
security policy that allows the use of a `dhcpd.conf` at this location.
3030

doc/src/development/Testing.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,15 @@ To run the unit tests of the kernel:
2727
To run the integration tests of the kernel:
2828

2929
1. `cd kernel`
30-
1. `RUST_TEST_THREADS=1 cargo test --test integration-test`
30+
1. `RUST_TEST_THREADS=1 cargo test --test '*'`
3131

3232
If you would like to run a specific integration test you can pass it with `--`:
3333

34-
1. `RUST_TEST_THREADS=1 cargo test --test integration-test -- userspace_smoke`
34+
1. `RUST_TEST_THREADS=1 cargo test --test '*' -- userspace_smoke`
35+
36+
If you would like to run a specific set of integration tests, you can specify the file name with `--test`:
37+
38+
1. `RUST_TEST_THREADS=1 cargo test --test s00_core_test`
3539

3640
In case an integration test fails, adding `--nocapture` at the end (needs to
3741
come after the `--`) will make sure that the underlying `run.py` invocations are
@@ -72,7 +76,7 @@ flags will also choose a different main() function than the one you're seeing
7276
There is two parts to the integration test.
7377

7478
- The host side (that will go off and spawn a qemu instance) for running the
75-
integration tests. It is found in `kernel/tests/integration-test.rs`.
79+
integration tests. It is found in `kernel/tests`.
7680
- The corresponding main functions in the kernel that gets executed for a
7781
particular example are located at `kernel/src/integration_main.rs`
7882

@@ -84,7 +88,7 @@ To add a new integration test the following tests may be necessary:
8488
`kernel/src/integration_main.rs` with the used feature name as an annotation.
8589
It may also be possible to re-use an existing xmain function, in that case
8690
make not of the feature name used to include it.
87-
1. Add a runner function to `kernel/tests/integration-test.rs` that builds the
91+
1. Add a runner function to one of the files in `kernel/tests` that builds the
8892
kernel with the cargo feature runs it and checks the output.
8993

9094
Integration tests are divided into categories and named accordingly (partially
@@ -156,7 +160,7 @@ A fully automated CI test that checks the network using ping is available as
156160
well, it can be invoked with the following command:
157161

158162
```bash
159-
RUST_TEST_THREADS=1 cargo test --test integration-test -- s04_userspace_rumprt_net
163+
RUST_TEST_THREADS=1 cargo test --test '*' -- s04_userspace_rumprt_net
160164
```
161165

162166
### socat and netcat

kernel/src/integration_tests.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0 OR MIT
33

44
// Various integration tests that run inside a VM and test different aspects
5-
// of the kernel. Check `kernel/tests/integration-test.rs` for the host-side
5+
// of the kernel. Check `kernel/tests/*.rs` for the host-side
66
// counterpart.
77

88
use crate::arch::debug::shutdown;
@@ -131,7 +131,7 @@ fn timer() {
131131
}
132132

133133
// Don't change this line without changing
134-
// `s01_timer` in integration-tests.rs:
134+
// `s01_timer` in s01_kernel_low_tests.rs:
135135
info!("Setting the timer");
136136

137137
let start = rawtime::Instant::now();
@@ -575,7 +575,7 @@ fn vspace_debug() {
575575

576576
// Careful note: If you change any of the lines order/amount/variable names etc.
577577
// in this function, you *most likely* have to adjust s02_gdb in
578-
// `integration-test.rs`.
578+
// `s02_kernel_low_tests.rs`.
579579
#[cfg(feature = "integration-test")]
580580
fn gdb() {
581581
use log::info;
@@ -720,7 +720,7 @@ fn vmxnet_smoltcp() {
720720
let mut tcp_6970_active = false;
721721
let mut done = false;
722722
let clock = Clock::new();
723-
// Don't change the next line without changing `integration-test.rs`
723+
// Don't change the next line without changing `s03_kernel_high_tests.rs`
724724
info!("About to serve sockets!");
725725

726726
while !done && clock.elapsed() < Instant::from_millis(25_000) {

kernel/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ mod integration_tests;
9494
/// to exit the VM and communicate the status to the host.
9595
///
9696
/// # Notes
97-
/// If this type is modified, update the `run.py` script and `tests/integration-test.rs` as well.
97+
/// If this type is modified, update the `run.py` script and `testutils/*.rs` as well.
9898
#[derive(Copy, Clone, Debug)]
9999
#[repr(u8)]
100100
pub(crate) enum ExitReason {

kernel/tests/integration-test.rs

Lines changed: 0 additions & 31 deletions
This file was deleted.

scripts/ci.bash

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ rm -f fxmark_benchmark.csv
1313
rm -f leveldb_benchmark.csv
1414

1515
# For vmops: --features prealloc can improve performance further (at the expense of test duration)
16-
RUST_TEST_THREADS=1 cargo test --test integration-test -- s10_vmops_benchmark --nocapture
17-
RUST_TEST_THREADS=1 cargo test --test integration-test -- s10_vmops_latency_benchmark --nocapture
18-
RUST_TEST_THREADS=1 cargo test --test integration-test -- s10_redis_benchmark_ --nocapture
19-
#RUST_TEST_THREADS=1 cargo test --test integration-test -- s10_memcached_benchmark --nocapture
20-
RUST_TEST_THREADS=1 cargo test --test integration-test -- s10_leveldb_benchmark --nocapture
21-
RUST_TEST_THREADS=1 cargo test --test integration-test -- s10_fxmark_bench --nocapture
16+
RUST_TEST_THREADS=1 cargo test --test s10* -- s10_vmops_benchmark --nocapture
17+
RUST_TEST_THREADS=1 cargo test --test s10* -- s10_vmops_latency_benchmark --nocapture
18+
RUST_TEST_THREADS=1 cargo test --test s10* -- s10_redis_benchmark_ --nocapture
19+
#RUST_TEST_THREADS=1 cargo test --test s10* -- s10_memcached_benchmark --nocapture
20+
RUST_TEST_THREADS=1 cargo test --test s10* -- s10_leveldb_benchmark --nocapture
21+
RUST_TEST_THREADS=1 cargo test --test s10* -- s10_fxmark_bench --nocapture
2222

2323
# Clone repo
2424
rm -rf gh-pages

0 commit comments

Comments
 (0)