From e8a32e3722e0b814c654cdb8809565a21fc120d3 Mon Sep 17 00:00:00 2001 From: baude Date: Tue, 28 Nov 2017 16:25:01 -0600 Subject: kpod exec Initial wiring of kpod exec. We wont support the following options for exec: * detach -- unsure of use case * detach-keys -- not supported by runc * interactive -- all terminals will be interactive Not adding exec tests as we need to think about how to support a test that requires console access but our CI tests have no console. Signed-off-by: baude --- test/kpod_exec.bats | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 test/kpod_exec.bats (limited to 'test/kpod_exec.bats') diff --git a/test/kpod_exec.bats b/test/kpod_exec.bats new file mode 100644 index 000000000..d495b1687 --- /dev/null +++ b/test/kpod_exec.bats @@ -0,0 +1,30 @@ +#!/usr/bin/env bats + +load helpers + +function teardown() { + cleanup_test +} + +function setup() { + copy_images +} + +@test "exec into a bogus container" { + run ${KPOD_BINARY} ${KPOD_OPTIONS} exec foobar ls + echo "$output" + [ "$status" -eq 1 ] +} + +@test "exec without command should fail" { + run ${KPOD_BINARY} ${KPOD_OPTIONS} exec foobar + echo "$output" + [ "$status" -eq 1 ] +} + +@test "exec simple command" { + ${KPOD_BINARY} ${KPOD_OPTIONS} run -d -t --name foobar1 ${ALPINE} sleep 60 + run ${KPOD_BINARY} ${KPOD_OPTIONS} exec foobar1 ls + echo "$output" + [ "$status" -eq 0 ] +} -- cgit v1.2.3-54-g00ecf