4040 InstanceType = "c5.xlarge"
4141 SubnetId = "subnet-00000000000000000"
4242 SubnetCidrBlock = "192.168.0.0/16"
43- SubnetV6CidrBlock = "2600::/64"
4443 NodeName = "test-node"
4544 FakeInstance = ec2 .NewEC2Instance (NodeName , InstanceId , config .OSLinux )
4645 InstanceSecurityGroup = []string {"sg-1" , "sg-2" }
5756 UID : MockPodUID1 ,
5857 Name : MockPodName1 ,
5958 Namespace : MockPodNamespace1 ,
60- Annotations : map [string ]string {config .ResourceNamePodENI : "[{\" eniId\" :\" eni-00000000000000000\" ,\" ifAddress\" :\" FF:FF:FF:FF:FF:FF\" ,\" privateIp\" :\" 192.168.0.15\" , " +
61- "\" ipv6Addr \" : \" 2600:: \" ,\" vlanId\" :1,\" subnetCidr\" :\" 192.168.0.0/16\" , \" subnetV6Cidr \" : \" 2600::/64 \" },{\" eniId\" :\" eni-00000000000000001\" ,\" ifAddress\" :\" " +
62- "FF:FF:FF:FF:FF:F9\" ,\" privateIp\" :\" 192.168.0.16\" ,\" ipv6Addr \" : \" 2600::1 \" , \" vlanId\" :2,\" subnetCidr\" :\" 192.168.0.0/16\" , \" subnetV6Cidr \" : \" 2600::/64 \" }]" }},
59+ Annotations : map [string ]string {config .ResourceNamePodENI : "[{\" eniId\" :\" eni-00000000000000000\" ,\" ifAddress\" :\" FF:FF:FF:FF:FF:FF\" ,\" privateIp\" :\" 192.168.0.15\" " +
60+ ",\" vlanId\" :1,\" subnetCidr\" :\" 192.168.0.0/16\" },{\" eniId\" :\" eni-00000000000000001\" ,\" ifAddress\" :\" " +
61+ "FF:FF:FF:FF:FF:F9\" ,\" privateIp\" :\" 192.168.0.16\" ,\" vlanId\" :2,\" subnetCidr\" :\" 192.168.0.0/16\" }]" }},
6362 Spec : v1.PodSpec {NodeName : NodeName },
6463 Status : v1.PodStatus {},
6564 }
@@ -89,20 +88,17 @@ var (
8988 SecurityGroups = []string {SecurityGroup1 , SecurityGroup2 }
9089
9190 // Branch Interface 1
92- Branch1Id = "eni-00000000000000000"
93- MacAddr1 = "FF:FF:FF:FF:FF:FF"
94- BranchIp1 = "192.168.0.15"
95- BranchV6Ip1 = "2600::"
96- VlanId1 = 1
91+ Branch1Id = "eni-00000000000000000"
92+ MacAddr1 = "FF:FF:FF:FF:FF:FF"
93+ BranchIp1 = "192.168.0.15"
94+ VlanId1 = 1
9795
9896 EniDetails1 = & ENIDetails {
99- ID : Branch1Id ,
100- MACAdd : MacAddr1 ,
101- IPV4Addr : BranchIp1 ,
102- IPV6Addr : BranchV6Ip1 ,
103- VlanID : VlanId1 ,
104- SubnetCIDR : SubnetCidrBlock ,
105- SubnetV6CIDR : SubnetV6CidrBlock ,
97+ ID : Branch1Id ,
98+ MACAdd : MacAddr1 ,
99+ IPV4Addr : BranchIp1 ,
100+ VlanID : VlanId1 ,
101+ SubnetCIDR : SubnetCidrBlock ,
106102 }
107103
108104 branchENIs1 = []* ENIDetails {EniDetails1 }
@@ -111,31 +107,26 @@ var (
111107 MacAddress : & MacAddr1 ,
112108 NetworkInterfaceId : & Branch1Id ,
113109 PrivateIpAddress : & BranchIp1 ,
114- Ipv6Address : & BranchV6Ip1 ,
115110 }
116111
117112 // Branch Interface 2
118- Branch2Id = "eni-00000000000000001"
119- MacAddr2 = "FF:FF:FF:FF:FF:F9"
120- BranchIp2 = "192.168.0.16"
121- BranchV6Ip2 = "2600::1"
122- VlanId2 = 2
113+ Branch2Id = "eni-00000000000000001"
114+ MacAddr2 = "FF:FF:FF:FF:FF:F9"
115+ BranchIp2 = "192.168.0.16"
116+ VlanId2 = 2
123117
124118 EniDetails2 = & ENIDetails {
125- ID : Branch2Id ,
126- MACAdd : MacAddr2 ,
127- IPV4Addr : BranchIp2 ,
128- IPV6Addr : BranchV6Ip2 ,
129- VlanID : VlanId2 ,
130- SubnetCIDR : SubnetCidrBlock ,
131- SubnetV6CIDR : SubnetV6CidrBlock ,
119+ ID : Branch2Id ,
120+ MACAdd : MacAddr2 ,
121+ IPV4Addr : BranchIp2 ,
122+ VlanID : VlanId2 ,
123+ SubnetCIDR : SubnetCidrBlock ,
132124 }
133125
134126 BranchInterface2 = & awsEc2.NetworkInterface {
135127 MacAddress : & MacAddr2 ,
136128 NetworkInterfaceId : & Branch2Id ,
137129 PrivateIpAddress : & BranchIp2 ,
138- Ipv6Address : & BranchV6Ip2 ,
139130 }
140131
141132 branchENIs2 = []* ENIDetails {EniDetails2 }
@@ -734,7 +725,6 @@ func TestTrunkENI_CreateAndAssociateBranchENIs(t *testing.T) {
734725 mockInstance .EXPECT ().Type ().Return (InstanceType )
735726 mockInstance .EXPECT ().SubnetID ().Return (SubnetId ).Times (2 )
736727 mockInstance .EXPECT ().SubnetCidrBlock ().Return (SubnetCidrBlock ).Times (2 )
737- mockInstance .EXPECT ().SubnetV6CidrBlock ().Return (SubnetV6CidrBlock ).Times (2 )
738728
739729 mockEC2APIHelper .EXPECT ().CreateNetworkInterface (& BranchEniDescription , & SubnetId , SecurityGroups ,
740730 vlan1Tag , nil , nil ).Return (BranchInterface1 , nil )
@@ -767,7 +757,6 @@ func TestTrunkENI_CreateAndAssociateBranchENIs_InstanceSecurityGroup(t *testing.
767757 mockInstance .EXPECT ().Type ().Return (InstanceType )
768758 mockInstance .EXPECT ().SubnetID ().Return (SubnetId ).Times (2 )
769759 mockInstance .EXPECT ().SubnetCidrBlock ().Return (SubnetCidrBlock ).Times (2 )
770- mockInstance .EXPECT ().SubnetV6CidrBlock ().Return (SubnetV6CidrBlock ).Times (2 )
771760 mockInstance .EXPECT ().CurrentInstanceSecurityGroups ().Return (InstanceSecurityGroup )
772761
773762 mockEC2APIHelper .EXPECT ().CreateNetworkInterface (& BranchEniDescription , & SubnetId , InstanceSecurityGroup ,
@@ -801,7 +790,6 @@ func TestTrunkENI_CreateAndAssociateBranchENIs_ErrorAssociate(t *testing.T) {
801790 mockInstance .EXPECT ().Type ().Return (InstanceType )
802791 mockInstance .EXPECT ().SubnetID ().Return (SubnetId ).Times (2 )
803792 mockInstance .EXPECT ().SubnetCidrBlock ().Return (SubnetCidrBlock ).Times (2 )
804- mockInstance .EXPECT ().SubnetV6CidrBlock ().Return (SubnetV6CidrBlock ).Times (2 )
805793
806794 gomock .InOrder (
807795 mockEC2APIHelper .EXPECT ().CreateNetworkInterface (& BranchEniDescription , & SubnetId , SecurityGroups ,
@@ -829,7 +817,6 @@ func TestTrunkENI_CreateAndAssociateBranchENIs_ErrorCreate(t *testing.T) {
829817 mockInstance .EXPECT ().Type ().Return (InstanceType )
830818 mockInstance .EXPECT ().SubnetID ().Return (SubnetId ).Times (2 )
831819 mockInstance .EXPECT ().SubnetCidrBlock ().Return (SubnetCidrBlock ).Times (1 )
832- mockInstance .EXPECT ().SubnetV6CidrBlock ().Return (SubnetV6CidrBlock ).Times (1 )
833820
834821 gomock .InOrder (
835822 mockEC2APIHelper .EXPECT ().CreateNetworkInterface (& BranchEniDescription , & SubnetId , SecurityGroups , vlan1Tag ,
0 commit comments