From 32752d45776a727a20a098c95304ee7465a12909 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Fri, 24 Apr 2020 14:27:56 -0700 Subject: [PATCH] fix linting and tests --- builder/googlecompute/config_test.go | 35 ++++++++++++++-------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/builder/googlecompute/config_test.go b/builder/googlecompute/config_test.go index 2b4eeb33a..438a1bd06 100644 --- a/builder/googlecompute/config_test.go +++ b/builder/googlecompute/config_test.go @@ -384,17 +384,19 @@ func TestConfigPrepareStartupScriptFile(t *testing.T) { func TestConfigPrepareIAP(t *testing.T) { config := map[string]interface{}{ - "project_id": "project", - "source_image": "foo", - "ssh_username": "packer", - "startup_script_file": "no-such-file", - "zone": "us-central1-a", - "communicator": "ssh", - "use_iap": true, + "project_id": "project", + "source_image": "foo", + "ssh_username": "packer", + "zone": "us-central1-a", + "communicator": "ssh", + "use_iap": true, } var c Config - c.Prepare(config) + _, err := c.Prepare(config) + if err != nil { + t.Fatalf("Shouldn't have errors. Err = %s", err) + } if c.IAPHashBang != "/bin/sh" { t.Fatalf("IAP hashbang didn't default correctly to /bin/sh.") @@ -409,15 +411,14 @@ func TestConfigPrepareIAP(t *testing.T) { func TestConfigPrepareIAP_failures(t *testing.T) { config := map[string]interface{}{ - "project_id": "project", - "source_image": "foo", - "winrm_username": "packer", - "startup_script_file": "no-such-file", - "zone": "us-central1-a", - "communicator": "winrm", - "iap_hashbang": "/bin/bash", - "iap_ext": ".ps1", - "use_iap": true, + "project_id": "project", + "source_image": "foo", + "winrm_username": "packer", + "zone": "us-central1-a", + "communicator": "winrm", + "iap_hashbang": "/bin/bash", + "iap_ext": ".ps1", + "use_iap": true, } var c Config