2013-06-11 18:12:45 -04:00
|
|
|
package virtualbox
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/mitchellh/packer/packer"
|
2013-06-11 23:00:30 -04:00
|
|
|
"io/ioutil"
|
|
|
|
"os"
|
2013-06-23 23:58:22 -04:00
|
|
|
"reflect"
|
2013-06-11 18:12:45 -04:00
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func testConfig() map[string]interface{} {
|
2013-06-11 23:00:30 -04:00
|
|
|
return map[string]interface{}{
|
2013-06-12 03:54:25 -04:00
|
|
|
"iso_md5": "foo",
|
|
|
|
"iso_url": "http://www.google.com/",
|
2013-06-12 03:41:58 -04:00
|
|
|
"ssh_username": "foo",
|
2013-07-01 14:11:31 -04:00
|
|
|
|
|
|
|
packer.BuildNameConfigKey: "foo",
|
2013-06-11 23:00:30 -04:00
|
|
|
}
|
2013-06-11 18:12:45 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestBuilder_ImplementsBuilder(t *testing.T) {
|
|
|
|
var raw interface{}
|
|
|
|
raw = &Builder{}
|
|
|
|
if _, ok := raw.(packer.Builder); !ok {
|
|
|
|
t.Error("Builder must implement builder.")
|
|
|
|
}
|
|
|
|
}
|
2013-06-11 18:57:20 -04:00
|
|
|
|
|
|
|
func TestBuilderPrepare_Defaults(t *testing.T) {
|
|
|
|
var b Builder
|
|
|
|
config := testConfig()
|
|
|
|
err := b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("should not have error: %s", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if b.config.GuestOSType != "Other" {
|
|
|
|
t.Errorf("bad guest OS type: %s", b.config.GuestOSType)
|
|
|
|
}
|
|
|
|
|
2013-07-01 14:11:31 -04:00
|
|
|
if b.config.OutputDir != "output-foo" {
|
2013-06-11 18:57:20 -04:00
|
|
|
t.Errorf("bad output dir: %s", b.config.OutputDir)
|
|
|
|
}
|
2013-06-11 19:12:19 -04:00
|
|
|
|
2013-06-11 23:29:39 -04:00
|
|
|
if b.config.SSHHostPortMin != 2222 {
|
|
|
|
t.Errorf("bad min ssh host port: %d", b.config.SSHHostPortMin)
|
|
|
|
}
|
|
|
|
|
|
|
|
if b.config.SSHHostPortMax != 4444 {
|
|
|
|
t.Errorf("bad max ssh host port: %d", b.config.SSHHostPortMax)
|
|
|
|
}
|
|
|
|
|
|
|
|
if b.config.SSHPort != 22 {
|
|
|
|
t.Errorf("bad ssh port: %d", b.config.SSHPort)
|
|
|
|
}
|
|
|
|
|
2013-07-01 14:11:31 -04:00
|
|
|
if b.config.VMName != "packer-foo" {
|
2013-06-11 19:12:19 -04:00
|
|
|
t.Errorf("bad vm name: %s", b.config.VMName)
|
|
|
|
}
|
2013-06-11 18:57:20 -04:00
|
|
|
}
|
2013-06-11 23:00:30 -04:00
|
|
|
|
2013-06-11 23:56:44 -04:00
|
|
|
func TestBuilderPrepare_BootWait(t *testing.T) {
|
|
|
|
var b Builder
|
|
|
|
config := testConfig()
|
|
|
|
|
2013-06-28 15:58:32 -04:00
|
|
|
// Test a default boot_wait
|
|
|
|
delete(config, "boot_wait")
|
|
|
|
err := b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("err: %s", err)
|
|
|
|
}
|
|
|
|
|
2013-06-28 16:00:42 -04:00
|
|
|
if b.config.RawBootWait != "10s" {
|
|
|
|
t.Fatalf("bad value: %s", b.config.RawBootWait)
|
|
|
|
}
|
|
|
|
|
2013-06-11 23:56:44 -04:00
|
|
|
// Test with a bad boot_wait
|
|
|
|
config["boot_wait"] = "this is not good"
|
2013-06-28 15:58:32 -04:00
|
|
|
err = b.Prepare(config)
|
2013-06-11 23:56:44 -04:00
|
|
|
if err == nil {
|
|
|
|
t.Fatal("should have error")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Test with a good one
|
|
|
|
config["boot_wait"] = "5s"
|
|
|
|
err = b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("should not have error: %s", err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-06-23 23:43:40 -04:00
|
|
|
func TestBuilderPrepare_DiskSize(t *testing.T) {
|
|
|
|
var b Builder
|
|
|
|
config := testConfig()
|
|
|
|
|
|
|
|
delete(config, "disk_size")
|
|
|
|
err := b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("bad err: %s", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if b.config.DiskSize != 40000 {
|
|
|
|
t.Fatalf("bad size: %d", b.config.DiskSize)
|
|
|
|
}
|
|
|
|
|
|
|
|
config["disk_size"] = 60000
|
|
|
|
b = Builder{}
|
|
|
|
err = b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("should not have error: %s", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if b.config.DiskSize != 60000 {
|
|
|
|
t.Fatalf("bad size: %s", b.config.DiskSize)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-09 15:29:40 -04:00
|
|
|
func TestBuilderPrepare_FloppyFiles(t *testing.T) {
|
|
|
|
var b Builder
|
|
|
|
config := testConfig()
|
|
|
|
|
|
|
|
delete(config, "floppy_files")
|
|
|
|
err := b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("bad err: %s", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(b.config.FloppyFiles) != 0 {
|
|
|
|
t.Fatalf("bad: %#v", b.config.FloppyFiles)
|
|
|
|
}
|
|
|
|
|
|
|
|
config["floppy_files"] = []string{"foo", "bar"}
|
|
|
|
b = Builder{}
|
|
|
|
err = b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("should not have error: %s", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
expected := []string{"foo", "bar"}
|
|
|
|
if !reflect.DeepEqual(b.config.FloppyFiles, expected) {
|
|
|
|
t.Fatalf("bad: %#v", b.config.FloppyFiles)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-06-24 02:05:32 -04:00
|
|
|
func TestBuilderPrepare_GuestAdditionsPath(t *testing.T) {
|
|
|
|
var b Builder
|
|
|
|
config := testConfig()
|
|
|
|
|
2013-07-07 12:09:22 -04:00
|
|
|
delete(config, "guest_additions_path")
|
2013-06-24 02:05:32 -04:00
|
|
|
err := b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("bad err: %s", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if b.config.GuestAdditionsPath != "VBoxGuestAdditions.iso" {
|
|
|
|
t.Fatalf("bad: %s", b.config.GuestAdditionsPath)
|
|
|
|
}
|
|
|
|
|
|
|
|
config["guest_additions_path"] = "foo"
|
|
|
|
b = Builder{}
|
|
|
|
err = b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("should not have error: %s", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if b.config.GuestAdditionsPath != "foo" {
|
|
|
|
t.Fatalf("bad size: %s", b.config.GuestAdditionsPath)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-07 12:14:16 -04:00
|
|
|
func TestBuilderPrepare_GuestAdditionsSHA256(t *testing.T) {
|
|
|
|
var b Builder
|
|
|
|
config := testConfig()
|
|
|
|
|
|
|
|
delete(config, "guest_additions_sha256")
|
|
|
|
err := b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("bad err: %s", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if b.config.GuestAdditionsSHA256 != "" {
|
|
|
|
t.Fatalf("bad: %s", b.config.GuestAdditionsSHA256)
|
|
|
|
}
|
|
|
|
|
|
|
|
config["guest_additions_sha256"] = "FOO"
|
|
|
|
b = Builder{}
|
|
|
|
err = b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("should not have error: %s", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if b.config.GuestAdditionsSHA256 != "foo" {
|
|
|
|
t.Fatalf("bad size: %s", b.config.GuestAdditionsSHA256)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestBuilderPrepare_GuestAdditionsURL(t *testing.T) {
|
|
|
|
var b Builder
|
|
|
|
config := testConfig()
|
|
|
|
|
|
|
|
config["guest_additions_url"] = ""
|
|
|
|
err := b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("err: %s", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if b.config.GuestAdditionsURL != "" {
|
|
|
|
t.Fatalf("should be empty: %s", b.config.GuestAdditionsURL)
|
|
|
|
}
|
|
|
|
|
|
|
|
config["guest_additions_url"] = "i/am/a/file/that/doesnt/exist"
|
|
|
|
err = b.Prepare(config)
|
|
|
|
if err == nil {
|
|
|
|
t.Error("should have error")
|
|
|
|
}
|
|
|
|
|
|
|
|
config["guest_additions_url"] = "file:i/am/a/file/that/doesnt/exist"
|
|
|
|
err = b.Prepare(config)
|
|
|
|
if err == nil {
|
|
|
|
t.Error("should have error")
|
|
|
|
}
|
|
|
|
|
|
|
|
config["guest_additions_url"] = "http://www.packer.io"
|
|
|
|
err = b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Errorf("should not have error: %s", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
tf, err := ioutil.TempFile("", "packer")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("error tempfile: %s", err)
|
|
|
|
}
|
|
|
|
defer os.Remove(tf.Name())
|
|
|
|
|
|
|
|
config["guest_additions_url"] = tf.Name()
|
|
|
|
err = b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("should not have error: %s", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if b.config.GuestAdditionsURL != "file://"+tf.Name() {
|
|
|
|
t.Fatalf("guest_additions_url should be modified: %s", b.config.GuestAdditionsURL)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-06-12 02:44:40 -04:00
|
|
|
func TestBuilderPrepare_HTTPPort(t *testing.T) {
|
|
|
|
var b Builder
|
|
|
|
config := testConfig()
|
|
|
|
|
|
|
|
// Bad
|
|
|
|
config["http_port_min"] = 1000
|
|
|
|
config["http_port_max"] = 500
|
|
|
|
err := b.Prepare(config)
|
|
|
|
if err == nil {
|
|
|
|
t.Fatal("should have error")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Bad
|
|
|
|
config["http_port_min"] = -500
|
|
|
|
err = b.Prepare(config)
|
|
|
|
if err == nil {
|
|
|
|
t.Fatal("should have error")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Good
|
|
|
|
config["http_port_min"] = 500
|
|
|
|
config["http_port_max"] = 1000
|
|
|
|
err = b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("should not have error: %s", err)
|
|
|
|
}
|
2013-07-13 20:28:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestBuilderPrepare_InvalidKey(t *testing.T) {
|
|
|
|
var b Builder
|
|
|
|
config := testConfig()
|
|
|
|
|
|
|
|
// Add a random key
|
|
|
|
config["i_should_not_be_valid"] = true
|
|
|
|
err := b.Prepare(config)
|
|
|
|
if err == nil {
|
|
|
|
t.Fatal("should have error")
|
|
|
|
}
|
2013-06-12 02:44:40 -04:00
|
|
|
}
|
|
|
|
|
2013-06-11 23:00:30 -04:00
|
|
|
func TestBuilderPrepare_ISOMD5(t *testing.T) {
|
|
|
|
var b Builder
|
|
|
|
config := testConfig()
|
|
|
|
|
|
|
|
// Test bad
|
|
|
|
config["iso_md5"] = ""
|
|
|
|
err := b.Prepare(config)
|
|
|
|
if err == nil {
|
|
|
|
t.Fatal("should have error")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Test good
|
|
|
|
config["iso_md5"] = "FOo"
|
|
|
|
err = b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("should not have error: %s", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if b.config.ISOMD5 != "foo" {
|
|
|
|
t.Fatalf("should've lowercased: %s", b.config.ISOMD5)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestBuilderPrepare_ISOUrl(t *testing.T) {
|
|
|
|
var b Builder
|
|
|
|
config := testConfig()
|
|
|
|
|
|
|
|
config["iso_url"] = ""
|
|
|
|
err := b.Prepare(config)
|
|
|
|
if err == nil {
|
|
|
|
t.Fatal("should have error")
|
|
|
|
}
|
|
|
|
|
|
|
|
config["iso_url"] = "i/am/a/file/that/doesnt/exist"
|
|
|
|
err = b.Prepare(config)
|
|
|
|
if err == nil {
|
|
|
|
t.Error("should have error")
|
|
|
|
}
|
|
|
|
|
|
|
|
config["iso_url"] = "file:i/am/a/file/that/doesnt/exist"
|
|
|
|
err = b.Prepare(config)
|
|
|
|
if err == nil {
|
|
|
|
t.Error("should have error")
|
|
|
|
}
|
|
|
|
|
|
|
|
config["iso_url"] = "http://www.packer.io"
|
|
|
|
err = b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Errorf("should not have error: %s", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
tf, err := ioutil.TempFile("", "packer")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("error tempfile: %s", err)
|
|
|
|
}
|
|
|
|
defer os.Remove(tf.Name())
|
|
|
|
|
|
|
|
config["iso_url"] = tf.Name()
|
|
|
|
err = b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("should not have error: %s", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if b.config.ISOUrl != "file://"+tf.Name() {
|
|
|
|
t.Fatalf("iso_url should be modified: %s", b.config.ISOUrl)
|
|
|
|
}
|
|
|
|
}
|
2013-06-11 23:51:58 -04:00
|
|
|
|
2013-06-27 22:14:23 -04:00
|
|
|
func TestBuilderPrepare_OutputDir(t *testing.T) {
|
|
|
|
var b Builder
|
|
|
|
config := testConfig()
|
|
|
|
|
|
|
|
// Test with existing dir
|
|
|
|
dir, err := ioutil.TempDir("", "packer")
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("err: %s", err)
|
|
|
|
}
|
|
|
|
defer os.RemoveAll(dir)
|
|
|
|
|
|
|
|
config["output_directory"] = dir
|
|
|
|
err = b.Prepare(config)
|
|
|
|
if err == nil {
|
|
|
|
t.Fatal("should have error")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Test with a good one
|
|
|
|
config["output_directory"] = "i-hope-i-dont-exist"
|
|
|
|
err = b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("should not have error: %s", err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-06-12 21:02:42 -04:00
|
|
|
func TestBuilderPrepare_ShutdownTimeout(t *testing.T) {
|
|
|
|
var b Builder
|
|
|
|
config := testConfig()
|
|
|
|
|
|
|
|
// Test with a bad value
|
|
|
|
config["shutdown_timeout"] = "this is not good"
|
|
|
|
err := b.Prepare(config)
|
|
|
|
if err == nil {
|
|
|
|
t.Fatal("should have error")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Test with a good one
|
|
|
|
config["shutdown_timeout"] = "5s"
|
|
|
|
err = b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("should not have error: %s", err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-06-11 23:51:58 -04:00
|
|
|
func TestBuilderPrepare_SSHHostPort(t *testing.T) {
|
|
|
|
var b Builder
|
|
|
|
config := testConfig()
|
|
|
|
|
|
|
|
// Bad
|
|
|
|
config["ssh_host_port_min"] = 1000
|
|
|
|
config["ssh_host_port_max"] = 500
|
|
|
|
err := b.Prepare(config)
|
|
|
|
if err == nil {
|
|
|
|
t.Fatal("should have error")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Bad
|
|
|
|
config["ssh_host_port_min"] = -500
|
|
|
|
err = b.Prepare(config)
|
|
|
|
if err == nil {
|
|
|
|
t.Fatal("should have error")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Good
|
|
|
|
config["ssh_host_port_min"] = 500
|
|
|
|
config["ssh_host_port_max"] = 1000
|
|
|
|
err = b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("should not have error: %s", err)
|
|
|
|
}
|
|
|
|
}
|
2013-06-12 03:41:58 -04:00
|
|
|
|
|
|
|
func TestBuilderPrepare_SSHUser(t *testing.T) {
|
|
|
|
var b Builder
|
|
|
|
config := testConfig()
|
|
|
|
|
|
|
|
config["ssh_username"] = ""
|
|
|
|
err := b.Prepare(config)
|
|
|
|
if err == nil {
|
|
|
|
t.Fatal("should have error")
|
|
|
|
}
|
|
|
|
|
|
|
|
config["ssh_username"] = "exists"
|
|
|
|
err = b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("should not have error: %s", err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestBuilderPrepare_SSHWaitTimeout(t *testing.T) {
|
|
|
|
var b Builder
|
|
|
|
config := testConfig()
|
|
|
|
|
2013-06-28 16:00:42 -04:00
|
|
|
// Test a default boot_wait
|
|
|
|
delete(config, "ssh_wait_timeout")
|
|
|
|
err := b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("err: %s", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if b.config.RawSSHWaitTimeout != "20m" {
|
|
|
|
t.Fatalf("bad value: %s", b.config.RawSSHWaitTimeout)
|
|
|
|
}
|
|
|
|
|
2013-06-12 03:41:58 -04:00
|
|
|
// Test with a bad value
|
|
|
|
config["ssh_wait_timeout"] = "this is not good"
|
2013-06-28 16:00:42 -04:00
|
|
|
err = b.Prepare(config)
|
2013-06-12 03:41:58 -04:00
|
|
|
if err == nil {
|
|
|
|
t.Fatal("should have error")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Test with a good one
|
|
|
|
config["ssh_wait_timeout"] = "5s"
|
|
|
|
err = b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("should not have error: %s", err)
|
|
|
|
}
|
|
|
|
}
|
2013-06-23 23:58:22 -04:00
|
|
|
|
|
|
|
func TestBuilderPrepare_VBoxManage(t *testing.T) {
|
|
|
|
var b Builder
|
|
|
|
config := testConfig()
|
|
|
|
|
|
|
|
// Test with empty
|
|
|
|
delete(config, "vboxmanage")
|
|
|
|
err := b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("err: %s", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if !reflect.DeepEqual(b.config.VBoxManage, [][]string{}) {
|
|
|
|
t.Fatalf("bad: %#v", b.config.VBoxManage)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Test with a good one
|
|
|
|
config["vboxmanage"] = [][]interface{}{
|
|
|
|
[]interface{}{"foo", "bar", "baz"},
|
|
|
|
}
|
|
|
|
|
|
|
|
b = Builder{}
|
|
|
|
err = b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("should not have error: %s", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
expected := [][]string{
|
|
|
|
[]string{"foo", "bar", "baz"},
|
|
|
|
}
|
|
|
|
|
|
|
|
if !reflect.DeepEqual(b.config.VBoxManage, expected) {
|
|
|
|
t.Fatalf("bad: %#v", b.config.VBoxManage)
|
|
|
|
}
|
|
|
|
}
|
2013-06-24 01:44:58 -04:00
|
|
|
|
|
|
|
func TestBuilderPrepare_VBoxVersionFile(t *testing.T) {
|
|
|
|
var b Builder
|
|
|
|
config := testConfig()
|
|
|
|
|
|
|
|
// Test empty
|
|
|
|
delete(config, "virtualbox_version_file")
|
|
|
|
err := b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("err: %s", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if b.config.VBoxVersionFile != ".vbox_version" {
|
|
|
|
t.Fatalf("bad value: %s", b.config.VBoxVersionFile)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Test with a good one
|
|
|
|
config["virtualbox_version_file"] = "foo"
|
|
|
|
b = Builder{}
|
|
|
|
err = b.Prepare(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("should not have error: %s", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if b.config.VBoxVersionFile != "foo" {
|
|
|
|
t.Fatalf("bad value: %s", b.config.VBoxVersionFile)
|
|
|
|
}
|
|
|
|
}
|