@@ -305,7 +305,14 @@ func TestBuildInfraRdfGraph(t *testing.T) {
305305 }
306306
307307 routeTables := []* ec2.RouteTable {
308- {RouteTableId : awssdk .String ("rt_1" ), VpcId : awssdk .String ("vpc_1" ), Associations : []* ec2.RouteTableAssociation {{RouteTableId : awssdk .String ("rt_1" ), SubnetId : awssdk .String ("sub_1" )}}},
308+ {
309+ RouteTableId : awssdk .String ("rt_1" ),
310+ VpcId : awssdk .String ("vpc_1" ),
311+ Associations : []* ec2.RouteTableAssociation {
312+ {RouteTableId : awssdk .String ("rt_1" ), SubnetId : awssdk .String ("sub_1" ), RouteTableAssociationId : awssdk .String ("assoc_1" )},
313+ {RouteTableId : awssdk .String ("rt_1" ), SubnetId : awssdk .String ("sub_2" ), RouteTableAssociationId : awssdk .String ("assoc_2" ), Main : awssdk .Bool (true )},
314+ },
315+ },
309316 }
310317
311318 images := []* ec2.Image {
@@ -585,6 +592,14 @@ func TestBuildInfraRdfGraph(t *testing.T) {
585592 return p [i ].KeyName < p [j ].KeyName
586593 })
587594 }
595+ if p , ok := res .Properties [p .Associations ].([]* graph.KeyValue ); ok {
596+ sort .Slice (p , func (i , j int ) bool {
597+ if p [i ].KeyName == p [j ].KeyName {
598+ return p [i ].Value < p [j ].Value
599+ }
600+ return p [i ].KeyName < p [j ].KeyName
601+ })
602+ }
588603 if p , ok := res .Properties [p .InboundRules ].([]* graph.FirewallRule ); ok {
589604 for _ , r := range p {
590605 sort .Strings (r .Sources )
@@ -621,7 +636,7 @@ func TestBuildInfraRdfGraph(t *testing.T) {
621636 "my_key" : resourcetest .KeyPair ("my_key" ).Build (),
622637 "igw_1" : resourcetest .InternetGw ("igw_1" ).Prop (p .Vpcs , []string {"vpc_2" }).Build (),
623638 "natgw_1" : resourcetest .NatGw ("natgw_1" ).Prop (p .Vpc , "vpc_1" ).Prop (p .Subnet , "sub_1" ).Build (),
624- "rt_1" : resourcetest .RouteTable ("rt_1" ).Prop (p .Vpc , "vpc_1" ).Prop (p .Main , false ).Build (),
639+ "rt_1" : resourcetest .RouteTable ("rt_1" ).Prop (p .Vpc , "vpc_1" ).Prop (p .Main , true ). Prop ( p . Associations , [] * graph. KeyValue {{ KeyName : "assoc_1" , Value : "sub_1" }, { KeyName : "assoc_2" , Value : "sub_2" }} ).Build (),
625640 "lb_1" : resourcetest .LoadBalancer ("lb_1" ).Prop (p .Arn , "lb_1" ).Prop (p .Name , "my_loadbalancer" ).Prop (p .Vpc , "vpc_1" ).Build (),
626641 "lb_2" : resourcetest .LoadBalancer ("lb_2" ).Prop (p .Arn , "lb_2" ).Prop (p .Vpc , "vpc_2" ).Build (),
627642 "lb_3" : resourcetest .LoadBalancer ("lb_3" ).Prop (p .Arn , "lb_3" ).Prop (p .Vpc , "vpc_1" ).Build (),
@@ -687,7 +702,7 @@ func TestBuildInfraRdfGraph(t *testing.T) {
687702 "lb_3" : {"tg_1" },
688703 "my_key" : {"inst_4" , "inst_6" , "launchconfig_arn" },
689704 "natgw_1" : {"sub_1" },
690- "rt_1" : {"sub_1" },
705+ "rt_1" : {"sub_1" , "sub_2" },
691706 "securitygroup_1" : {"eni-1" , "inst_2" , "inst_4" , "inst_6" , "lb_3" },
692707 "securitygroup_2" : {"eni-1" , "inst_4" , "lb_3" },
693708 "tg_1" : {"inst_1" },
0 commit comments