github.phpd.cn/hashicorp/packer@v1.3.2/builder/vmware/common/step_configure_vnc_test.go (about) 1 package common 2 3 import ( 4 "fmt" 5 "testing" 6 ) 7 8 func TestStepConfigureVNC_implVNCAddressFinder(t *testing.T) { 9 var _ VNCAddressFinder = new(StepConfigureVNC) 10 } 11 12 func TestStepConfigureVNC_UpdateVMX(t *testing.T) { 13 var s StepConfigureVNC 14 data := make(map[string]string) 15 s.UpdateVMX("0.0.0.0", "", 5900, data) 16 if ip := data["remotedisplay.vnc.ip"]; ip != "0.0.0.0" { 17 t.Errorf("bad VMX data for key remotedisplay.vnc.ip: %v", ip) 18 } 19 if enabled := data["remotedisplay.vnc.enabled"]; enabled != "TRUE" { 20 t.Errorf("bad VMX data for key remotedisplay.vnc.enabled: %v", enabled) 21 } 22 if port := data["remotedisplay.vnc.port"]; port != fmt.Sprint(port) { 23 t.Errorf("bad VMX data for key remotedisplay.vnc.port: %v", port) 24 } 25 }