mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-15 06:43:54 +00:00
Skip TestRoutes when there are no vm(s)
TestRoutes assumes that there is at least one vm in the OpenStack it is connecting to. So let's limit this test to run properly only when we are running in a VM or one was created already outside of the test harness
This commit is contained in:
parent
b5387effe8
commit
18f1486e97
@ -40,9 +40,17 @@ func TestRoutes(t *testing.T) {
|
|||||||
t.Fatalf("Failed to construct/authenticate OpenStack: %s", err)
|
t.Fatalf("Failed to construct/authenticate OpenStack: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vms := getServers(os)
|
||||||
|
_, err = os.InstanceID()
|
||||||
|
if err != nil || len(vms) == 0 {
|
||||||
|
t.Skipf("Please run this test in an OpenStack vm or create at least one VM in OpenStack before you run this test.")
|
||||||
|
}
|
||||||
|
|
||||||
|
// We know we have at least one vm.
|
||||||
|
servername := vms[0].Name
|
||||||
|
|
||||||
// Pick the first router and server to try a test with
|
// Pick the first router and server to try a test with
|
||||||
os.routeOpts.RouterID = getRouters(os)[0].ID
|
os.routeOpts.RouterID = getRouters(os)[0].ID
|
||||||
servername := getServers(os)[0].Name
|
|
||||||
|
|
||||||
r, ok := os.Routes()
|
r, ok := os.Routes()
|
||||||
if !ok {
|
if !ok {
|
||||||
|
Loading…
Reference in New Issue
Block a user