Fix tests
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
This commit is contained in:
parent
8ef30c26e4
commit
dac47c649b
@ -4,21 +4,20 @@ import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/packer-plugin-sdk/packer"
|
||||
"github.com/hashicorp/packer-plugin-sdk/common"
|
||||
"github.com/hashicorp/packer-plugin-sdk/packer"
|
||||
)
|
||||
|
||||
|
||||
func testConfig() map[string]interface{} {
|
||||
return map[string]interface{}{
|
||||
"remote_host": "localhost",
|
||||
"remote_username": "admin",
|
||||
"remote_password": "admin",
|
||||
"vm_name": "foo",
|
||||
"iso_checksum": "md5:A221725EE181A44C67E25BD6A2516742",
|
||||
"iso_url": "http://www.google.com/",
|
||||
"shutdown_command": "yes",
|
||||
"ssh_username": "foo",
|
||||
"remote_host": "localhost",
|
||||
"remote_username": "admin",
|
||||
"remote_password": "admin",
|
||||
"vm_name": "foo",
|
||||
"iso_checksum": "md5:A221725EE181A44C67E25BD6A2516742",
|
||||
"iso_url": "http://www.google.com/",
|
||||
"shutdown_command": "yes",
|
||||
"ssh_username": "foo",
|
||||
|
||||
common.BuildNameConfigKey: "foo",
|
||||
}
|
||||
@ -43,7 +42,7 @@ func TestBuilderPrepare_Defaults(t *testing.T) {
|
||||
t.Fatalf("should not have error: %s", err)
|
||||
}
|
||||
|
||||
if b.config.ToolsIsoName != "xs-tools.iso" {
|
||||
if b.config.ToolsIsoName != "" {
|
||||
t.Errorf("bad tools ISO name: %s", b.config.ToolsIsoName)
|
||||
}
|
||||
|
||||
@ -201,10 +200,8 @@ func TestBuilderPrepare_ISOChecksum(t *testing.T) {
|
||||
t.Fatal("should have error")
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
func TestBuilderPrepare_ISOUrl(t *testing.T) {
|
||||
var b Builder
|
||||
config := testConfig()
|
||||
|
@ -3,8 +3,8 @@ package xva
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/packer-plugin-sdk/packer"
|
||||
"github.com/hashicorp/packer-plugin-sdk/common"
|
||||
"github.com/hashicorp/packer-plugin-sdk/packer"
|
||||
)
|
||||
|
||||
func testConfig() map[string]interface{} {
|
||||
@ -40,7 +40,7 @@ func TestBuilderPrepare_Defaults(t *testing.T) {
|
||||
t.Fatalf("should not have error: %s", err)
|
||||
}
|
||||
|
||||
if b.config.ToolsIsoName != "xs-tools.iso" {
|
||||
if b.config.ToolsIsoName != "" {
|
||||
t.Errorf("bad tools ISO name: %s", b.config.ToolsIsoName)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user