Add a test for verifying compute basepath.

Compute API changes could modify this, we need a test to detect if it happens.
This commit is contained in:
Pavithra Ramesh 2021-05-27 12:06:40 -07:00
parent e8760b95bb
commit 816a069d54

View File

@ -178,3 +178,15 @@ func TestEnsureLoadBalancerDeletedDeletesInternalLb(t *testing.T) {
assert.NoError(t, err)
assertInternalLbResourcesDeleted(t, gce, apiService, vals, true)
}
func TestBasePath(t *testing.T) {
t.Parallel()
vals := DefaultTestClusterValues()
gce, err := fakeGCECloud(vals)
// Loadbalancer controller code expects basepath to contain the projects string.
expectBasePath := "https://compute.googleapis.com/compute/v1/projects/"
require.NoError(t, err)
if gce.service.BasePath != expectBasePath {
t.Errorf("Compute basePath has changed. Got %q, want %q", gce.service.BasePath, expectBasePath)
}
}