Skip to content

Commit

Permalink
tests: using virtio for memcached tests
Browse files Browse the repository at this point in the history
Signed-off-by: Reto Achermann <[email protected]>
  • Loading branch information
achreto committed Sep 11, 2023
1 parent 9333a91 commit dbf5331
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
24 changes: 18 additions & 6 deletions kernel/tests/s11_rackscale_benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,8 @@ fn rackscale_memcached_benchmark_sharded() {
if config.is_local_host {
servers.push_str(format!("tcp://localhost:{}", 11211 + i).as_str());
} else {
let ip = 10 + i;
// +1 because tap0 is reserved for the controller.
let ip = 10 + i + 1;
servers.push_str(format!("tcp://172.31.0.{}:{}", ip, 11211).as_str());
}
} else {
Expand Down Expand Up @@ -1039,13 +1040,14 @@ fn rackscale_memcached_benchmark_sharded() {
let built = BuildArgs::default()
.module("rkapps")
.user_feature("rkapps:memcached-bench")
// .user_feature("rkapps:virtio")
// .user_feature("libvibrio:virtio")
.user_feature("rkapps:virtio")
.user_feature("libvibrio:virtio")
.kernel_feature("pages-4k")
.release()
.set_rackscale(false)
.build();


fn controller_run_fun(
config: Option<&MemcachedShardedConfig>,
timeout_ms: u64,
Expand Down Expand Up @@ -1094,15 +1096,25 @@ fn rackscale_memcached_benchmark_sharded() {
_is_baseline: bool,
_arg: Option<MemcachedShardedConfig>,
) -> Result<()> {
proc.exp_regex(r#"\[ INFO\]: bootloader/src/kernel.rs"#)
.expect("bootloaader");
match proc.exp_regex(r#"\[ INFO\]: bootloader/src/kernel.rs"#) {
Ok(_) => (),
Err( rexpect::errors::Error(rexpect::errors::ErrorKind::EOF(_expected, s, _), _state)) => {
for l in s.lines() {
println!("MEMCACHED-OUTPUT: {}", l);
}
}
Err(e) => {
println!("{e:?}");
panic!("error")
}
}

while let Ok(l) = proc.read_line() {
println!("MEMCACHED-OUTPUT: {}", l);
}

match proc.exp_regex(r#"dhcp: vioif0: adding IP address (\d+).(\d+).(\d+).(\d+)/(\d+)"#) {
Ok((prev, matched)) => {
Ok((_prev, matched)) => {
println!(" > Networking setup succeeded. {matched}");
}
Err(e) => {
Expand Down
2 changes: 1 addition & 1 deletion kernel/testutils/src/rackscale_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ impl<T: Clone + Send + 'static> RackscaleRun<T> {
let mut cmdline_client =
RunnerArgs::new_with_build(&client_kernel_test, &state.built)
.timeout(state.client_timeout)
// .use_virtio()
.use_virtio()
.tap(&format!("tap{}", (i + 1) * 2))
.no_network_setup()
.cores(state.cores_per_client)
Expand Down

0 comments on commit dbf5331

Please sign in to comment.