Add smoke test for troposphere
This commit is contained in:
@@ -0,0 +1,37 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
IMAGE="$1"
|
||||||
|
FAILED=0
|
||||||
|
PASSED=0
|
||||||
|
|
||||||
|
assert_eq() {
|
||||||
|
local desc="$1" expected="$2" actual="$3"
|
||||||
|
if [ "$expected" = "$actual" ]; then
|
||||||
|
echo "PASS: $desc"
|
||||||
|
PASSED=$((PASSED + 1))
|
||||||
|
else
|
||||||
|
echo "FAIL: $desc (expected $expected, got $actual)"
|
||||||
|
FAILED=$((FAILED + 1))
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
TMPDIR="$(mktemp -d)"
|
||||||
|
trap 'rm -rf "$TMPDIR"' EXIT
|
||||||
|
|
||||||
|
docker run --rm "$IMAGE" python -c "import troposphere; print(troposphere.__version__)" > "$TMPDIR/output" 2>&1 && RC=0 || RC=$?
|
||||||
|
assert_eq "import troposphere exits cleanly" "0" "$RC"
|
||||||
|
|
||||||
|
if [ -s "$TMPDIR/output" ]; then
|
||||||
|
echo "PASS: import produces version output"
|
||||||
|
PASSED=$((PASSED + 1))
|
||||||
|
else
|
||||||
|
echo "FAIL: import produces no output"
|
||||||
|
FAILED=$((FAILED + 1))
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "$PASSED/$((PASSED + FAILED)) tests passed"
|
||||||
|
if [ "$FAILED" -gt 0 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user