2016-03-15 03:55:05 +08:00
|
|
|
#!/usr/bin/env bats
|
|
|
|
|
|
|
|
load helpers
|
|
|
|
|
|
|
|
@test "runc -h" {
|
2016-05-09 21:06:42 +08:00
|
|
|
runc -h
|
2016-03-15 03:55:05 +08:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
[[ ${lines[0]} =~ NAME:+ ]]
|
|
|
|
[[ ${lines[1]} =~ runc\ '-'\ Open\ Container\ Initiative\ runtime+ ]]
|
2016-05-16 16:21:52 +08:00
|
|
|
|
2016-05-09 21:06:42 +08:00
|
|
|
runc --help
|
2016-03-15 03:55:05 +08:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
[[ ${lines[0]} =~ NAME:+ ]]
|
|
|
|
[[ ${lines[1]} =~ runc\ '-'\ Open\ Container\ Initiative\ runtime+ ]]
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "runc command -h" {
|
2016-05-09 21:06:42 +08:00
|
|
|
runc checkpoint -h
|
2016-03-15 03:55:05 +08:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
[[ ${lines[1]} =~ runc\ checkpoint+ ]]
|
2016-05-16 16:21:52 +08:00
|
|
|
|
2016-05-09 21:06:42 +08:00
|
|
|
runc delete -h
|
2016-03-15 03:55:05 +08:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
[[ ${lines[1]} =~ runc\ delete+ ]]
|
2016-05-16 16:21:52 +08:00
|
|
|
|
2016-05-09 21:06:42 +08:00
|
|
|
runc events -h
|
2016-03-15 03:55:05 +08:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
[[ ${lines[1]} =~ runc\ events+ ]]
|
|
|
|
|
2016-05-09 21:06:42 +08:00
|
|
|
runc exec -h
|
2016-03-15 03:55:05 +08:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
[[ ${lines[1]} =~ runc\ exec+ ]]
|
2016-05-16 16:21:52 +08:00
|
|
|
|
2016-05-09 21:06:42 +08:00
|
|
|
runc kill -h
|
2016-03-15 03:55:05 +08:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
[[ ${lines[1]} =~ runc\ kill+ ]]
|
2016-05-16 16:21:52 +08:00
|
|
|
|
2016-05-09 21:06:42 +08:00
|
|
|
runc list -h
|
2016-03-15 03:55:05 +08:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
[[ ${lines[0]} =~ NAME:+ ]]
|
|
|
|
[[ ${lines[1]} =~ runc\ list+ ]]
|
2016-05-16 16:21:52 +08:00
|
|
|
|
2016-05-09 21:06:42 +08:00
|
|
|
runc list --help
|
2016-03-15 03:55:05 +08:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
[[ ${lines[0]} =~ NAME:+ ]]
|
|
|
|
[[ ${lines[1]} =~ runc\ list+ ]]
|
2016-05-16 16:21:52 +08:00
|
|
|
|
2016-05-09 21:06:42 +08:00
|
|
|
runc pause -h
|
2016-03-15 03:55:05 +08:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
[[ ${lines[1]} =~ runc\ pause+ ]]
|
2016-05-16 16:21:52 +08:00
|
|
|
|
2016-05-09 21:06:42 +08:00
|
|
|
runc restore -h
|
2016-03-15 03:55:05 +08:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
[[ ${lines[1]} =~ runc\ restore+ ]]
|
2016-05-16 16:21:52 +08:00
|
|
|
|
2016-05-09 21:06:42 +08:00
|
|
|
runc resume -h
|
2016-03-15 03:55:05 +08:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
[[ ${lines[1]} =~ runc\ resume+ ]]
|
2016-05-16 16:21:52 +08:00
|
|
|
|
2016-05-11 15:45:00 +08:00
|
|
|
# We don't use runc_spec here, because we're just testing the help page.
|
2016-05-09 21:06:42 +08:00
|
|
|
runc spec -h
|
2016-03-15 03:55:05 +08:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
[[ ${lines[1]} =~ runc\ spec+ ]]
|
2016-05-16 16:21:52 +08:00
|
|
|
|
2016-05-09 21:06:42 +08:00
|
|
|
runc start -h
|
2016-03-15 03:55:05 +08:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
[[ ${lines[1]} =~ runc\ start+ ]]
|
2016-09-06 20:40:01 +08:00
|
|
|
|
2016-05-14 06:49:45 +08:00
|
|
|
runc run -h
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
[[ ${lines[1]} =~ runc\ run+ ]]
|
2016-09-06 20:40:01 +08:00
|
|
|
|
2016-05-09 21:06:42 +08:00
|
|
|
runc state -h
|
2016-03-15 03:55:05 +08:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
[[ ${lines[1]} =~ runc\ state+ ]]
|
2016-05-16 16:21:52 +08:00
|
|
|
|
2016-11-07 17:13:55 +08:00
|
|
|
runc update -h
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
[[ ${lines[1]} =~ runc\ update+ ]]
|
|
|
|
|
2016-03-15 03:55:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "runc foo -h" {
|
2016-05-09 21:06:42 +08:00
|
|
|
runc foo -h
|
2016-05-10 13:58:09 +08:00
|
|
|
[ "$status" -ne 0 ]
|
2016-03-15 03:55:05 +08:00
|
|
|
[[ "${output}" == *"No help topic for 'foo'"* ]]
|
|
|
|
}
|