Simplify datastore test

This commit is contained in:
Andrey Tonkikh 2017-10-26 00:38:33 +03:00
parent d154a0ff32
commit dc5a2e52cd
1 changed files with 5 additions and 17 deletions

View File

@ -2,29 +2,17 @@ package testing
import (
"testing"
"github.com/vmware/govmomi/vim25/mo"
"github.com/jetbrains-infra/packer-builder-vsphere/driver"
)
var infoParams = [][]string {
//{}, // FIXME: Doesn't work
//{"*"}, // FIXME: Doesn't work
{"host", "vm"}, // TODO: choose something more meaningful
}
func TestDatastore(t *testing.T) {
func TestDatastoreAcc(t *testing.T) {
initDriverAcceptanceTest(t)
d := NewTestDriver(t)
ds, err := d.FindDatastore(DefaultDatastore)
if err != nil {
t.Fatalf("`FindDatatore` can't find default datastore '%v'. Error: %v",
DefaultDatastore, err)
t.Fatalf("Cannot find default datastore '%v': %v", DefaultDatastore, err)
}
for _, params := range infoParams {
_, err := ds.Info(params...)
if err != nil {
t.Errorf("Cannot read datastore properties with parameters %v: %v",
params, err)
}
}
// TODO: add more checks
CheckDatastoreName(t, ds, DefaultDatastore)
}