@@ -65,6 +65,15 @@ var portMap = map[string]neutronports.Port{
6565 {
6666 IPAddress : "192.0.2.2" ,
6767 },
68+ {
69+ IPAddress : "192.0.2.10" ,
70+ },
71+ {
72+ IPAddress : "2000::1" ,
73+ },
74+ {
75+ IPAddress : "2000::2" ,
76+ },
6877 },
6978 DeviceID : "9e5476bd-a4ec-4653-93d6-72c93aa682ba" ,
7079 DeviceOwner : novaDeviceOwner ,
@@ -1028,7 +1037,7 @@ func TestGetNeutronPortNodeEgressIPConfiguration(t *testing.T) {
10281037 IPv6 : "2000::/64" ,
10291038 },
10301039 Capacity : capacity {
1031- IP : ptr .To (openstackMaxCapacity - 2 ), // 2 allowed_address_pairs configured on the port.
1040+ IP : ptr .To (openstackMaxCapacity - 5 ), // 5 allowed_address_pairs configured on the port.
10321041 },
10331042 },
10341043 },
@@ -1041,7 +1050,7 @@ func TestGetNeutronPortNodeEgressIPConfiguration(t *testing.T) {
10411050 IPv6 : "2000::/64" ,
10421051 },
10431052 Capacity : capacity {
1044- IP : ptr .To (openstackMaxCapacity + 3 - 2 ), // excluding 2 allowed_address_pairs configured on the port.
1053+ IP : ptr .To (openstackMaxCapacity - 2 ), // excluding 2 allowed_address_pairs configured on the port.
10451054 },
10461055 },
10471056 // Configure IPs with 3 ips are within neutron subnet, 1 ip outside neutron subnet.
@@ -1096,23 +1105,23 @@ func TestAllowUnAllowIPAddressOnNeutronPort(t *testing.T) {
10961105 {
10971106 portID : "9ab428d4-58f8-42d7-9672-90c3f5641f83" ,
10981107 ip : net .ParseIP ("192.0.2.20" ),
1099- allowedIPs : []string {"192.0.2.1" , "192.0.2.2 " , "192.0.2.20" },
1108+ allowedIPs : []string {"192.0.2.1" , "192.0.2.10" , "192.0.2.2 " , "192.0.2.20" , "2000::1" , "2000::2 " },
11001109 },
11011110 {
11021111 portID : "9ab428d4-58f8-42d7-9672-90c3f5641f83" ,
11031112 ip : net .ParseIP ("192.0.2.21" ),
1104- allowedIPs : []string {"192.0.2.1" , "192.0.2.2 " , "192.0.2.20" , "192.0.2.21" },
1113+ allowedIPs : []string {"192.0.2.1" , "192.0.2.10" , "192.0.2.2 " , "192.0.2.20" , "192.0.2.21" , "2000::1" , "2000::2 " },
11051114 },
11061115 {
11071116 portID : "9ab428d4-58f8-42d7-9672-90c3f5641f83" ,
11081117 ip : net .ParseIP ("192.0.2.20" ),
11091118 unallow : true ,
1110- allowedIPs : []string {"192.0.2.1" , "192.0.2.2 " , "192.0.2.21" },
1119+ allowedIPs : []string {"192.0.2.1" , "192.0.2.10" , "192.0.2.2 " , "192.0.2.21" , "2000::1" , "2000::2 " },
11111120 },
11121121 {
11131122 portID : "9ab428d4-58f8-42d7-9672-90c3f5641f83" ,
11141123 ip : net .ParseIP ("192.0.2.21" ),
1115- allowedIPs : []string {"192.0.2.1" , "192.0.2.2 " , "192.0.2.21" },
1124+ allowedIPs : []string {"192.0.2.1" , "192.0.2.10" , "192.0.2.2 " , "192.0.2.21" , "2000::1" , "2000::2 " },
11161125 errString : "the requested IP for assignment is already assigned" ,
11171126 },
11181127 {
@@ -1132,7 +1141,7 @@ func TestAllowUnAllowIPAddressOnNeutronPort(t *testing.T) {
11321141 portID : "9ab428d4-58f8-42d7-9672-90c3f5641f83" ,
11331142 ip : net .ParseIP ("192.0.2.21" ),
11341143 unallow : true ,
1135- allowedIPs : []string {"192.0.2.1" , "192.0.2.2" },
1144+ allowedIPs : []string {"192.0.2.1" , "192.0.2.10" , "192.0.2.2" , "2000::1" , "2000:: 2" },
11361145 },
11371146 }
11381147
0 commit comments