From d3591087e8badca766b43ef14db44c1be2a6cce0 Mon Sep 17 00:00:00 2001 From: Jim Van Fleet Date: Tue, 9 Aug 2016 10:19:19 -0400 Subject: [PATCH] Adding tests for running image --- tests/image.bats | 9 --------- tests/running.bats | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 tests/running.bats diff --git a/tests/image.bats b/tests/image.bats index cc1db3d..b52fe41 100755 --- a/tests/image.bats +++ b/tests/image.bats @@ -2,15 +2,6 @@ load ../common -setup() { - ./bin/rebuild.sh -} - -@test "Should be buildable" { - run bin/build.sh - [ "$status" -eq 0 ] -} - @test "Concludes first-run experience" { result="$(docker run -i $maintainer/$imagename find /tmp/firsttimerunning)" [ "$result" != '' ] diff --git a/tests/running.bats b/tests/running.bats new file mode 100644 index 0000000..b592d41 --- /dev/null +++ b/tests/running.bats @@ -0,0 +1,15 @@ +#!/usr/bin/env bats + +load ../common + +# These tests assume the pipeline will start and stop the container. + +@test "Leaves running process" { + result="$(docker ps | grep $imagename)" + [ "$result" != '' ] +} + +@test "Exposes running HTTP service" { + result="$(docker exec -i $imagename curl http://localhost/)" + [ "$result" != '' ] +} \ No newline at end of file