-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cesar Talledo (2): Remove runc default devices that overlap with spec devices. Skip redundant setup for /dev/ptmx when specified explicitly in the OCI spec. LGTMs: @AkihiroSuda @cyphar Closes #2522
- Loading branch information
Showing
4 changed files
with
182 additions
and
18 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env bats | ||
|
||
load helpers | ||
|
||
function setup() { | ||
teardown_busybox | ||
setup_busybox | ||
} | ||
|
||
function teardown() { | ||
teardown_busybox | ||
} | ||
|
||
@test "runc run [redundant default /dev/tty]" { | ||
update_config ' .linux.devices += [{"path": "/dev/tty", "type": "c", "major": 5, "minor": 0}] | ||
| .process.args |= ["ls", "-lL", "/dev/tty"]' | ||
|
||
runc run test_dev | ||
[ "$status" -eq 0 ] | ||
|
||
if [[ "$ROOTLESS" -ne 0 ]]; then | ||
[[ "${lines[0]}" =~ "crw-rw-rw".+"1".+"nobody".+"nogroup".+"5,".+"0".+"/dev/tty" ]] | ||
else | ||
[[ "${lines[0]}" =~ "crw-rw-rw".+"1".+"root".+"root".+"5,".+"0".+"/dev/tty" ]] | ||
fi | ||
} | ||
|
||
@test "runc run [redundant default /dev/ptmx]" { | ||
update_config ' .linux.devices += [{"path": "/dev/ptmx", "type": "c", "major": 5, "minor": 2}] | ||
| .process.args |= ["ls", "-lL", "/dev/ptmx"]' | ||
|
||
runc run test_dev | ||
[ "$status" -eq 0 ] | ||
[[ "${lines[0]}" =~ "crw-rw-rw".+"1".+"root".+"root".+"5,".+"2".+"/dev/ptmx" ]] | ||
} |