Files
docker-docs/test/integration/api/commit.bats
Andrea Luzzardi 85464cdc7c integration: split api into individual tests
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-06 00:35:55 -07:00

36 lines
715 B
Bash

#!/usr/bin/env bats
load ../helpers
function teardown() {
swarm_manage_cleanup
stop_docker
}
@test "docker commit" {
start_docker 3
swarm_manage
run docker_swarm run -d --name test_container busybox sleep 500
[ "$status" -eq 0 ]
# make sure container exists
run docker_swarm ps -l
[ "${#lines[@]}" -eq 2 ]
[[ "${lines[1]}" == *"test_container"* ]]
# no comming name before commit
run docker_swarm images
[ "$status" -eq 0 ]
[[ "${output}" != *"commit_image_busybox"* ]]
# commit container
run docker_swarm commit test_container commit_image_busybox
[ "$status" -eq 0 ]
# verify after commit
run docker_swarm images
[ "$status" -eq 0 ]
[[ "${output}" == *"commit_image_busybox"* ]]
}