From 5c9694a0c1fc1d717c61597f659590dcb7b6f25b Mon Sep 17 00:00:00 2001 From: baude Date: Fri, 1 Dec 2017 11:26:30 -0600 Subject: kpod attach Attach to a running container Signed-off-by: baude Closes: #95 Approved by: rhatdan --- test/kpod_attach.bats | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 test/kpod_attach.bats (limited to 'test') diff --git a/test/kpod_attach.bats b/test/kpod_attach.bats new file mode 100644 index 000000000..968795935 --- /dev/null +++ b/test/kpod_attach.bats @@ -0,0 +1,32 @@ +#!/usr/bin/env bats + +load helpers + +function teardown() { + cleanup_test +} + +function setup() { + copy_images +} + +@test "attach to a bogus container" { + run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} attach foobar" + echo "$output" + [ "$status" -eq 1 ] +} + +@test "attach to non-running container" { + ${KPOD_BINARY} ${KPOD_OPTIONS} create --name foobar -d -i ${ALPINE} ls + run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} attach foobar" + echo "$output" + [ "$status" -eq 1 ] +} + +@test "attach to multiple containers" { + ${KPOD_BINARY} ${KPOD_OPTIONS} run --name foobar1 -d -i ${ALPINE} /bin/sh + ${KPOD_BINARY} ${KPOD_OPTIONS} run --name foobar2 -d -i ${ALPINE} /bin/sh + run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} attach foobar1 foobar2" + echo "$output" + [ "$status" -eq 1 ] +} -- cgit v1.2.3-54-g00ecf