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

Commit 980021b

Browse files
author
Erika Hunhoff
committed
Create separate crate for testutil code
1 parent 9a5210e commit 980021b

19 files changed

Lines changed: 170 additions & 115 deletions

Cargo.lock

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

kernel/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ proptest = "1.0.0"
8080
hwloc2 = "2.2"
8181
env_logger = "0.9"
8282
which = "4"
83+
testutils = { path = "testutils" }
8384

8485
[build-dependencies]
8586
cc = "1.0"

kernel/tests/integration-test.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
//! * `s10_*`: User-space applications benchmarks
1818
//! * `s11_*`: Rackscale (distributed) benchmarks
1919
20-
pub(crate) mod common;
20+
extern crate testutils;
21+
2122
pub(crate) mod s00_core_tests;
2223
pub(crate) mod s01_kernel_low_tests;
2324
pub(crate) mod s02_kernel_high_tests;

kernel/tests/s00_core_tests.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
use rexpect::errors::*;
1313
use rexpect::process::wait::WaitStatus;
1414

15-
use crate::common::builder::BuildArgs;
16-
use crate::common::helpers::spawn_nrk;
17-
use crate::common::runner_args::{check_for_exit, check_for_successful_exit, RunnerArgs};
18-
use crate::common::ExitStatus;
15+
use testutils::builder::BuildArgs;
16+
use testutils::helpers::spawn_nrk;
17+
use testutils::runner_args::{check_for_exit, check_for_successful_exit, RunnerArgs};
18+
use testutils::ExitStatus;
1919

2020
/// Make sure exiting the kernel works.
2121
///

kernel/tests/s01_kernel_low_tests.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
use rexpect::errors::*;
1313
use rexpect::process::wait::WaitStatus;
1414

15-
use crate::common::builder::BuildArgs;
16-
use crate::common::helpers::spawn_nrk;
17-
use crate::common::runner_args::{check_for_exit, check_for_successful_exit, RunnerArgs};
18-
use crate::common::ExitStatus;
15+
use testutils::builder::BuildArgs;
16+
use testutils::helpers::spawn_nrk;
17+
use testutils::runner_args::{check_for_exit, check_for_successful_exit, RunnerArgs};
18+
use testutils::ExitStatus;
1919

2020
/// Make sure the page-fault handler functions as expected.
2121
/// In essence a trap should be raised and we should get a backtrace.

kernel/tests/s02_kernel_high_tests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ use rexpect::process::wait::WaitStatus;
1818
use rexpect::session::PtyReplSession;
1919
use rexpect::spawn;
2020

21-
use crate::common::builder::BuildArgs;
22-
use crate::common::helpers::spawn_nrk;
23-
use crate::common::runner_args::{check_for_successful_exit, RunnerArgs};
21+
use testutils::builder::BuildArgs;
22+
use testutils::helpers::spawn_nrk;
23+
use testutils::runner_args::{check_for_successful_exit, RunnerArgs};
2424

2525
/// Test that we can initialize the ACPI subsystem and figure out the machine topology.
2626
#[cfg(not(feature = "baremetal"))]

kernel/tests/s03_kernel_high_tests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ use rexpect::errors::*;
1313
use rexpect::process::wait::WaitStatus;
1414
use rexpect::spawn;
1515

16-
use crate::common::builder::BuildArgs;
17-
use crate::common::helpers::{setup_shmem, spawn_nrk, SHMEM_PATH, SHMEM_SIZE};
18-
use crate::common::runner_args::{check_for_successful_exit, RunnerArgs};
16+
use testutils::builder::BuildArgs;
17+
use testutils::helpers::{setup_shmem, spawn_nrk, SHMEM_PATH, SHMEM_SIZE};
18+
use testutils::runner_args::{check_for_successful_exit, RunnerArgs};
1919

2020
/// Test that we boot up all cores in the system.
2121
#[cfg(not(feature = "baremetal"))] // TODO: can be ported to baremetal

kernel/tests/s04_user_runtime_tests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ use rexpect::errors::*;
1313
use rexpect::process::signal::SIGTERM;
1414
use rexpect::process::wait::WaitStatus;
1515

16-
use crate::common::builder::{BuildArgs, Machine};
17-
use crate::common::helpers::{
16+
use testutils::builder::{BuildArgs, Machine};
17+
use testutils::helpers::{
1818
setup_network, spawn_dhcpd, spawn_nrk, spawn_ping, spawn_receiver, DHCP_ACK_MATCH,
1919
};
20-
use crate::common::runner_args::{check_for_successful_exit, wait_for_sigterm, RunnerArgs};
20+
use testutils::runner_args::{check_for_successful_exit, wait_for_sigterm, RunnerArgs};
2121

2222
/// Tests the lineup scheduler multi-core ability.
2323
///

kernel/tests/s05_user_app_tests.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ use rexpect::errors::*;
1313
use rexpect::process::signal::SIGTERM;
1414
use rexpect::process::wait::WaitStatus;
1515

16-
use crate::common::builder::BuildArgs;
17-
use crate::common::helpers::{setup_network, spawn_dhcpd, spawn_nc, spawn_nrk, DHCP_ACK_MATCH};
18-
use crate::common::redis::{REDIS_BENCHMARK, REDIS_PORT, REDIS_START_MATCH};
19-
use crate::common::runner_args::{wait_for_sigterm, RunnerArgs};
16+
use testutils::builder::BuildArgs;
17+
use testutils::helpers::{setup_network, spawn_dhcpd, spawn_nc, spawn_nrk, DHCP_ACK_MATCH};
18+
use testutils::redis::{REDIS_BENCHMARK, REDIS_PORT, REDIS_START_MATCH};
19+
use testutils::runner_args::{wait_for_sigterm, RunnerArgs};
2020

2121
/// Tests that user-space application redis is functional
2222
/// by spawing it and connecting to it from the network.

kernel/tests/s06_rackscale_tests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
use rexpect::errors::*;
1313
use rexpect::process::wait::WaitStatus;
1414

15-
use crate::common::builder::BuildArgs;
16-
use crate::common::helpers::{
15+
use testutils::builder::BuildArgs;
16+
use testutils::helpers::{
1717
setup_network, setup_shmem, spawn_dcm, spawn_nrk, SHMEM_PATH, SHMEM_SIZE,
1818
};
19-
use crate::common::runner_args::{check_for_successful_exit, RunnerArgs};
19+
use testutils::runner_args::{check_for_successful_exit, RunnerArgs};
2020

2121
#[cfg(not(feature = "baremetal"))]
2222
#[test]

0 commit comments

Comments
 (0)