forked from opencontainers/runc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
linux: Support setting execution domain via linux personality
carry opencontainers#3126 Co-authored-by: Aditya R <arajan@redhat.com> Signed-off-by: Zheao.Li <me@manjusaka.me>
- Loading branch information
Showing
9 changed files
with
129 additions
and
1 deletion.
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
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
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,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"* ]] | ||
} |