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

Commit 7bce351

Browse files
committed
tests: set the machine id to 0 for the sharded tests
Signed-off-by: Reto Achermann <[email protected]>
1 parent 537ed28 commit 7bce351

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

kernel/testutils/src/rackscale_runner.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ impl<T: Clone + Send + 'static> RackscaleRun<T> {
483483
.memory(state.memory)
484484
.nobuild() // Use single build for all for consistency
485485
.cmd(&client_cmd)
486+
.machine_id(0) // always hardcoded to 0 for the sharded case
486487
.nodes(1)
487488
.node_offset(client_placement_cores[i + 1].0)
488489
.setaffinity(client_placement_cores[i + 1].1.clone());

kernel/testutils/src/runner_args.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ pub struct RunnerArgs<'a> {
5959
nobuild: bool,
6060
/// Parameters to add to the QEMU command line
6161
qemu_args: Vec<&'a str>,
62+
/// the machine id to set
63+
machine_id: Option<usize>,
6264
/// Timeout in ms
6365
pub timeout: Option<u64>,
6466
/// Default network interface for QEMU
@@ -119,6 +121,7 @@ impl<'a> RunnerArgs<'a> {
119121
no_network_setup: false,
120122
mode: None,
121123
transport: None,
124+
machine_id: None,
122125
};
123126

124127
if cfg!(feature = "prealloc") {
@@ -156,6 +159,7 @@ impl<'a> RunnerArgs<'a> {
156159
no_network_setup: false,
157160
mode: None,
158161
transport: None,
162+
machine_id: None,
159163
};
160164

161165
if cfg!(feature = "prealloc") {
@@ -283,6 +287,11 @@ impl<'a> RunnerArgs<'a> {
283287
self
284288
}
285289

290+
pub fn machine_id(mut self, id: usize) -> RunnerArgs<'a> {
291+
self.machine_id = Some(id);
292+
self
293+
}
294+
286295
pub fn shmem_size(mut self, sizes: Vec<usize>) -> RunnerArgs<'a> {
287296
self.shmem_sizes = sizes;
288297
self
@@ -456,6 +465,10 @@ impl<'a> RunnerArgs<'a> {
456465
cmd.push(String::from("--kgdb"));
457466
}
458467

468+
if let Some(mid) = self.machine_id {
469+
cmd.push(format!("--mid={mid}"));
470+
}
471+
459472
// Don't run qemu, just build?
460473
if self.norun {
461474
cmd.push(String::from("--norun"));

0 commit comments

Comments
 (0)