-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #1829 - RalfJung:isolation, r=RalfJung
isolated operations return EPERM; tweak isolation hint Follow-up to #1797
- Loading branch information
Showing
5 changed files
with
20 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
// compile-flags: -Zmiri-isolation-error=warn-nobacktrace | ||
// normalize-stderr-test "(getcwd|GetCurrentDirectoryW)" -> "$$GET" | ||
// normalize-stderr-test "(chdir|SetCurrentDirectoryW)" -> "$$SET" | ||
// normalize-stderr-test "(getcwd|GetCurrentDirectoryW)" -> "$$GETCWD" | ||
// normalize-stderr-test "(chdir|SetCurrentDirectoryW)" -> "$$SETCWD" | ||
|
||
use std::env; | ||
use std::io::ErrorKind; | ||
|
||
fn main() { | ||
// Test that current dir operations return a proper error instead | ||
// of stopping the machine in isolation mode | ||
assert_eq!(env::current_dir().unwrap_err().kind(), ErrorKind::NotFound); | ||
assert_eq!(env::current_dir().unwrap_err().kind(), ErrorKind::PermissionDenied); | ||
for _i in 0..3 { | ||
assert_eq!(env::current_dir().unwrap_err().kind(), ErrorKind::NotFound); | ||
// Ensure we get no repeated warnings when doing this multiple times. | ||
assert_eq!(env::current_dir().unwrap_err().kind(), ErrorKind::PermissionDenied); | ||
} | ||
|
||
assert_eq!(env::set_current_dir("..").unwrap_err().kind(), ErrorKind::NotFound); | ||
assert_eq!(env::set_current_dir("..").unwrap_err().kind(), ErrorKind::PermissionDenied); | ||
for _i in 0..3 { | ||
assert_eq!(env::set_current_dir("..").unwrap_err().kind(), ErrorKind::NotFound); | ||
assert_eq!(env::set_current_dir("..").unwrap_err().kind(), ErrorKind::PermissionDenied); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
warning: `$GET` was made to return an error due to isolation | ||
warning: `$GETCWD` was made to return an error due to isolation | ||
|
||
warning: `$SET` was made to return an error due to isolation | ||
warning: `$SETCWD` was made to return an error due to isolation | ||
|