2017-10-25 18:07:25 -04:00
|
|
|
package testing
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestHostAcc(t *testing.T) {
|
|
|
|
initDriverAcceptanceTest(t)
|
2017-11-08 11:47:29 -05:00
|
|
|
hostName := "esxi-1.vsphere55.test"
|
2017-10-25 18:07:25 -04:00
|
|
|
|
|
|
|
d := NewTestDriver(t)
|
2017-11-08 11:47:29 -05:00
|
|
|
host, err := d.FindHost(hostName)
|
2017-10-25 18:07:25 -04:00
|
|
|
if err != nil {
|
2017-11-08 11:47:29 -05:00
|
|
|
t.Fatalf("Cannot find the default host '%v': %v", "datastore1", err)
|
2017-10-25 18:07:25 -04:00
|
|
|
}
|
|
|
|
switch info, err := host.Info("name"); {
|
|
|
|
case err != nil:
|
2017-10-26 12:15:54 -04:00
|
|
|
t.Errorf("Cannot read host properties: %v", err)
|
2017-11-08 11:47:29 -05:00
|
|
|
case info.Name != hostName:
|
|
|
|
t.Errorf("Wrong host name: expected '%v', got: '%v'", hostName, info.Name)
|
2017-10-25 18:07:25 -04:00
|
|
|
}
|
|
|
|
}
|