mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
9a699e1a9f
Per the OCI spec, /dev/ptmx is always a symlink to /dev/pts/ptmx. As such, if the OCI spec has an explicit entry for /dev/ptmx, runc shall ignore it. This change ensures this is the case. A integration test was also added (in tests/integration/dev.bats). Signed-off-by: Cesar Talledo <ctalledo@nestybox.com>
36 lines
910 B
Bash
36 lines
910 B
Bash
#!/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" ]]
|
|
}
|