MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / kernel_pipe_echo_into_cat

Function kernel_pipe_echo_into_cat

tests/integration/kernel_integration.rs:2621–2646  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2619 FsEntry::Dir { path: "/sub" },
2620 ]);
2621
2622 let session = "ls | cat\nexit\n";
2623 let (_, outcome, uart) = boot_kernel(
2624 cached_kernel(),
2625 Some(&shell),
2626 Some(&image),
2627 session,
2628 120_000_000,
2629 );
2630
2631 assert!(!uart.contains("PANIC!"), "kernel panicked; uart={uart:?}");
2632 let cmd = uart.find("ls | cat").expect("pipeline not echoed");
2633 let after = &uart[cmd..];
2634 assert!(
2635 after.contains("real.txt"),
2636 "real file missing from ls; uart={uart:?}"
2637 );
2638 assert!(
2639 !after.contains(".pipe"),
2640 "pipe temp leaked into ls output; uart={uart:?}"
2641 );
2642 assert!(
2643 matches!(outcome, RunOutcome::Halted(0)),
2644 "shell did not exit cleanly; outcome={outcome:?} uart={uart:?}"
2645 );
2646}
2647
2648// `cat < file` (no file operand, stdin redirected): cat reads the redirected file
2649// and prints it. Proves the builtin input source also serves explicit `<`.

Callers

nothing calls this directly

Calls 4

compile_hosted_programFunction · 0.85
build_fs_imageFunction · 0.85
boot_kernelFunction · 0.85
cached_kernelFunction · 0.85

Tested by

no test coverage detected