Test Ctrl-C, job control and hangup with an interactive shell on a terminal
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
use std::os::unix::process::{CommandExt, ExitStatusExt};
|
||||
use std::path::Path;
|
||||
use std::process::{Child, Stdio};
|
||||
use std::thread;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
use tempfile::TempDir;
|
||||
|
||||
@@ -125,14 +123,6 @@ fn spawn_sandbox(args: &[&str], dir: &Path, script: &str) -> (Sandbox, Child) {
|
||||
(sandbox, child)
|
||||
}
|
||||
|
||||
fn wait_for_file(path: &Path) {
|
||||
let deadline = Instant::now() + Duration::from_secs(10);
|
||||
while !path.exists() {
|
||||
assert!(Instant::now() < deadline, "timed out waiting for {path:?}");
|
||||
thread::sleep(Duration::from_millis(10));
|
||||
}
|
||||
}
|
||||
|
||||
fn send_signal(child: &Child, signal: i32) {
|
||||
unsafe { libc::kill(child.id() as i32, signal) };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user