rename xml_id in fixture to retain order; update ds counts in 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/5e931240 Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/5e931240 Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/5e931240 Branch: refs/heads/master Commit: 5e931240726da7ab77e0182b3ee333bddcaf8d3e Parents: e121a18 Author: Dan Kirkwood <dang...@gmail.com> Authored: Mon Aug 14 14:24:49 2017 -0600 Committer: Dewayne Richardson <dewr...@apache.org> Committed: Mon Aug 14 15:22:25 2017 -0600 ---------------------------------------------------------------------- traffic_ops/app/lib/Fixtures/Deliveryservice.pm | 4 ++-- .../app/t/api/1.1/deliveryservice/ssl_keys.t | 2 +- .../1.2/config_files_apache_traffic_server.t | 2 +- traffic_ops/app/t/api/1.2/deliveryservice.t | 2 +- .../app/t/api/1.2/deliveryservice_user.t | 22 ++++++++++---------- 5 files changed, 16 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/5e931240/traffic_ops/app/lib/Fixtures/Deliveryservice.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/Fixtures/Deliveryservice.pm b/traffic_ops/app/lib/Fixtures/Deliveryservice.pm index 2506156..2c587e4 100644 --- a/traffic_ops/app/lib/Fixtures/Deliveryservice.pm +++ b/traffic_ops/app/lib/Fixtures/Deliveryservice.pm @@ -552,10 +552,10 @@ my %definition_for = ( }, }, ds_period1 => { - new => 'Deliveryservice', + new => 'Deliveryservice', using => { id => 2200, - xml_id => 'foo.bar', + xml_id => 'xxfoo.bar', active => 1, tenant_id => undef, dscp => 40, http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/5e931240/traffic_ops/app/t/api/1.1/deliveryservice/ssl_keys.t ---------------------------------------------------------------------- diff --git a/traffic_ops/app/t/api/1.1/deliveryservice/ssl_keys.t b/traffic_ops/app/t/api/1.1/deliveryservice/ssl_keys.t index 9fe255f..3a3a42e 100644 --- a/traffic_ops/app/t/api/1.1/deliveryservice/ssl_keys.t +++ b/traffic_ops/app/t/api/1.1/deliveryservice/ssl_keys.t @@ -139,7 +139,7 @@ ok $t->get_ok("/api/1.1/deliveryservices/xmlId/$key/sslkeys.json")->json_has("/r ->or( sub { diag $t->tx->res->content->asset->{content}; } ); # #get key with period -ok $t->get_ok("/api/1.1/deliveryservices/xmlId/foo.bar/sslkeys.json")->json_has("/response")->json_has("/response/certificate/csr") +ok $t->get_ok("/api/1.1/deliveryservices/xmlId/xxfoo.bar/sslkeys.json")->json_has("/response")->json_has("/response/certificate/csr") ->json_has("/response/certificate/key")->json_has("/response/certificate/crt")->json_is( "/response/organization" => $org ) ->json_is( "/response/state" => $state )->json_is( "/response/city" => $city )->json_is( "/response/businessUnit" => $unit ) ->json_is( "/response/version" => $version )->json_is( "/response/country" => $country )->json_is( "/response/hostname" => $hostname )->status_is(200) http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/5e931240/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 26007e0..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?logsEnabled=true')->status_is(200)->$count_response(2) +$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/5e931240/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 d99fa36..594f04d 100644 --- a/traffic_ops/app/t/api/1.2/deliveryservice.t +++ b/traffic_ops/app/t/api/1.2/deliveryservice.t @@ -214,7 +214,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(defined($tenant_id) ? 3 : 2); +$t->get_ok('/api/1.2/deliveryservices?logsEnabled=true')->status_is(200)->$count_response(defined($tenant_id) ? 4 : 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/5e931240/traffic_ops/app/t/api/1.2/deliveryservice_user.t ---------------------------------------------------------------------- diff --git a/traffic_ops/app/t/api/1.2/deliveryservice_user.t b/traffic_ops/app/t/api/1.2/deliveryservice_user.t index 53f9138..0a13eb6 100644 --- a/traffic_ops/app/t/api/1.2/deliveryservice_user.t +++ b/traffic_ops/app/t/api/1.2/deliveryservice_user.t @@ -54,9 +54,9 @@ my $count_response = sub { $t->get_ok('/api/1.2/users/200/deliveryservices')->status_is(200)->$count_response(1) ->or( sub { diag $t->tx->res->content->asset->{content}; } ); -# there are currently 12 delivery services NOT assigned to user with id=200, +# there are currently 13 delivery services NOT assigned to user with id=200, # with tenancy that is accesssible by the user -$t->get_ok('/api/1.2/user/200/deliveryservices/available')->status_is(200)->$count_response(12) +$t->get_ok('/api/1.2/user/200/deliveryservices/available')->status_is(200)->$count_response(13) ->or( sub { diag $t->tx->res->content->asset->{content}; } ); # assign one ds to user with id=200 @@ -77,7 +77,7 @@ $t->get_ok('/api/1.2/users/200/deliveryservices')->status_is(200)->$count_respon # there are now 11 delivery services NOT assigned to user with id=200 # with tenancy that is accesssible by the user -$t->get_ok('/api/1.2/user/200/deliveryservices/available')->status_is(200)->$count_response(11) +$t->get_ok('/api/1.2/user/200/deliveryservices/available')->status_is(200)->$count_response(12) ->or( sub { diag $t->tx->res->content->asset->{content}; } ); # now remove ds=300 from user=200 @@ -90,9 +90,9 @@ ok $t->delete_ok('/api/1.2/deliveryservice_user/200/200')->status_is(404)->or( s $t->get_ok('/api/1.2/users/200/deliveryservices')->status_is(200)->$count_response(1) ->or( sub { diag $t->tx->res->content->asset->{content}; } ); -# there are now 12 delivery services NOT assigned to user with id=200 +# there are now 13 delivery services NOT assigned to user with id=200 # with tenancy that is accesssible by the user -$t->get_ok('/api/1.2/user/200/deliveryservices/available')->status_is(200)->$count_response(12) +$t->get_ok('/api/1.2/user/200/deliveryservices/available')->status_is(200)->$count_response(13) ->or( sub { diag $t->tx->res->content->asset->{content}; } ); ok $t->get_ok('/logout')->status_is(302)->or( sub { diag $t->tx->res->content->asset->{content}; } ); @@ -107,8 +107,8 @@ my $portal_user_id = $schema->resultset('TmUser')->find( { username => Test::Tes # there is currently 0 delivery service assigned to PORTAL_ROOT_USER $t->get_ok('/api/1.2/users/'.$portal_user_id.'/deliveryservices')->status_is(200)->$count_response(0) ->or( sub { diag $t->tx->res->content->asset->{content}; } ); -# there are currently 14 delivery services NOT assigned to PORTAL_ROOT_USER -$t->get_ok('/api/1.2/user/'.$portal_user_id.'/deliveryservices/available')->status_is(200)->$count_response(14) +# there are currently 15 delivery services NOT assigned to PORTAL_ROOT_USER +$t->get_ok('/api/1.2/user/'.$portal_user_id.'/deliveryservices/available')->status_is(200)->$count_response(15) ->or( sub { diag $t->tx->res->content->asset->{content}; } ); ok $t->get_ok('/logout')->status_is(302)->or( sub { diag $t->tx->res->content->asset->{content}; } ); @@ -128,8 +128,8 @@ ok $t->post_ok( '/login', => form => { u => Test::TestHelper::ADMIN_ROOT_USER, p # there is currently 0 delivery service assigned to PORTAL_ROOT_USER $t->get_ok('/api/1.2/users/'.$portal_user_id.'/deliveryservices')->status_is(200)->$count_response(0) ->or( sub { diag $t->tx->res->content->asset->{content}; } ); -# there are currently 14 delivery services NOT assigned to PORTAL_ROOT_USER -$t->get_ok('/api/1.2/user/'.$portal_user_id.'/deliveryservices/available')->status_is(200)->$count_response(14) +# there are currently 15 delivery services NOT assigned to PORTAL_ROOT_USER +$t->get_ok('/api/1.2/user/'.$portal_user_id.'/deliveryservices/available')->status_is(200)->$count_response(15) ->or( sub { diag $t->tx->res->content->asset->{content}; } ); ok $t->get_ok('/logout')->status_is(302)->or( sub { diag $t->tx->res->content->asset->{content}; } ); @@ -181,8 +181,8 @@ ok $t->post_ok( '/login', => form => { u => Test::TestHelper::ADMIN_ROOT_USER, p # there is currently 1 delivery service assigned to PORTAL_ROOT_USER $t->get_ok('/api/1.2/users/'.$portal_user_id.'/deliveryservices')->status_is(200)->$count_response(1) ->or( sub { diag $t->tx->res->content->asset->{content}; } ); -# there are currently 13 delivery services NOT assigned to PORTAL_ROOT_USER -$t->get_ok('/api/1.2/user/'.$portal_user_id.'/deliveryservices/available')->status_is(200)->$count_response(13) +# there are currently 14 delivery services NOT assigned to PORTAL_ROOT_USER +$t->get_ok('/api/1.2/user/'.$portal_user_id.'/deliveryservices/available')->status_is(200)->$count_response(14) ->or( sub { diag $t->tx->res->content->asset->{content}; } ); ok $t->get_ok('/logout')->status_is(302)->or( sub { diag $t->tx->res->content->asset->{content}; } );