@@ -57,7 +57,7 @@ func TestValidator(t *testing.T) {
57
57
for i , model := range []* simulator.Model {simulator .ESX (), simulator .VPX ()} {
58
58
t .Logf ("%d" , i )
59
59
model .Datastore = 3
60
- model .Portgroup = 1
60
+ model .Portgroup = 2
61
61
defer model .Remove ()
62
62
err := model .Create ()
63
63
if err != nil {
@@ -807,18 +807,23 @@ func TestValidateWithFolders(t *testing.T) {
807
807
func testNetwork (ctx context.Context , v * Validator , input * data.Data , conf * config.VirtualContainerHostConfigSpec , t * testing.T ) {
808
808
op := trace .FromContext (ctx , "testNetwork" )
809
809
tests := []struct {
810
- path string
811
- vc bool
812
- hasErr bool
810
+ bridgePath string
811
+ mappedNetworks map [ string ] string
812
+ hasErr bool
813
813
}{
814
- {"/DC0/network/DC0_DVPG0" , true , false },
815
- {"DC0_DVPG0" , true , false },
816
- {"bridge" , true , true },
814
+ {"/DC0/network/DC0_DVPG0" , map [string ]string {}, false },
815
+ {"DC0_DVPG0" , map [string ]string {}, false },
816
+ {"DC0_DVPG0" , map [string ]string {"containernet1" : "DC0_DVPG1" }, false },
817
+ {"DC0_DVPG0" , map [string ]string {"containernet1" : "noexist" }, true },
818
+ {"DC0_DVPG0" , map [string ]string {"containernet1" : "DC0_DVPG0" }, true },
819
+ {"DC0_DVPG0" , map [string ]string {"bridge" : "DC0_DVPG1" }, true },
820
+ {"bridge" , map [string ]string {}, true },
817
821
}
818
822
// Throw exception if there is no network
819
823
for _ , test := range tests {
820
824
t .Logf ("%+v" , test )
821
- input .BridgeNetworkName = test .path
825
+ input .BridgeNetworkName = test .bridgePath
826
+ input .MappedNetworks = test .mappedNetworks
822
827
v .network (op , input , conf )
823
828
v .ListIssues (op )
824
829
if ! test .hasErr {
0 commit comments