Skip to content

Commit

Permalink
Add mode field to runner args
Browse files Browse the repository at this point in the history
  • Loading branch information
hunhoffe committed Jul 17, 2023
1 parent c2265e6 commit b3ee39c
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 43 deletions.
77 changes: 46 additions & 31 deletions kernel/tests/s06_rackscale_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use testutils::helpers::{
};
use testutils::runner_args::{
check_for_successful_exit, check_for_successful_exit_no_log, log_qemu_out_with_name,
wait_for_sigterm_or_successful_exit_no_log, RunnerArgs,
wait_for_sigterm_or_successful_exit_no_log, RackscaleMode, RunnerArgs,
};

#[cfg(not(feature = "baremetal"))]
Expand Down Expand Up @@ -85,13 +85,14 @@ fn rackscale_userspace_smoke_test(is_shmem: bool) {
.name("Controller".to_string())
.spawn(move || {
let controller_cmd = if is_shmem {
"mode=controller transport=shmem"
"transport=shmem"
} else {
"mode=controller transport=ethernet"
"transport=ethernet"
};
let cmdline_controller = RunnerArgs::new_with_build("userspace-smp", &build1)
.timeout(timeout)
.cmd(controller_cmd)
.mode(RackscaleMode::Controller)
.shmem_size(vec![SHMEM_SIZE as usize; 2])
.shmem_path(shmem_sockets)
.tap("tap0")
Expand Down Expand Up @@ -133,12 +134,13 @@ fn rackscale_userspace_smoke_test(is_shmem: bool) {
.spawn(move || {
sleep(Duration::from_millis(CLIENT_BUILD_DELAY));
let client_cmd = if is_shmem {
"mode=client transport=shmem"
"transport=shmem"
} else {
"mode=client transport=ethernet"
"transport=ethernet"
};
let cmdline_client = RunnerArgs::new_with_build("userspace-smp", &build2)
.timeout(timeout)
.mode(RackscaleMode::Client)
.cmd(client_cmd)
.shmem_size(vec![SHMEM_SIZE as usize; 2])
.shmem_path(shmem_sockets)
Expand Down Expand Up @@ -234,7 +236,7 @@ fn s06_rackscale_phys_alloc_test() {
.spawn(move || {
let cmdline_controller = RunnerArgs::new_with_build("userspace-smp", &build1)
.timeout(timeout)
.cmd("mode=controller")
.mode(RackscaleMode::Controller)
.shmem_size(vec![SHMEM_SIZE as usize; 2])
.shmem_path(shmem_sockets)
.workers(2)
Expand Down Expand Up @@ -275,7 +277,7 @@ fn s06_rackscale_phys_alloc_test() {
sleep(Duration::from_millis(CLIENT_BUILD_DELAY));
let cmdline_client = RunnerArgs::new_with_build("userspace-smp", &build2)
.timeout(180_000)
.cmd("mode=client")
.mode(RackscaleMode::Client)
.shmem_size(vec![SHMEM_SIZE as usize; 2])
.shmem_path(shmem_sockets)
.tap("tap2")
Expand Down Expand Up @@ -377,13 +379,14 @@ fn rackscale_fs_test(is_shmem: bool) {
.name("Controller".to_string())
.spawn(move || {
let controller_cmd = if is_shmem {
"mode=controller transport=shmem"
"transport=shmem"
} else {
"mode=controller transport=ethernet"
"transport=ethernet"
};
let cmdline_controller = RunnerArgs::new_with_build("userspace-smp", &build1)
.timeout(timeout)
.cmd(controller_cmd)
.mode(RackscaleMode::Controller)
.shmem_size(vec![SHMEM_SIZE as usize; 2])
.shmem_path(shmem_sockets)
.tap("tap0")
Expand Down Expand Up @@ -424,13 +427,14 @@ fn rackscale_fs_test(is_shmem: bool) {
.spawn(move || {
sleep(Duration::from_millis(CLIENT_BUILD_DELAY));
let client_cmd = if is_shmem {
"mode=client transport=shmem"
"transport=shmem"
} else {
"mode=client transport=ethernet"
"transport=ethernet"
};
let cmdline_client = RunnerArgs::new_with_build("userspace-smp", &build2)
.timeout(timeout)
.cmd(client_cmd)
.mode(RackscaleMode::Client)
.shmem_size(vec![SHMEM_SIZE as usize; 2])
.shmem_path(shmem_sockets)
.tap("tap2")
Expand Down Expand Up @@ -519,7 +523,7 @@ fn s06_rackscale_shmem_fs_prop_test() {
.spawn(move || {
let cmdline_controller = RunnerArgs::new_with_build("userspace-smp", &build1)
.timeout(timeout)
.cmd("mode=controller")
.mode(RackscaleMode::Controller)
.shmem_size(vec![shmem_size as usize; 2])
.shmem_path(shmem_sockets)
.tap("tap0")
Expand Down Expand Up @@ -560,7 +564,7 @@ fn s06_rackscale_shmem_fs_prop_test() {
sleep(Duration::from_millis(CLIENT_BUILD_DELAY));
let cmdline_client = RunnerArgs::new_with_build("userspace-smp", &build2)
.timeout(timeout)
.cmd("mode=client")
.mode(RackscaleMode::Client)
.shmem_size(vec![shmem_size as usize; 2])
.shmem_path(shmem_sockets)
.tap("tap2")
Expand Down Expand Up @@ -658,7 +662,8 @@ fn s06_rackscale_shmem_shootdown_test() {
.spawn(move || {
let cmdline_controller = RunnerArgs::new_with_build("userspace-smp", &controller_build)
.timeout(timeout)
.cmd("mode=controller transport=shmem")
.cmd("transport=shmem")
.mode(RackscaleMode::Controller)
.shmem_size(vec![SHMEM_SIZE as usize; clients + 1])
.shmem_path(my_shmem_sockets)
.tap("tap0")
Expand Down Expand Up @@ -706,7 +711,8 @@ fn s06_rackscale_shmem_shootdown_test() {
sleep(Duration::from_millis((i + 1) as u64 * CLIENT_BUILD_DELAY));
let cmdline_client = RunnerArgs::new_with_build("userspace-smp", &client_build)
.timeout(timeout)
.cmd("mode=client transport=shmem")
.cmd("transport=shmem")
.mode(RackscaleMode::Client)
.shmem_size(vec![SHMEM_SIZE as usize; clients + 1])
.shmem_path(my_shmem_sockets)
.tap(&tap)
Expand Down Expand Up @@ -829,13 +835,14 @@ fn rackscale_userspace_multicore_test(is_shmem: bool) {
.name("Controller".to_string())
.spawn(move || {
let controller_cmd = if is_shmem {
"mode=controller transport=shmem"
"transport=shmem"
} else {
"mode=controller transport=ethernet"
"transport=ethernet"
};
let cmdline_controller = RunnerArgs::new_with_build("userspace-smp", &build1)
.timeout(timeout)
.cmd(controller_cmd)
.mode(RackscaleMode::Controller)
.shmem_size(vec![SHMEM_SIZE as usize; 2])
.shmem_path(shmem_sockets)
.tap("tap0")
Expand Down Expand Up @@ -876,13 +883,14 @@ fn rackscale_userspace_multicore_test(is_shmem: bool) {
.spawn(move || {
sleep(Duration::from_millis(CLIENT_BUILD_DELAY));
let client_cmd = if is_shmem {
"mode=client transport=shmem"
"transport=shmem"
} else {
"mode=client transport=ethernet"
"transport=ethernet"
};
let cmdline_client = RunnerArgs::new_with_build("userspace-smp", &build2)
.timeout(timeout)
.cmd(client_cmd)
.mode(RackscaleMode::Client)
.shmem_size(vec![SHMEM_SIZE as usize; 2])
.shmem_path(shmem_sockets)
.tap("tap2")
Expand Down Expand Up @@ -1005,13 +1013,14 @@ fn rackscale_userspace_multicore_multiclient(is_shmem: bool) {
.name("Controller".to_string())
.spawn(move || {
let controller_cmd = if is_shmem {
"mode=controller transport=shmem"
"transport=shmem"
} else {
"mode=controller transport=ethernet"
"transport=ethernet"
};
let cmdline_controller = RunnerArgs::new_with_build("userspace-smp", &controller_build)
.timeout(timeout)
.cmd(controller_cmd)
.mode(RackscaleMode::Controller)
.shmem_size(vec![SHMEM_SIZE as usize; 3])
.shmem_path(shmem_sockets)
.tap("tap0")
Expand Down Expand Up @@ -1064,14 +1073,15 @@ fn rackscale_userspace_multicore_multiclient(is_shmem: bool) {
.name("Client1".to_string())
.spawn(move || {
let client_cmd = if is_shmem {
"mode=client transport=shmem"
"transport=shmem"
} else {
"mode=client transport=ethernet"
"transport=ethernet"
};
sleep(Duration::from_millis(CLIENT_BUILD_DELAY));
let cmdline_client = RunnerArgs::new_with_build("userspace-smp", &client1_build)
.timeout(timeout)
.cmd(client_cmd)
.mode(RackscaleMode::Client)
.shmem_size(vec![SHMEM_SIZE as usize; 3])
.shmem_path(shmem_sockets)
.tap("tap2")
Expand Down Expand Up @@ -1125,14 +1135,15 @@ fn rackscale_userspace_multicore_multiclient(is_shmem: bool) {
.name("Client2".to_string())
.spawn(move || {
let client_cmd = if is_shmem {
"mode=client transport=shmem"
"transport=shmem"
} else {
"mode=client transport=ethernet"
"transport=ethernet"
};
sleep(Duration::from_millis(CLIENT_BUILD_DELAY * 2));
let cmdline_client = RunnerArgs::new_with_build("userspace-smp", &client2_build)
.timeout(timeout)
.cmd(client_cmd)
.mode(RackscaleMode::Client)
.shmem_size(vec![SHMEM_SIZE as usize; 3])
.shmem_path(shmem_sockets)
.tap("tap4")
Expand Down Expand Up @@ -1251,13 +1262,14 @@ fn rackscale_userspace_rumprt_fs(is_shmem: bool) {
.name("Controller".to_string())
.spawn(move || {
let controller_cmd = if is_shmem {
"mode=controller transport=shmem"
"transport=shmem"
} else {
"mode=controller transport=ethernet"
"transport=ethernet"
};
let cmdline_controller = RunnerArgs::new_with_build("userspace", &build1)
.timeout(timeout)
.cmd(controller_cmd)
.mode(RackscaleMode::Controller)
.shmem_size(vec![SHMEM_SIZE as usize; 2])
.shmem_path(shmem_sockets)
.tap("tap0")
Expand Down Expand Up @@ -1298,13 +1310,14 @@ fn rackscale_userspace_rumprt_fs(is_shmem: bool) {
.spawn(move || {
sleep(Duration::from_millis(CLIENT_BUILD_DELAY));
let client_cmd = if is_shmem {
"mode=client transport=shmem"
"transport=shmem"
} else {
"mode=client transport=ethernet"
"transport=ethernet"
};
let cmdline_client = RunnerArgs::new_with_build("userspace-smp", &build2)
.timeout(timeout)
.cmd(client_cmd)
.mode(RackscaleMode::Client)
.shmem_size(vec![SHMEM_SIZE as usize; 2])
.shmem_path(shmem_sockets)
.tap("tap2")
Expand Down Expand Up @@ -1398,7 +1411,8 @@ fn s06_rackscale_controller_shmem_alloc() {
.spawn(move || {
let cmdline_controller = RunnerArgs::new_with_build("userspace-smp", &controller_build)
.timeout(timeout)
.cmd("mode=controller transport=shmem")
.cmd("transport=shmem")
.mode(RackscaleMode::Controller)
.shmem_size(vec![SHMEM_SIZE as usize; clients + 1])
.shmem_path(my_shmem_sockets)
.tap("tap0")
Expand Down Expand Up @@ -1434,7 +1448,8 @@ fn s06_rackscale_controller_shmem_alloc() {
sleep(Duration::from_millis((i + 1) as u64 * CLIENT_BUILD_DELAY));
let cmdline_client = RunnerArgs::new_with_build("userspace-smp", &client_build)
.timeout(timeout)
.cmd("mode=client transport=shmem")
.cmd("transport=shmem")
.mode(RackscaleMode::Client)
.shmem_size(vec![SHMEM_SIZE as usize; clients + 1])
.shmem_path(my_shmem_sockets)
.tap(&tap)
Expand Down
22 changes: 11 additions & 11 deletions kernel/tests/s11_rackscale_benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use testutils::helpers::{
};
use testutils::runner_args::{
check_for_successful_exit, log_qemu_out_with_name, wait_for_sigterm_or_successful_exit_no_log,
RunnerArgs,
RackscaleMode, RunnerArgs,
};

#[test]
Expand Down Expand Up @@ -277,10 +277,8 @@ fn rackscale_fxmark_benchmark(is_shmem: bool) {

let mut dcm = spawn_dcm(1).expect("Failed to start DCM");

let controller_cmdline = format!(
"mode=controller transport={}",
if is_shmem { "shmem" } else { "ethernet" }
);
let controller_cmdline =
format!("transport={}", if is_shmem { "shmem" } else { "ethernet" });

// Create controller
let build1 = build.clone();
Expand All @@ -291,6 +289,7 @@ fn rackscale_fxmark_benchmark(is_shmem: bool) {
let mut cmdline_controller = RunnerArgs::new_with_build("userspace-smp", &build1)
.timeout(timeout)
.cmd(&controller_cmdline)
.mode(RackscaleMode::Controller)
.shmem_size(vec![shmem_size as usize; num_clients + 1])
.shmem_path(my_shmem_sockets)
.nodes(1)
Expand Down Expand Up @@ -376,7 +375,7 @@ fn rackscale_fxmark_benchmark(is_shmem: bool) {
let mut clients = Vec::new();
for nclient in 1..(num_clients + 1) {
let kernel_cmdline = format!(
"mode=client transport={} initargs={}X{}X{}",
"transport={} initargs={}X{}X{}",
if is_shmem { "shmem" } else { "ethernet" },
total_cores,
open_files,
Expand All @@ -395,6 +394,7 @@ fn rackscale_fxmark_benchmark(is_shmem: bool) {
));
let mut cmdline_client = RunnerArgs::new_with_build("userspace-smp", &build2)
.timeout(timeout)
.mode(RackscaleMode::Client)
.shmem_size(vec![shmem_size as usize; num_clients + 1])
.shmem_path(my_shmem_sockets)
.tap(&tap)
Expand Down Expand Up @@ -774,10 +774,8 @@ fn rackscale_vmops_benchmark(is_shmem: bool, benchtype: VMOpsBench) {

let mut dcm = spawn_dcm(1).expect("Failed to start DCM");

let controller_cmdline = format!(
"mode=controller transport={}",
if is_shmem { "shmem" } else { "ethernet" }
);
let controller_cmdline =
format!("transport={}", if is_shmem { "shmem" } else { "ethernet" });

// Create controller
let build1 = build.clone();
Expand All @@ -789,6 +787,7 @@ fn rackscale_vmops_benchmark(is_shmem: bool, benchtype: VMOpsBench) {
let mut cmdline_controller = RunnerArgs::new_with_build("userspace-smp", &build1)
.timeout(timeout)
.cmd(&controller_cmdline)
.mode(RackscaleMode::Controller)
.shmem_size(vec![shmem_size as usize; num_clients + 1])
.shmem_path(my_shmem_sockets)
.tap("tap0")
Expand Down Expand Up @@ -886,7 +885,7 @@ fn rackscale_vmops_benchmark(is_shmem: bool, benchtype: VMOpsBench) {
let mut clients = Vec::new();
for nclient in 1..(num_clients + 1) {
let kernel_cmdline = format!(
"mode=client transport={} initargs={}",
"transport={} initargs={}",
if is_shmem { "shmem" } else { "ethernet" },
total_cores,
);
Expand All @@ -903,6 +902,7 @@ fn rackscale_vmops_benchmark(is_shmem: bool, benchtype: VMOpsBench) {
));
let mut cmdline_client = RunnerArgs::new_with_build("userspace-smp", &build2)
.timeout(timeout)
.mode(RackscaleMode::Client)
.shmem_size(vec![shmem_size as usize; num_clients + 1])
.shmem_path(my_shmem_sockets)
.tap(&tap)
Expand Down
Loading

0 comments on commit b3ee39c

Please sign in to comment.