@@ -8,16 +8,17 @@ package vcdsdk
8
8
import (
9
9
"context"
10
10
"fmt"
11
+ "io/ioutil"
12
+ "path/filepath"
13
+ "testing"
14
+ "time"
15
+
11
16
"github.com/google/uuid"
12
17
"github.com/stretchr/testify/assert"
13
18
"github.com/stretchr/testify/require"
14
19
"github.com/vmware/cloud-provider-for-cloud-director/pkg/util"
15
20
swaggerClient "github.com/vmware/cloud-provider-for-cloud-director/pkg/vcdswaggerclient_36_0"
16
21
"gopkg.in/yaml.v2"
17
- "io/ioutil"
18
- "path/filepath"
19
- "testing"
20
- "time"
21
22
)
22
23
23
24
const BusyRetries = 5
@@ -332,7 +333,7 @@ func TestVirtualServiceHttpCRUDE(t *testing.T) {
332
333
var vsRef * swaggerClient.EntityReference
333
334
for i := 0 ; i < BusyRetries ; i ++ {
334
335
vsRef , err = gm .CreateVirtualService (ctx , virtualServiceName , lbPoolRef , segRef ,
335
- internalIP , "HTTP" , 80 , false , "" )
336
+ internalIP , "HTTP" , 80 , false , "" , "" )
336
337
if err != nil {
337
338
if _ , ok := err .(* VirtualServicePendingError ); ! ok {
338
339
break
@@ -353,7 +354,7 @@ func TestVirtualServiceHttpCRUDE(t *testing.T) {
353
354
// repeated creation should not fail
354
355
for i := 0 ; i < BusyRetries ; i ++ {
355
356
vsRef , err = gm .CreateVirtualService (ctx , virtualServiceName , lbPoolRef , segRef ,
356
- internalIP , "HTTP" , 80 , false , "" )
357
+ internalIP , "HTTP" , 80 , false , "" , "" )
357
358
if err != nil {
358
359
if _ , ok := err .(* VirtualServicePendingError ); ! ok {
359
360
break
@@ -436,7 +437,7 @@ func TestVirtualServiceHttpsCRUDE(t *testing.T) {
436
437
var vsRef * swaggerClient.EntityReference
437
438
for i := 0 ; i < BusyRetries ; i ++ {
438
439
vsRef , err = gm .CreateVirtualService (ctx , virtualServiceName , lbPoolRef , segRef ,
439
- internalIP , "HTTP" , 80 , false , "" )
440
+ internalIP , "HTTP" , 80 , false , "" , "" )
440
441
if err != nil {
441
442
if _ , ok := err .(* VirtualServicePendingError ); ! ok {
442
443
break
@@ -455,7 +456,7 @@ func TestVirtualServiceHttpsCRUDE(t *testing.T) {
455
456
456
457
// repeated creation should not fail
457
458
vsRef , err = gm .CreateVirtualService (ctx , virtualServiceName , lbPoolRef , segRef ,
458
- internalIP , "HTTPS" , 443 , true , certName )
459
+ internalIP , "HTTPS" , 443 , true , certName , "" )
459
460
assert .NoError (t , err , "Unable to create virtual service for the second time" )
460
461
require .NotNil (t , vsRef , "VirtualServiceRef should not be nil" )
461
462
assert .Equal (t , virtualServiceName , vsRef .Name , "Virtual Service name should match" )
@@ -548,7 +549,7 @@ func TestLoadBalancerCRUDE(t *testing.T) {
548
549
EndIP : "192.168.8.100" ,
549
550
}
550
551
freeIP , err = gm .CreateLoadBalancer (ctx , virtualServiceNamePrefix ,
551
- lbPoolNamePrefix , []string {"1.2.3.4" , "1.2.3.5" }, portDetailsList , oneArm , false , nil , "" , & util.AllocatedResourcesMap {})
552
+ lbPoolNamePrefix , []string {"1.2.3.4" , "1.2.3.5" }, portDetailsList , oneArm , false , nil , "" , & util.AllocatedResourcesMap {}, "" )
552
553
assert .NoError (t , err , "Load Balancer should be created" )
553
554
assert .NotEmpty (t , freeIP , "There should be a non-empty IP returned" )
554
555
@@ -567,7 +568,7 @@ func TestLoadBalancerCRUDE(t *testing.T) {
567
568
assert .Equal (t , freeIP , freeIPObtained , "The IPs should match" )
568
569
569
570
freeIP , err = gm .CreateLoadBalancer (ctx , virtualServiceNamePrefix ,
570
- lbPoolNamePrefix , []string {"1.2.3.4" , "1.2.3.5" }, portDetailsList , oneArm , false , nil , "" , & util.AllocatedResourcesMap {})
571
+ lbPoolNamePrefix , []string {"1.2.3.4" , "1.2.3.5" }, portDetailsList , oneArm , false , nil , "" , & util.AllocatedResourcesMap {}, "" )
571
572
assert .NoError (t , err , "Load Balancer should be created even on second attempt" )
572
573
assert .NotEmpty (t , freeIP , "There should be a non-empty IP returned" )
573
574
@@ -675,7 +676,7 @@ func TestLoadBalancer_ExplicitLBIP_OneArmDisabled_CRUDE(t *testing.T) {
675
676
676
677
var oneArm * OneArm
677
678
freeIP , err = gm .CreateLoadBalancer (ctx , virtualServiceNamePrefix ,
678
- lbPoolNamePrefix , []string {"1.2.3.4" , "1.2.3.5" }, portDetailsList , oneArm , true , nil , testConfig .FreeLoadBalancerIP , & util.AllocatedResourcesMap {})
679
+ lbPoolNamePrefix , []string {"1.2.3.4" , "1.2.3.5" }, portDetailsList , oneArm , true , nil , testConfig .FreeLoadBalancerIP , & util.AllocatedResourcesMap {}, "" )
679
680
assert .NoError (t , err , "Load Balancer should be created" )
680
681
assert .NotEmpty (t , freeIP , "There should be a non-empty IP returned" )
681
682
assert .Equal (t , freeIP , testConfig .FreeLoadBalancerIP , "the provided external IP address should be the same as the load balancer IP address." )
@@ -695,7 +696,7 @@ func TestLoadBalancer_ExplicitLBIP_OneArmDisabled_CRUDE(t *testing.T) {
695
696
assert .Equal (t , freeIP , freeIPObtained , "The IPs should match" )
696
697
697
698
freeIP , err = gm .CreateLoadBalancer (ctx , virtualServiceNamePrefix ,
698
- lbPoolNamePrefix , []string {"1.2.3.4" , "1.2.3.5" }, portDetailsList , oneArm , true , nil , testConfig .FreeLoadBalancerIP , & util.AllocatedResourcesMap {})
699
+ lbPoolNamePrefix , []string {"1.2.3.4" , "1.2.3.5" }, portDetailsList , oneArm , true , nil , testConfig .FreeLoadBalancerIP , & util.AllocatedResourcesMap {}, "" )
699
700
assert .NoError (t , err , "Load Balancer should be created even on second attempt" )
700
701
assert .NotEmpty (t , freeIP , "There should be a non-empty IP returned" )
701
702
assert .Equal (t , freeIP , testConfig .FreeLoadBalancerIP , "the provided external IP address should be the same as the load balancer IP address." )
@@ -816,7 +817,7 @@ func TestLoadBalancer_ExplicitLBIP_OneArmEnabled_CRUDE(t *testing.T) {
816
817
}
817
818
818
819
freeIP , err = gm .CreateLoadBalancer (ctx , virtualServiceNamePrefix ,
819
- lbPoolNamePrefix , []string {"1.2.3.4" , "1.2.3.5" }, portDetailsList , oneArm , true , nil , testConfig .FreeLoadBalancerIP , & util.AllocatedResourcesMap {})
820
+ lbPoolNamePrefix , []string {"1.2.3.4" , "1.2.3.5" }, portDetailsList , oneArm , true , nil , testConfig .FreeLoadBalancerIP , & util.AllocatedResourcesMap {}, "" )
820
821
assert .NoError (t , err , "Load Balancer should be created" )
821
822
assert .NotEmpty (t , freeIP , "There should be a non-empty IP returned" )
822
823
assert .Equal (t , freeIP , testConfig .FreeLoadBalancerIP , "the provided external IP address should be the same as the load balancer IP address." )
@@ -836,7 +837,7 @@ func TestLoadBalancer_ExplicitLBIP_OneArmEnabled_CRUDE(t *testing.T) {
836
837
assert .Equal (t , freeIP , freeIPObtained , "The IPs should match" )
837
838
838
839
freeIP , err = gm .CreateLoadBalancer (ctx , virtualServiceNamePrefix ,
839
- lbPoolNamePrefix , []string {"1.2.3.4" , "1.2.3.5" }, portDetailsList , oneArm , true , nil , testConfig .FreeLoadBalancerIP , & util.AllocatedResourcesMap {})
840
+ lbPoolNamePrefix , []string {"1.2.3.4" , "1.2.3.5" }, portDetailsList , oneArm , true , nil , testConfig .FreeLoadBalancerIP , & util.AllocatedResourcesMap {}, "" )
840
841
assert .NoError (t , err , "Load Balancer should be created even on second attempt" )
841
842
assert .NotEmpty (t , freeIP , "There should be a non-empty IP returned" )
842
843
0 commit comments