Commit f99837b4 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

test: fix GCE test

parent 044e7fa3
...@@ -24,7 +24,7 @@ USER_VARS="${USER_VARS} -var project_id=${GC_PROJECT_ID}" ...@@ -24,7 +24,7 @@ USER_VARS="${USER_VARS} -var project_id=${GC_PROJECT_ID}"
# This tests if GCE has an image that contains the given parameter. # This tests if GCE has an image that contains the given parameter.
gc_has_image() { gc_has_image() {
gcutil --format=names --project=${GC_PROJECT_ID} listimages \ gcutil --format=names --project=${GC_PROJECT_ID} listimages \
| grep $1 | grep $1 | wc -l
} }
teardown() { teardown() {
...@@ -36,5 +36,5 @@ teardown() { ...@@ -36,5 +36,5 @@ teardown() {
@test "googlecompute: build minimal.json" { @test "googlecompute: build minimal.json" {
run packer build ${USER_VARS} $FIXTURE_ROOT/minimal.json run packer build ${USER_VARS} $FIXTURE_ROOT/minimal.json
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
[ "$(gc_has_image "packerbats-minimal")" -eq 0 ] [ "$(gc_has_image "packerbats-minimal")" -eq 1 ]
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment