mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
Add TestZone()
This commit is contained in:
parent
5c44fd871f
commit
af5084ea75
@ -315,17 +315,21 @@ func TestVSphereLoginWithCaCert(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestZones(t *testing.T) {
|
func TestZones(t *testing.T) {
|
||||||
cfg := VSphereConfig{}
|
|
||||||
cfg.Global.Datacenter = "myDatacenter"
|
|
||||||
|
|
||||||
// Create vSphere configuration object
|
// Create vSphere configuration object
|
||||||
|
cfg, ok := configFromEnv()
|
||||||
vs := VSphere{
|
vs := VSphere{
|
||||||
cfg: &cfg,
|
cfg: &cfg,
|
||||||
}
|
}
|
||||||
|
if !ok {
|
||||||
_, ok := vs.Zones()
|
t.Skipf("No config found in environment")
|
||||||
if ok {
|
}
|
||||||
t.Fatalf("Zones() returned true")
|
_, err := vs.GetZone(context.TODO())
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("GetZone() failed: %s", err)
|
||||||
|
}
|
||||||
|
_, ok = vs.Zones()
|
||||||
|
if !ok {
|
||||||
|
t.Fatalf("Zones() returned false")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user