File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,8 @@ fn test_mount_tmpfs_without_flags_allows_rwx() {
53
53
. unwrap_or_else ( |e| panic ! ( "read failed: {e}" ) ) ;
54
54
assert_eq ! ( buf, SCRIPT_CONTENTS ) ;
55
55
56
+ // while forking and unmounting prevent other child processes
57
+ let _m = FORK_MTX . lock ( ) ;
56
58
// Verify execute.
57
59
assert_eq ! (
58
60
EXPECTED_STATUS ,
@@ -89,6 +91,8 @@ fn test_mount_rdonly_disallows_write() {
89
91
. unwrap( )
90
92
) ;
91
93
94
+ // wait for child processes to prevent EBUSY
95
+ let _m = FORK_MTX . lock ( ) ;
92
96
umount ( tempdir. path ( ) ) . unwrap_or_else ( |e| panic ! ( "umount failed: {e}" ) ) ;
93
97
}
94
98
@@ -129,6 +133,8 @@ fn test_mount_noexec_disallows_exec() {
129
133
& test_path
130
134
) ;
131
135
136
+ // while forking and unmounting prevent other child processes
137
+ let _m = FORK_MTX . lock ( ) ;
132
138
// EACCES: Permission denied
133
139
assert_eq ! (
134
140
EACCES ,
@@ -168,6 +174,8 @@ fn test_mount_bind() {
168
174
. and_then ( |mut f| f. write ( SCRIPT_CONTENTS ) )
169
175
. unwrap_or_else ( |e| panic ! ( "write failed: {e}" ) ) ;
170
176
177
+ // wait for child processes to prevent EBUSY
178
+ let _m = FORK_MTX . lock ( ) ;
171
179
umount ( mount_point. path ( ) )
172
180
. unwrap_or_else ( |e| panic ! ( "umount failed: {e}" ) ) ;
173
181
}
You can’t perform that action at this time.
0 commit comments