@@ -1121,7 +1121,7 @@ func TestGetSubnetResourceID(t *testing.T) {
11211121 d .cloud .NetworkResourceSubscriptionID = ""
11221122 d .cloud .ResourceGroup = "foo"
11231123 d .cloud .VnetResourceGroup = "foo"
1124- actualOutput := d .getSubnetResourceID ()
1124+ actualOutput := d .getSubnetResourceID ("" , "" , "" )
11251125 expectedOutput := fmt .Sprintf (subnetTemplate , d .cloud .SubscriptionID , "foo" , d .cloud .VnetName , d .cloud .SubnetName )
11261126 assert .Equal (t , actualOutput , expectedOutput , "cloud.SubscriptionID should be used as the SubID" )
11271127 },
@@ -1135,7 +1135,7 @@ func TestGetSubnetResourceID(t *testing.T) {
11351135 d .cloud .NetworkResourceSubscriptionID = "fakeNetSubID"
11361136 d .cloud .ResourceGroup = "foo"
11371137 d .cloud .VnetResourceGroup = "foo"
1138- actualOutput := d .getSubnetResourceID ()
1138+ actualOutput := d .getSubnetResourceID ("" , "" , "" )
11391139 expectedOutput := fmt .Sprintf (subnetTemplate , d .cloud .NetworkResourceSubscriptionID , "foo" , d .cloud .VnetName , d .cloud .SubnetName )
11401140 assert .Equal (t , actualOutput , expectedOutput , "cloud.NetworkResourceSubscriptionID should be used as the SubID" )
11411141 },
@@ -1149,7 +1149,7 @@ func TestGetSubnetResourceID(t *testing.T) {
11491149 d .cloud .NetworkResourceSubscriptionID = "bar"
11501150 d .cloud .ResourceGroup = "fakeResourceGroup"
11511151 d .cloud .VnetResourceGroup = ""
1152- actualOutput := d .getSubnetResourceID ()
1152+ actualOutput := d .getSubnetResourceID ("" , "" , "" )
11531153 expectedOutput := fmt .Sprintf (subnetTemplate , "bar" , d .cloud .ResourceGroup , d .cloud .VnetName , d .cloud .SubnetName )
11541154 assert .Equal (t , actualOutput , expectedOutput , "cloud.Resourcegroup should be used as the rg" )
11551155 },
@@ -1163,11 +1163,25 @@ func TestGetSubnetResourceID(t *testing.T) {
11631163 d .cloud .NetworkResourceSubscriptionID = "bar"
11641164 d .cloud .ResourceGroup = "fakeResourceGroup"
11651165 d .cloud .VnetResourceGroup = "fakeVnetResourceGroup"
1166- actualOutput := d .getSubnetResourceID ()
1166+ actualOutput := d .getSubnetResourceID ("" , "" , "" )
11671167 expectedOutput := fmt .Sprintf (subnetTemplate , "bar" , d .cloud .VnetResourceGroup , d .cloud .VnetName , d .cloud .SubnetName )
11681168 assert .Equal (t , actualOutput , expectedOutput , "cloud.VnetResourceGroup should be used as the rg" )
11691169 },
11701170 },
1171+ {
1172+ name : "VnetResourceGroup, vnetName, subnetName is specified" ,
1173+ testFunc : func (t * testing.T ) {
1174+ d := NewFakeDriver ()
1175+ d .cloud = & azure.Cloud {}
1176+ d .cloud .SubscriptionID = "bar"
1177+ d .cloud .NetworkResourceSubscriptionID = "bar"
1178+ d .cloud .ResourceGroup = "fakeResourceGroup"
1179+ d .cloud .VnetResourceGroup = "fakeVnetResourceGroup"
1180+ actualOutput := d .getSubnetResourceID ("vnetrg" , "vnetName" , "subnetName" )
1181+ expectedOutput := fmt .Sprintf (subnetTemplate , "bar" , "vnetrg" , "vnetName" , "subnetName" )
1182+ assert .Equal (t , actualOutput , expectedOutput , "VnetResourceGroup, vnetName, subnetName is specified" )
1183+ },
1184+ },
11711185 }
11721186 for _ , tc := range testCases {
11731187 t .Run (tc .name , tc .testFunc )
0 commit comments