Skip to content

Commit

Permalink
Add a test case for hostanme and domainname
Browse files Browse the repository at this point in the history
Signed-off-by: utam0k <k0ma@utam0k.jp>
  • Loading branch information
utam0k committed Sep 15, 2022
1 parent bfbc652 commit 12e525f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions tests/integration/dev.bats
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,24 @@ function teardown() {
runc exec -t test_exec sh -c "ls -l /proc/self/fd/0; echo 123"
[ "$status" -eq 0 ]
}

@test "runc run [hostname domainname]" {
requires root

update_config ' .process.args |= ["sh"]
| .hostname = "myhostname"
| .domainname= "mydomainname"'

runc run -d --console-socket "$CONSOLE_SOCKET" test_allow_char
[ "$status" -eq 0 ]

# test hostname
runc exec test_allow_char sh -c 'hostname'
[ "$status" -eq 0 ]
[[ "${lines[0]}" == *'myhostname'* ]]

# test domainname
runc exec test_allow_char sh -c 'cat /proc/sys/kernel/domainname'
[ "$status" -eq 0 ]
[[ "${lines[0]}" == *'mydomainname'* ]]
}
2 changes: 1 addition & 1 deletion tests/integration/get-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function get() {
fi
}

arch=$(go env GOARCH)
arch=$(/usr/local/go/bin/go env GOARCH)
# Convert from GOARCH to whatever the URLs below are using.
case $arch in
arm64)
Expand Down

0 comments on commit 12e525f

Please sign in to comment.