diff --git a/post-processor/vsphere-tpl/post-processor.go b/post-processor/vsphere-tpl/post-processor.go index 07f749c3f..b5fc59325 100644 --- a/post-processor/vsphere-tpl/post-processor.go +++ b/post-processor/vsphere-tpl/post-processor.go @@ -4,8 +4,8 @@ import ( "context" "fmt" "net/url" - "time" "strings" + "time" "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/config" diff --git a/post-processor/vsphere-tpl/post_processor_test.go b/post-processor/vsphere-tpl/post_processor_test.go index 2b48c6401..34675b16c 100644 --- a/post-processor/vsphere-tpl/post_processor_test.go +++ b/post-processor/vsphere-tpl/post_processor_test.go @@ -1 +1,19 @@ package vsphere_tpl + +import ( + "testing" +) + +func TestConfigureURL(t *testing.T) { + var p PostProcessor + p.config.Username = "me" + p.config.Password = "notpassword" + p.config.Host = "myhost" + p.config.Datacenter = "mydc" + p.config.VMName = "my vm" + p.config.Insecure = true + + if err := p.configureURL(); err == nil { + t.Errorf("Error: %s", err) + } +}