packer-cn/driver/host_acc_test.go

24 lines
477 B
Go
Raw Normal View History

package driver
import (
"testing"
)
func TestHostAcc(t *testing.T) {
initDriverAcceptanceTest(t)
d := newTestDriver(t)
host, err := d.FindHost(TestHostName)
if err != nil {
2017-11-08 11:47:29 -05:00
t.Fatalf("Cannot find the default host '%v': %v", "datastore1", err)
}
info, err := host.Info("name")
if err != nil {
t.Fatalf("Cannot read host properties: %v", err)
}
if info.Name != TestHostName {
t.Errorf("Wrong host name: expected '%v', got: '%v'", TestHostName, info.Name)
}
}