2016-05-27 05:44:59 +08:00
|
|
|
#!/usr/bin/env bats
|
|
|
|
|
|
|
|
load helpers
|
|
|
|
|
|
|
|
function setup() {
|
|
|
|
teardown_busybox
|
|
|
|
setup_busybox
|
|
|
|
}
|
|
|
|
|
|
|
|
function teardown() {
|
|
|
|
teardown_busybox
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "runc create" {
|
2016-05-28 04:13:11 +08:00
|
|
|
runc create --console /dev/pts/ptmx test_busybox
|
2016-05-27 05:44:59 +08:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
|
|
|
|
testcontainer test_busybox created
|
|
|
|
|
|
|
|
# start the command
|
2016-05-28 04:13:11 +08:00
|
|
|
runc start test_busybox
|
2016-05-27 05:44:59 +08:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
|
|
|
|
testcontainer test_busybox running
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "runc create exec" {
|
2016-05-28 04:13:11 +08:00
|
|
|
runc create --console /dev/pts/ptmx test_busybox
|
2016-05-27 05:44:59 +08:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
|
|
|
|
testcontainer test_busybox created
|
|
|
|
|
2016-05-28 04:13:11 +08:00
|
|
|
runc exec test_busybox true
|
2016-05-27 05:44:59 +08:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
|
|
|
|
# start the command
|
2016-05-28 04:13:11 +08:00
|
|
|
runc start test_busybox
|
2016-05-27 05:44:59 +08:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
|
|
|
|
testcontainer test_busybox running
|
|
|
|
}
|