github.phpd.cn/hashicorp/packer@v1.3.2/builder/virtualbox/common/export_config_test.go (about) 1 package common 2 3 import ( 4 "testing" 5 ) 6 7 func TestExportConfigPrepare_BootWait(t *testing.T) { 8 var c *ExportConfig 9 var errs []error 10 11 // Bad 12 c = new(ExportConfig) 13 c.Format = "illegal" 14 errs = c.Prepare(testConfigTemplate(t)) 15 if len(errs) == 0 { 16 t.Fatalf("bad: %#v", errs) 17 } 18 19 // Good 20 c = new(ExportConfig) 21 c.Format = "ova" 22 errs = c.Prepare(testConfigTemplate(t)) 23 if len(errs) > 0 { 24 t.Fatalf("should not have error: %s", errs) 25 } 26 27 // Good 28 c = new(ExportConfig) 29 c.Format = "ovf" 30 errs = c.Prepare(testConfigTemplate(t)) 31 if len(errs) > 0 { 32 t.Fatalf("should not have error: %s", errs) 33 } 34 }