From 3cb2185c53e6558b17c44627d2957f31f04de641 Mon Sep 17 00:00:00 2001 From: Andrey Tonkikh Date: Thu, 26 Oct 2017 01:07:25 +0300 Subject: [PATCH] Add an acceptance test for `driver.Host` --- driver/testing/host_acc_test.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 driver/testing/host_acc_test.go diff --git a/driver/testing/host_acc_test.go b/driver/testing/host_acc_test.go new file mode 100644 index 000000000..247d3cdf6 --- /dev/null +++ b/driver/testing/host_acc_test.go @@ -0,0 +1,21 @@ +package testing + +import ( + "testing" +) + +func TestHostAcc(t *testing.T) { + initDriverAcceptanceTest(t) + + d := NewTestDriver(t) + host, err := d.FindHost(TestHost) + if err != nil { + t.Fatalf("Cannot find the default datastore '%v': %v", TestDatastore, err) + } + switch info, err := host.Info("name"); { + case err != nil: + t.Errorf("Cannot read datastore properties: %v", err) + case info.Name != TestHost: + t.Errorf("Wrong datastore. expected: %v, got: %v", TestHost, info.Name) + } +}