fix linting and tests

This commit is contained in:
Megan Marsh 2020-04-24 14:27:56 -07:00
parent b5744efb42
commit 32752d4577
1 changed files with 18 additions and 17 deletions

View File

@ -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