File tree Expand file tree Collapse file tree 3 files changed +30
-1
lines changed
test-framework/sudo-compliance-tests/src Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ pub(in crate::exec) fn exec_pty(
6060 // `policy_init_session`.
6161 // FIXME (ogsudo): initializes ttyblock sigset here by calling `init_ttyblock`
6262
63- // Fetch the parent process group so we can signals to it.
63+ // Fetch the parent process group so we can send signals to it.
6464 let parent_pgrp = getpgrp ( ) ;
6565
6666 // Set all the IO streams for the command to the follower side of the pty.
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ mod apparmor;
33mod child_process;
44mod cli;
55mod env_reset;
6+ mod flag_background;
67mod flag_chdir;
78mod flag_group;
89mod flag_help;
Original file line number Diff line number Diff line change 1+ use sudo_test:: { Command , Env } ;
2+
3+ use crate :: SUDOERS_ALL_ALL_NOPASSWD ;
4+
5+ #[ test]
6+ fn runs_in_background ( ) {
7+ let env = Env ( SUDOERS_ALL_ALL_NOPASSWD ) . build ( ) ;
8+
9+ Command :: new ( "sudo" )
10+ . args ( [
11+ "-b" ,
12+ "sh" ,
13+ "-c" ,
14+ "touch /tmp/barrier1; until [ -f /tmp/barrier2 ]; do sleep 0.1; done; touch /tmp/barrier3" ,
15+ ] )
16+ . output ( & env)
17+ . assert_success ( ) ;
18+
19+ Command :: new ( "sh" )
20+ . args ( [
21+ "-c" ,
22+ "until [ -f /tmp/barrier1 ]; do sleep 0.1; done
23+ touch /tmp/barrier2
24+ until [ -f /tmp/barrier3 ]; do sleep 0.1; done" ,
25+ ] )
26+ . output ( & env)
27+ . assert_success ( ) ;
28+ }
You can’t perform that action at this time.
0 commit comments