mirror of https://github.com/hashicorp/packer
Fix ReregisterVM to default to true instead of false. (#9736)
parent
b72a75278a
commit
daccfc42cf
@ -0,0 +1,39 @@
|
||||
package vsphere_template
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func getTestConfig() Config {
|
||||
return Config{
|
||||
Username: "me",
|
||||
Password: "notpassword",
|
||||
Host: "myhost",
|
||||
}
|
||||
}
|
||||
|
||||
func TestConfigure_Good(t *testing.T) {
|
||||
var p PostProcessor
|
||||
|
||||
config := getTestConfig()
|
||||
|
||||
err := p.Configure(config)
|
||||
if err != nil {
|
||||
t.Errorf("Error: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestConfigure_ReRegisterVM(t *testing.T) {
|
||||
var p PostProcessor
|
||||
|
||||
config := getTestConfig()
|
||||
|
||||
err := p.Configure(config)
|
||||
if err != nil {
|
||||
t.Errorf("Error: %s", err)
|
||||
}
|
||||
|
||||
if p.config.ReregisterVM.False() {
|
||||
t.Errorf("This should default to unset, not false.")
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue