Skip to content

Commit

Permalink
add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
squell committed Aug 23, 2024
1 parent 528499f commit 6b5151d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions test-framework/e2e-tests/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![cfg(test)]

mod pty;
mod regression;
mod su;

type Error = Box<dyn std::error::Error>;
Expand Down
17 changes: 17 additions & 0 deletions test-framework/e2e-tests/src/regression.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
use sudo_test::{Command, Env, TextFile};

use crate::Result;

#[test]
fn syslog_writer_should_not_hang() -> Result<()> {
let env = Env(TextFile("ALL ALL=(ALL:ALL) NOPASSWD: ALL").chmod("644")).build()?;

let stdout = Command::new("sudo")
.args(["env", "CC=clang-18", "CXX=clang++-18", "FOO=\"........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................\"", "whoami"])
.output(&env)?
.stdout()?;

assert_eq!(stdout, "root");

Ok(())
}

0 comments on commit 6b5151d

Please sign in to comment.