Skip to content

Commit bcc6205

Browse files
buck-rossnievesmontero
authored andcommitted
test: add tests for toolbox create --hostname ??
These tests ensure that the new `--hostname` flag works as intended. Signed-off-by: Buckley Ross <[email protected]> Change-Id: Id7b7775fe73a6600afe2dabb0d905be5ba17bb57
1 parent 4cbb123 commit bcc6205

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/system/101-create.bats

+19
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,25 @@ teardown() {
9696
assert [ ${#lines[@]} -eq 3 ]
9797
}
9898

99+
@test "create: Create a container with a custom hostname ('test.host-name.local')" {
100+
run $TOOLBOX -y create --hostname test.host-name.local
101+
102+
assert_success
103+
assert_output --partial "Enter with: toolbox enter"
104+
105+
run $TOOLBOX -y run -- hostname
106+
107+
assert_success
108+
assert_output --partial "test.host-name.local"
109+
}
110+
111+
@test "create: Create a container with an invalid hostname ('test.host-name.local.')" {
112+
run $TOOLBOX -y create --hostname test.host-name.local.
113+
114+
assert_failure
115+
assert_line --index 0 "Error: invalid hostname"
116+
}
117+
99118
@test "create: Try to create a container based on non-existent image" {
100119
run $TOOLBOX -y create -i foo.org/bar
101120

0 commit comments

Comments
 (0)