mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
linux: Support setting execution domain via linux personality
carry #3126 Co-authored-by: Aditya R <arajan@redhat.com> Signed-off-by: Zheao.Li <me@manjusaka.me>
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load helpers
|
||||
|
||||
function setup() {
|
||||
requires arch_x86_64
|
||||
setup_busybox
|
||||
}
|
||||
|
||||
function teardown() {
|
||||
teardown_bundle
|
||||
}
|
||||
|
||||
@test "runc run personality for i686" {
|
||||
update_config '
|
||||
.process.args = ["/bin/sh", "-c", "uname -a"]
|
||||
| .linux.personality = {
|
||||
"domain": "LINUX32",
|
||||
"flags": []
|
||||
}'
|
||||
|
||||
runc run test_busybox
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" == *"i686"* ]]
|
||||
}
|
||||
|
||||
@test "runc run personality with exec for i686" {
|
||||
update_config '
|
||||
.linux.personality = {
|
||||
"domain": "LINUX32",
|
||||
}'
|
||||
|
||||
runc run -d --console-socket "$CONSOLE_SOCKET" test_busybox
|
||||
[ "$status" -eq 0 ]
|
||||
runc exec test_busybox /bin/sh -c "uname -a"
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" == *"i686"* ]]
|
||||
}
|
||||
|
||||
@test "runc run personality for x86_64" {
|
||||
update_config '
|
||||
.process.args = ["/bin/sh", "-c", "uname -a"]
|
||||
| .linux.personality = {
|
||||
"domain": "LINUX",
|
||||
"flags": []
|
||||
}'
|
||||
|
||||
runc run test_busybox
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" == *"x86_64"* ]]
|
||||
}
|
||||
|
||||
@test "runc run personality with exec for x86_64" {
|
||||
update_config '
|
||||
.linux.personality = {
|
||||
"domain": "LINUX",
|
||||
}'
|
||||
|
||||
runc run -d --console-socket "$CONSOLE_SOCKET" test_busybox
|
||||
[ "$status" -eq 0 ]
|
||||
runc exec test_busybox /bin/sh -c "uname -a"
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" == *"x86_64"* ]]
|
||||
}
|
||||
Reference in New Issue
Block a user