fixed broken tests
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/50bd1396 Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/50bd1396 Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/50bd1396 Branch: refs/heads/master Commit: 50bd1396f813f9833d97363612a6151332d80280 Parents: da352d1 Author: Jeremy Mitchell <[email protected]> Authored: Thu Jul 13 14:21:33 2017 -0600 Committer: Dewayne Richardson <[email protected]> Committed: Thu Jul 13 14:52:07 2017 -0600 ---------------------------------------------------------------------- traffic_ops/app/lib/TrafficOpsRoutes.pm | 2 +- traffic_ops/app/t/api/1.2/cachegroup.t | 4 ++-- .../app/t/api/1.2/config_files_apache_traffic_server.t | 2 +- traffic_ops/app/t/api/1.2/deliveryservice.t | 12 ++---------- traffic_ops/app/t/api/1.2/profile.t | 2 +- 5 files changed, 7 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/50bd1396/traffic_ops/app/lib/TrafficOpsRoutes.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/TrafficOpsRoutes.pm b/traffic_ops/app/lib/TrafficOpsRoutes.pm index c48d740..03c6351 100644 --- a/traffic_ops/app/lib/TrafficOpsRoutes.pm +++ b/traffic_ops/app/lib/TrafficOpsRoutes.pm @@ -584,7 +584,7 @@ sub api_routes { # -- DELIVERYSERVICES: SERVERS # Supports ?orderby=key $r->get("/api/$version/deliveryserviceserver")->over( authenticated => 1, not_ldap => 1 )->to( 'DeliveryServiceServer#index', namespace => $namespace ); - $r->post("/api/$version/deliveryserviceserver")->over( authenticated => 1, not_ldap => 1 )->to( 'DeliveryServiceServer#create', namespace => $namespace ); + $r->post("/api/$version/deliveryserviceserver")->over( authenticated => 1, not_ldap => 1 )->to( 'DeliveryServiceServer#assign_servers_to_ds', namespace => $namespace ); # -- DIVISIONS $r->get("/api/$version/divisions")->over( authenticated => 1, not_ldap => 1 )->to( 'Division#index', namespace => $namespace ); http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/50bd1396/traffic_ops/app/t/api/1.2/cachegroup.t ---------------------------------------------------------------------- diff --git a/traffic_ops/app/t/api/1.2/cachegroup.t b/traffic_ops/app/t/api/1.2/cachegroup.t index 8b1225b..449f983 100644 --- a/traffic_ops/app/t/api/1.2/cachegroup.t +++ b/traffic_ops/app/t/api/1.2/cachegroup.t @@ -276,11 +276,11 @@ my $count_response = sub { }; # there are currently 61 parameters not assigned to cachegroup 100 -$t->get_ok('/api/1.2/cachegroups/100/unassigned_parameters')->status_is(200)->$count_response(61) +$t->get_ok('/api/1.2/cachegroups/100/unassigned_parameters')->status_is(200)->$count_response(62) ->or( sub { diag $t->tx->res->content->asset->{content}; } ); # there are currently 61 parameters not assigned to cachegroup 200 -$t->get_ok('/api/1.2/cachegroups/200/unassigned_parameters')->status_is(200)->$count_response(61) +$t->get_ok('/api/1.2/cachegroups/200/unassigned_parameters')->status_is(200)->$count_response(62) ->or( sub { diag $t->tx->res->content->asset->{content}; } ); http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/50bd1396/traffic_ops/app/t/api/1.2/config_files_apache_traffic_server.t ---------------------------------------------------------------------- diff --git a/traffic_ops/app/t/api/1.2/config_files_apache_traffic_server.t b/traffic_ops/app/t/api/1.2/config_files_apache_traffic_server.t index 9ec9ecf..6017071 100644 --- a/traffic_ops/app/t/api/1.2/config_files_apache_traffic_server.t +++ b/traffic_ops/app/t/api/1.2/config_files_apache_traffic_server.t @@ -71,7 +71,7 @@ my $count_response = sub { return $t->success( is( scalar(@$r), $count ) ); }; -$t->get_ok('/api/1.2/deliveryservices/list?logsEnabled=true')->status_is(200)->$count_response(3) +$t->get_ok('/api/1.2/deliveryservices?logsEnabled=true')->status_is(200)->$count_response(3) ->or( sub { diag $t->tx->res->content->asset->{content}; } ); ok $t->put_ok('/api/1.2/snapshot/cdn1')->status_is(200)->or( sub { diag $t->tx->res->content->asset->{content}; } ); http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/50bd1396/traffic_ops/app/t/api/1.2/deliveryservice.t ---------------------------------------------------------------------- diff --git a/traffic_ops/app/t/api/1.2/deliveryservice.t b/traffic_ops/app/t/api/1.2/deliveryservice.t index 00cb167..dba128d 100644 --- a/traffic_ops/app/t/api/1.2/deliveryservice.t +++ b/traffic_ops/app/t/api/1.2/deliveryservice.t @@ -48,10 +48,6 @@ my $count_response = sub { return $t->success( is( scalar(@$r), $count ) ); }; -# there are currently 3 servers of type EDGE or ORG where server.cdn == ds.cdn not assigned to ds 100 -$t->get_ok('/api/1.2/deliveryservices/100/servers/unassigned')->status_is(200)->$count_response(4) - ->or( sub { diag $t->tx->res->content->asset->{content}; } ); - # we will assign 2 more servers to ds 100 ok $t->post_ok('/api/1.2/deliveryserviceserver' => {Accept => 'application/json'} => json => { "dsId" => 100, @@ -62,10 +58,6 @@ ok $t->post_ok('/api/1.2/deliveryserviceserver' => {Accept => 'application/json' ->json_is( "/alerts/0/text" => "Server assignments complete." ) , 'Are the servers assigned to the delivery service?'; -# there are now 2 servers of type EDGE or ORG where server.cdn == ds.cdn not assigned to ds 100 -$t->get_ok('/api/1.2/deliveryservices/100/servers/unassigned')->status_is(200)->$count_response(2) - ->or( sub { diag $t->tx->res->content->asset->{content}; } ); - # there are currently 6 servers of type EDGE or ORG that can be assigned to ds 100 $t->get_ok('/api/1.2/deliveryservices/100/servers/eligible')->status_is(200)->$count_response(6) ->or( sub { diag $t->tx->res->content->asset->{content}; } ); @@ -81,7 +73,7 @@ ok $t->get_ok("/api/1.2/deliveryservices?logsEnabled=true")->status_is(200)->or( ->json_is( "/response/0/xmlId", "test-ds1" ) ->json_is( "/response/0/logsEnabled", 1 ) ->json_is( "/response/0/ipv6RoutingEnabled", 1 ) - ->json_is( "/response/1/xmlId", "test-ds4" ); + ->json_is( "/response/1/xmlId", "test-ds1-root" ); ok $t->post_ok('/api/1.2/deliveryservices' => {Accept => 'application/json'} => json => { "active" => \0, @@ -190,7 +182,7 @@ ok $t->get_ok("/api/1.2/deliveryservices")->status_is(200)->or( sub { diag $t->t ->json_is( "/response/0/xmlId", "steering-ds1" )->json_is( "/response/0/logsEnabled", 0 )->json_is( "/response/0/ipv6RoutingEnabled", 1 ) ->json_is( "/response/1/xmlId", "steering-ds2" ); -$t->get_ok('/api/1.2/deliveryservices?logsEnabled=true')->status_is(200)->$count_response(2); +$t->get_ok('/api/1.2/deliveryservices?logsEnabled=true')->status_is(200)->$count_response(3); ok $t->put_ok('/api/1.2/snapshot/cdn1')->status_is(200)->or( sub { diag $t->tx->res->content->asset->{content}; } ); http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/50bd1396/traffic_ops/app/t/api/1.2/profile.t ---------------------------------------------------------------------- diff --git a/traffic_ops/app/t/api/1.2/profile.t b/traffic_ops/app/t/api/1.2/profile.t index 37a2f2e..8ccb5bd 100644 --- a/traffic_ops/app/t/api/1.2/profile.t +++ b/traffic_ops/app/t/api/1.2/profile.t @@ -136,7 +136,7 @@ $t->get_ok('/api/1.2/profiles/100/unassigned_parameters')->status_is(200)->$coun ->or( sub { diag $t->tx->res->content->asset->{content}; } ); # there are currently 4 parameters not assigned to profile 200 -$t->get_ok('/api/1.2/profiles/200/unassigned_parameters')->status_is(200)->$count_response(3) +$t->get_ok('/api/1.2/profiles/200/unassigned_parameters')->status_is(200)->$count_response(4) ->or( sub { diag $t->tx->res->content->asset->{content}; } ); # there are currently 7 profiles not assigned to parameter 4
