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

Commit d837e8d

Browse files
Erika Hunhoffhunhoffe
authored andcommitted
Remove DCM test as request_core and phys_alloc are tested elsewhere
1 parent c02298d commit d837e8d

2 files changed

Lines changed: 1 addition & 147 deletions

File tree

kernel/src/integration_tests.rs

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::ExitReason;
1111
type MainFn = fn();
1212

1313
#[cfg(feature = "integration-test")]
14-
const INTEGRATION_TESTS: [(&str, MainFn); 28] = [
14+
const INTEGRATION_TESTS: [(&str, MainFn); 27] = [
1515
("exit", just_exit_ok),
1616
("wrgsbase", wrgsbase),
1717
("pfault-early", just_exit_fail),
@@ -37,7 +37,6 @@ const INTEGRATION_TESTS: [(&str, MainFn); 28] = [
3737
("replica-advance", replica_advance),
3838
("gdb", gdb),
3939
("vmxnet-smoltcp", vmxnet_smoltcp),
40-
("dcm", dcm),
4140
("cxl-read", cxl_read),
4241
("cxl-write", cxl_write),
4342
];
@@ -764,41 +763,6 @@ fn vmxnet_smoltcp() {
764763
shutdown(ExitReason::Ok);
765764
}
766765

767-
/// Test vmxnet3 integrated with smoltcp.s
768-
#[cfg(all(feature = "integration-test", target_arch = "x86_64"))]
769-
fn dcm() {
770-
use crate::arch::rackscale::client::RPC_CLIENT;
771-
use crate::arch::rackscale::processops::allocate_physical::rpc_allocate_physical;
772-
use crate::arch::rackscale::processops::core::rpc_request_core;
773-
use crate::memory::{paddr_to_kernel_vaddr, PAddr, BASE_PAGE_SIZE};
774-
use log::info;
775-
776-
let pid = 0; // Using dummy pid for now
777-
let affinity = 0; // Using dummy affinity for now
778-
let frame_size = BASE_PAGE_SIZE as u64; // Using dummy frame_size for now
779-
let core_id = 3; // Using dummy core_id for now
780-
let entry_point = 4; // Using dummy entry_point for now
781-
782-
info!("About to send resource requests!");
783-
for _ in 0..3 {
784-
let mut client = RPC_CLIENT.lock();
785-
let (_alloced_frame_size, addr_base) =
786-
rpc_allocate_physical(&mut **client, pid, frame_size, affinity).unwrap();
787-
788-
let vaddr_base = paddr_to_kernel_vaddr(PAddr::from(addr_base)).as_u64();
789-
for i in 0..2 {
790-
let region = (vaddr_base + i as u64) as *mut u8;
791-
unsafe { core::ptr::write(region, 0xb) };
792-
}
793-
794-
// TODO: use the core
795-
let _core_ret = rpc_request_core(&mut **client, pid, core_id, entry_point).unwrap();
796-
}
797-
798-
info!("Finished sending resource requests!");
799-
shutdown(ExitReason::Ok);
800-
}
801-
802766
/// Write and test the content on a shared-mem device.
803767
pub(crate) const BUFFER_CONTENT: u8 = 0xb;
804768

kernel/tests/s06_rackscale_tests.rs

Lines changed: 0 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -204,116 +204,6 @@ fn rackscale_fs_test(is_shmem: bool) {
204204
let _ignore = remove_file(SHMEM_PATH);
205205
}
206206

207-
#[cfg(not(feature = "baremetal"))]
208-
#[test]
209-
fn s06_rackscale_shmem_dcm_test() {
210-
rackscale_dcm_test(true);
211-
}
212-
213-
#[cfg(not(feature = "baremetal"))]
214-
#[test]
215-
fn s06_rackscale_ethernet_dcm_test() {
216-
rackscale_dcm_test(false);
217-
}
218-
219-
#[cfg(not(feature = "baremetal"))]
220-
fn rackscale_dcm_test(is_shmem: bool) {
221-
use std::fs::remove_file;
222-
use std::sync::Arc;
223-
use std::thread::sleep;
224-
use std::time::Duration;
225-
226-
// Setup ivshmem file
227-
setup_shmem(SHMEM_PATH, SHMEM_SIZE);
228-
229-
setup_network(2);
230-
let timeout = 30_000;
231-
232-
// Create build for both controller and client
233-
let build = Arc::new(
234-
BuildArgs::default()
235-
.module("init")
236-
.user_feature("test-fs")
237-
.kernel_feature("shmem")
238-
.kernel_feature("ethernet")
239-
.kernel_feature("rackscale")
240-
.release()
241-
.build(),
242-
);
243-
244-
// Run DCM and controller in separate thread
245-
let build1 = build.clone();
246-
let controller = std::thread::spawn(move || {
247-
let controller_cmd = if is_shmem {
248-
"mode=controller transport=shmem"
249-
} else {
250-
"mode=controller transport=ethernet"
251-
};
252-
let cmdline_controller = RunnerArgs::new_with_build("userspace-smp", &build1)
253-
.timeout(timeout)
254-
.cmd(controller_cmd)
255-
.shmem_size(SHMEM_SIZE as usize)
256-
.shmem_path(SHMEM_PATH)
257-
.tap("tap0")
258-
.no_network_setup()
259-
.workers(2)
260-
.use_vmxnet3();
261-
262-
let mut output = String::new();
263-
let mut qemu_run = || -> Result<WaitStatus> {
264-
let mut dcm = spawn_dcm(1, timeout)?;
265-
let mut p = spawn_nrk(&cmdline_controller)?;
266-
267-
output += p.exp_string("Created DCM UDP socket!")?.as_str();
268-
output += p.exp_string("Created DCM RPC client!")?.as_str();
269-
output += p.exp_eof()?.as_str();
270-
271-
dcm.send_control('c')?;
272-
p.process.exit()
273-
};
274-
275-
let _ignore = qemu_run();
276-
});
277-
278-
// Run client in separate thead. Wait a bit to make sure DCM and controller started
279-
let build2 = build.clone();
280-
let client = std::thread::spawn(move || {
281-
sleep(Duration::from_millis(5_000));
282-
let client_cmd = if is_shmem {
283-
"mode=client transport=shmem"
284-
} else {
285-
"mode=client transport=ethernet"
286-
};
287-
let cmdline_client = RunnerArgs::new_with_build("dcm", &build2)
288-
.timeout(timeout)
289-
.cmd(client_cmd)
290-
.shmem_size(SHMEM_SIZE as usize)
291-
.shmem_path(SHMEM_PATH)
292-
.tap("tap2")
293-
.no_network_setup()
294-
.workers(2)
295-
.use_vmxnet3();
296-
297-
let mut output = String::new();
298-
let mut qemu_run = || -> Result<WaitStatus> {
299-
let mut p = spawn_nrk(&cmdline_client)?;
300-
output += p.exp_string("About to send resource requests")?.as_str();
301-
output += p
302-
.exp_string("Finished sending resource requests!")?
303-
.as_str();
304-
output += p.exp_eof()?.as_str();
305-
p.process.exit()
306-
};
307-
308-
check_for_successful_exit(&cmdline_client, qemu_run(), output);
309-
});
310-
311-
controller.join().unwrap();
312-
client.join().unwrap();
313-
314-
let _ignore = remove_file(SHMEM_PATH);
315-
}
316-
317207
#[cfg(not(feature = "baremetal"))]
318208
#[test]
319209
fn s06_rackscale_shmem_fs_prop_test() {

0 commit comments

Comments
 (0)