Improve test coverage

This commit is contained in:
Peter Wilmott
2015-07-23 17:56:51 +01:00
parent 39ebf616c4
commit 6e6ee2d3b2
12 changed files with 103 additions and 16 deletions

21
tests/test_commit Normal file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -o errexit -o nounset -o pipefail
img="$(./bocker init ~/base-image | awk '{print $2}')"
./bocker images | grep -qw "$img"
[[ "$?" == 0 ]]
./bocker run "$img" which wget
ps="$(./bocker ps | grep 'which wget' | awk '{print $1}')"
logs="$(./bocker logs "$ps")"
./bocker rm "$ps"
[[ "$logs" == "which: no wget in"* ]]
./bocker run "$img" yum install -y wget
ps="$(./bocker ps | grep 'yum install -y wget' | awk '{print $1}')"
./bocker commit "$ps" "$img"
./bocker run "$img" which wget
ps="$(./bocker ps | grep 'which wget' | awk '{print $1}')"
logs="$(./bocker logs "$ps")"
[[ "$logs" == '/usr/bin/wget' ]]