You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by da...@apache.org on 2016/11/21 20:52:19 UTC
[3/5] incubator-trafficcontrol git commit: removed for future remerge
see TC-48
removed for future remerge see TC-48
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/c8a7757d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/c8a7757d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/c8a7757d
Branch: refs/heads/psql-rebase
Commit: c8a7757d60a8153052d4fde9826173a7f4f4cb1a
Parents: 21f90c1
Author: Dewayne Richardson <de...@apache.org>
Authored: Mon Nov 21 13:22:36 2016 -0700
Committer: Dewayne Richardson <de...@apache.org>
Committed: Mon Nov 21 13:22:36 2016 -0700
----------------------------------------------------------------------
.../Fixtures/SteeringDeliveryServiceUsers.pm | 56 ---
.../app/lib/Fixtures/SteeringDeliveryservice.pm | 380 ----------------
.../Fixtures/SteeringDeliveryserviceRegex.pm | 130 ------
traffic_ops/app/lib/Fixtures/SteeringTarget.pm | 75 ----
traffic_ops/app/lib/Fixtures/SteeringType.pm | 50 ---
traffic_ops/app/lib/Fixtures/SteeringUsers.pm | 90 ----
traffic_ops/app/t/api/1.2/steering_internal.t | 432 -------------------
7 files changed, 1213 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c8a7757d/traffic_ops/app/lib/Fixtures/SteeringDeliveryServiceUsers.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/SteeringDeliveryServiceUsers.pm b/traffic_ops/app/lib/Fixtures/SteeringDeliveryServiceUsers.pm
deleted file mode 100644
index 09a4bdf..0000000
--- a/traffic_ops/app/lib/Fixtures/SteeringDeliveryServiceUsers.pm
+++ /dev/null
@@ -1,56 +0,0 @@
-package Fixtures::SteeringDeliveryServiceUsers;
-
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-use strict;
-use warnings FATAL => 'all';
-
-use Moose;
-extends 'DBIx::Class::EasyFixture';
-use namespace::autoclean;
-use Digest::SHA1 qw(sha1_hex);
-
-my %definition_for = (
- ds_steering_user1 => {
- new => 'DeliveryserviceTmuser',
- using => {
- deliveryservice => 10001,
- tm_user_id => 101,
- },
- },
- ds_steering_user2 => {
- new => 'DeliveryserviceTmuser',
- using => {
- deliveryservice => 10002,
- tm_user_id => 102,
- },
- },
-);
-
-sub get_definition {
- my ( $self, $name ) = @_;
- return $definition_for{$name};
-}
-
-sub all_fixture_names {
- return keys %definition_for;
-}
-
-__PACKAGE__->meta->make_immutable;
-
-1;
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c8a7757d/traffic_ops/app/lib/Fixtures/SteeringDeliveryservice.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/SteeringDeliveryservice.pm b/traffic_ops/app/lib/Fixtures/SteeringDeliveryservice.pm
deleted file mode 100644
index 62cca76..0000000
--- a/traffic_ops/app/lib/Fixtures/SteeringDeliveryservice.pm
+++ /dev/null
@@ -1,380 +0,0 @@
-package Fixtures::SteeringDeliveryservice;
-#
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-#
-#
-use strict;
-use warnings FATAL => 'all';
-
-use Moose;
-extends 'DBIx::Class::EasyFixture';
-use namespace::autoclean;
-use Digest::SHA1 qw(sha1_hex);
-
-my %definition_for = (
- target_filter_1 => {
- new => 'Regex',
- using => {
- id => 21001,
- pattern => '.*/force-to-one/.*',
- type => 987,
- },
- },
- target_filter_1_2 => {
- new => 'Regex',
- using => {
- id => 21002,
- pattern => '.*/force-to-one-also/.*',
- type => 987,
- },
- },
- target_filter_3 => {
- new => 'Regex',
- using => {
- id => 21003,
- pattern => '.*/use-three/.*',
- type => 987,
- },
- },
- target_filter_4 => {
- new => 'Regex',
- using => {
- id => 21004,
- pattern => '.*/go-to-four/.*',
- type => 987,
- },
- },
- hr_steering_1 => {
- new => 'Regex',
- using => {
- id => 21101,
- pattern => '.*\.steering-ds1\..*',
- type => 19,
- },
- },
- hr_steering_2 => {
- new => 'Regex',
- using => {
- id => 21102,
- pattern => '.*\.steering-ds2\..*',
- type => 19,
- },
- },
- hr_target_1 => {
- new => 'Regex',
- using => {
- id => 22201,
- pattern => '.*\.target-ds1\..*',
- type => 19,
- },
- },
- hr_target_2 => {
- new => 'Regex',
- using => {
- id => 22202,
- pattern => '.*\.target-ds2\..*',
- type => 19,
- },
- },
- hr_target_3 => {
- new => 'Regex',
- using => {
- id => 22203,
- pattern => '.*\.target-ds3\..*',
- type => 19,
- },
- },
- hr_target_4 => {
- new => 'Regex',
- using => {
- id => 22204,
- pattern => '.*\.target-ds4\..*',
- type => 19,
- },
- },
- hr_new_steering => {
- new => 'Regex',
- using => {
- id => 21103,
- pattern => '.*\.new-steering-ds\..*',
- type => 19,
- },
- },
- steering_ds1 => {
- new => 'Deliveryservice',
- using => {
- id => 10001,
- xml_id => 'steering-ds1',
- active => 1,
- dscp => 40,
- signed => 0,
- qstring_ignore => 0,
- geo_limit => 0,
- http_bypass_fqdn => '',
- dns_bypass_ip => 'hokeypokey',
- dns_bypass_ttl => 10,
- ccr_dns_ttl => 3600,
- global_max_mbps => 0,
- global_max_tps => 0,
- long_desc => 'steering-ds1 long_desc',
- long_desc_1 => 'steering-ds1 long_desc_1',
- long_desc_2 => 'steering-ds1 long_desc_2',
- max_dns_answers => 0,
- protocol => 0,
- org_server_fqdn => 'http://steering-ds1.edge',
- info_url => 'http://steering-ds1.edge/info_url.html',
- miss_lat => '41.881944',
- miss_long => '-87.627778',
- check_path => '/crossdomain.xml',
- type => 8,
- profile => 3,
- cdn_id => 1,
- ipv6_routing_enabled => 1,
- protocol => 1,
- display_name => 'steering-ds1-displayname',
- initial_dispersion => 1,
- regional_geo_blocking => 1,
- },
- },
- steering_ds2 => {
- new => 'Deliveryservice',
- using => {
- id => 10002,
- xml_id => 'steering-ds2',
- active => 1,
- dscp => 40,
- signed => 0,
- qstring_ignore => 0,
- geo_limit => 0,
- http_bypass_fqdn => '',
- dns_bypass_ip => 'hokeypokey',
- dns_bypass_ttl => 10,
- ccr_dns_ttl => 3600,
- global_max_mbps => 0,
- global_max_tps => 0,
- long_desc => 'steering-ds2 long_desc',
- long_desc_1 => 'steering-ds2 long_desc_1',
- long_desc_2 => 'steering-ds2 long_desc_2',
- max_dns_answers => 0,
- protocol => 0,
- org_server_fqdn => 'http://steering-ds2.edge',
- info_url => 'http://steering-ds2.edge/info_url.html',
- miss_lat => '41.881944',
- miss_long => '-87.627778',
- check_path => '/crossdomain.xml',
- type => 8,
- profile => 3,
- cdn_id => 1,
- ipv6_routing_enabled => 1,
- protocol => 1,
- display_name => 'steering-ds2-displayname',
- initial_dispersion => 1,
- regional_geo_blocking => 1,
- },
- },
- target_ds1 => {
- new => 'Deliveryservice',
- using => {
- id => 20001,
- xml_id => 'target-ds1',
- active => 1,
- dscp => 40,
- signed => 0,
- qstring_ignore => 0,
- geo_limit => 0,
- http_bypass_fqdn => '',
- dns_bypass_ip => 'hokeypokey',
- dns_bypass_ttl => 10,
- ccr_dns_ttl => 3600,
- global_max_mbps => 0,
- global_max_tps => 0,
- long_desc => 'target-ds1 long_desc',
- long_desc_1 => 'target-ds1 long_desc_1',
- long_desc_2 => 'target-ds1 long_desc_2',
- max_dns_answers => 0,
- protocol => 0,
- org_server_fqdn => 'http://target-ds1.edge',
- info_url => 'http://target-ds1.edge/info_url.html',
- miss_lat => '41.881944',
- miss_long => '-87.627778',
- check_path => '/crossdomain.xml',
- type => 8,
- profile => 3,
- cdn_id => 1,
- ipv6_routing_enabled => 1,
- protocol => 1,
- display_name => 'target-ds1-displayname',
- initial_dispersion => 1,
- regional_geo_blocking => 1,
- },
- },
- target_ds2 => {
- new => 'Deliveryservice',
- using => {
- id => 20002,
- xml_id => 'target-ds2',
- active => 1,
- dscp => 40,
- signed => 0,
- qstring_ignore => 0,
- geo_limit => 0,
- http_bypass_fqdn => '',
- dns_bypass_ip => 'hokeypokey',
- dns_bypass_ttl => 10,
- ccr_dns_ttl => 3600,
- global_max_mbps => 0,
- global_max_tps => 0,
- long_desc => 'target-ds2 long_desc',
- long_desc_1 => 'target-ds2 long_desc_1',
- long_desc_2 => 'target-ds2 long_desc_2',
- max_dns_answers => 0,
- protocol => 0,
- org_server_fqdn => 'http://target-ds2.edge',
- info_url => 'http://target-ds2.edge/info_url.html',
- miss_lat => '41.881944',
- miss_long => '-87.627778',
- check_path => '/crossdomain.xml',
- type => 8,
- profile => 3,
- cdn_id => 1,
- ipv6_routing_enabled => 1,
- protocol => 1,
- display_name => 'target-ds2-displayname',
- initial_dispersion => 1,
- regional_geo_blocking => 1,
- },
- },
- target_ds3 => {
- new => 'Deliveryservice',
- using => {
- id => 20003,
- xml_id => 'target-ds3',
- active => 1,
- dscp => 40,
- signed => 0,
- qstring_ignore => 0,
- geo_limit => 0,
- http_bypass_fqdn => '',
- dns_bypass_ip => 'hokeypokey',
- dns_bypass_ttl => 10,
- ccr_dns_ttl => 3600,
- global_max_mbps => 0,
- global_max_tps => 0,
- long_desc => 'target-ds3 long_desc',
- long_desc_1 => 'target-ds3 long_desc_1',
- long_desc_2 => 'target-ds3 long_desc_2',
- max_dns_answers => 0,
- protocol => 0,
- org_server_fqdn => 'http://target-ds3.edge',
- info_url => 'http://target-ds3.edge/info_url.html',
- miss_lat => '41.881944',
- miss_long => '-87.627778',
- check_path => '/crossdomain.xml',
- type => 8,
- profile => 3,
- cdn_id => 1,
- ipv6_routing_enabled => 1,
- protocol => 1,
- display_name => 'target-ds3-displayname',
- initial_dispersion => 1,
- regional_geo_blocking => 1,
- },
- },
- target_ds4 => {
- new => 'Deliveryservice',
- using => {
- id => 20004,
- xml_id => 'target-ds4',
- active => 1,
- dscp => 40,
- signed => 0,
- qstring_ignore => 0,
- geo_limit => 0,
- http_bypass_fqdn => '',
- dns_bypass_ip => 'hokeypokey',
- dns_bypass_ttl => 10,
- ccr_dns_ttl => 3600,
- global_max_mbps => 0,
- global_max_tps => 0,
- long_desc => 'target-ds4 long_desc',
- long_desc_1 => 'target-ds4 long_desc_1',
- long_desc_2 => 'target-ds4 long_desc_2',
- max_dns_answers => 0,
- protocol => 0,
- org_server_fqdn => 'http://target-ds4.edge',
- info_url => 'http://target-ds4.edge/info_url.html',
- miss_lat => '41.881944',
- miss_long => '-87.627778',
- check_path => '/crossdomain.xml',
- type => 8,
- profile => 3,
- cdn_id => 1,
- ipv6_routing_enabled => 1,
- protocol => 1,
- display_name => 'target-ds4-displayname',
- initial_dispersion => 1,
- regional_geo_blocking => 1,
- },
- },
- new_steering => {
- new => 'Deliveryservice',
- using => {
- id => 10003,
- xml_id => 'new-steering-ds',
- active => 1,
- dscp => 40,
- signed => 0,
- qstring_ignore => 0,
- geo_limit => 0,
- http_bypass_fqdn => '',
- dns_bypass_ip => 'hokeypokey',
- dns_bypass_ttl => 10,
- ccr_dns_ttl => 3600,
- global_max_mbps => 0,
- global_max_tps => 0,
- long_desc => 'new-steering-ds long_desc',
- long_desc_1 => 'new-steering-ds long_desc_1',
- long_desc_2 => 'new-steering-ds long_desc_2',
- max_dns_answers => 0,
- protocol => 0,
- org_server_fqdn => 'http://new-steering-ds.edge',
- info_url => 'http://new-steering-ds.edge/info_url.html',
- miss_lat => '41.881944',
- miss_long => '-87.627778',
- check_path => '/crossdomain.xml',
- type => 8,
- profile => 3,
- cdn_id => 1,
- ipv6_routing_enabled => 1,
- protocol => 1,
- display_name => 'new-steering-ds-displayname',
- initial_dispersion => 1,
- regional_geo_blocking => 1,
- },
- },
-);
-
-sub get_definition {
- my ( $self, $name ) = @_;
- return $definition_for{$name};
-}
-
-sub all_fixture_names {
- return keys %definition_for;
-}
-
-__PACKAGE__->meta->make_immutable;
-
-1;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c8a7757d/traffic_ops/app/lib/Fixtures/SteeringDeliveryserviceRegex.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/SteeringDeliveryserviceRegex.pm b/traffic_ops/app/lib/Fixtures/SteeringDeliveryserviceRegex.pm
deleted file mode 100644
index bac033a..0000000
--- a/traffic_ops/app/lib/Fixtures/SteeringDeliveryserviceRegex.pm
+++ /dev/null
@@ -1,130 +0,0 @@
-package Fixtures::SteeringDeliveryserviceRegex;
-
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-use strict;
-use warnings FATAL => 'all';
-
-use Moose;
-extends 'DBIx::Class::EasyFixture';
-use namespace::autoclean;
-
-my %definition_for = (
- target_r1_filter => {
- new => 'DeliveryserviceRegex',
- using => {
- deliveryservice => 20001,
- regex => 21001,
- set_number => 0,
- },
- },
- target_r2_filter => {
- new => 'DeliveryserviceRegex',
- using => {
- deliveryservice => 20001,
- regex => 21002,
- set_number => 0,
- },
- },
- target_r3_filter => {
- new => 'DeliveryserviceRegex',
- using => {
- deliveryservice => 20003,
- regex => 21003,
- set_number => 0,
- },
- },
- target_r4_filter => {
- new => 'DeliveryserviceRegex',
- using => {
- deliveryservice => 20004,
- regex => 21004,
- set_number => 0,
- },
- },
- steering_1 => {
- new => 'DeliveryserviceRegex',
- using => {
- deliveryservice => 10001,
- regex => 21101,
- set_number => 0,
- },
- },
- steering_2 => {
- new => 'DeliveryserviceRegex',
- using => {
- deliveryservice => 10002,
- regex => 21102,
- set_number => 0,
- },
- },
- target_1 => {
- new => 'DeliveryserviceRegex',
- using => {
- deliveryservice => 20001,
- regex => 22201,
- set_number => 0,
- },
- },
- target_2 => {
- new => 'DeliveryserviceRegex',
- using => {
- deliveryservice => 20002,
- regex => 22202,
- set_number => 0,
- },
- },
- target_3 => {
- new => 'DeliveryserviceRegex',
- using => {
- deliveryservice => 20003,
- regex => 22203,
- set_number => 0,
- },
- },
- target_4 => {
- new => 'DeliveryserviceRegex',
- using => {
- deliveryservice => 20004,
- regex => 22204,
- set_number => 0,
- },
- },
- new_steering => {
- new => 'DeliveryserviceRegex',
- using => {
- deliveryservice => 10003,
- regex => 21103,
- set_number => 0,
- },
- },
-);
-
-
-sub get_definition {
- my ( $self, $name ) = @_;
- return $definition_for{$name};
-}
-
-sub all_fixture_names {
- return keys %definition_for;
-}
-
-__PACKAGE__->meta->make_immutable;
-
-1;
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c8a7757d/traffic_ops/app/lib/Fixtures/SteeringTarget.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/SteeringTarget.pm b/traffic_ops/app/lib/Fixtures/SteeringTarget.pm
deleted file mode 100644
index a09e48a..0000000
--- a/traffic_ops/app/lib/Fixtures/SteeringTarget.pm
+++ /dev/null
@@ -1,75 +0,0 @@
-package Fixtures::SteeringTarget;
-
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-use strict;
-use warnings FATAL => 'all';
-
-use Moose;
-extends 'DBIx::Class::EasyFixture';
-use namespace::autoclean;
-use Digest::SHA1 qw(sha1_hex);
-
-
-my %definition_for = (
- steering_target_1 => {
- new => 'SteeringTarget',
- using => {
- deliveryservice => 10001,
- target => 20001,
- weight => 1000,
- }
- },
- steering_target_2 => {
- new => 'SteeringTarget',
- using => {
- deliveryservice => 10001,
- target => 20002,
- weight => 7654,
- }
- },
- steering_target_3 => {
- new => 'SteeringTarget',
- using => {
- deliveryservice => 10002,
- target => 20003,
- weight => 123,
- }
- },
- steering_target_4 => {
- new => 'SteeringTarget',
- using => {
- deliveryservice => 10002,
- target => 20004,
- weight => 999,
- }
- },
-);
-
-sub get_definition {
- my ( $self, $name ) = @_;
- return $definition_for{$name};
-}
-
-sub all_fixture_names {
- return keys %definition_for;
-}
-
-__PACKAGE__->meta->make_immutable;
-
-1;
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c8a7757d/traffic_ops/app/lib/Fixtures/SteeringType.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/SteeringType.pm b/traffic_ops/app/lib/Fixtures/SteeringType.pm
deleted file mode 100644
index eb87fd4..0000000
--- a/traffic_ops/app/lib/Fixtures/SteeringType.pm
+++ /dev/null
@@ -1,50 +0,0 @@
-package Fixtures::SteeringType;
-
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-use strict;
-use warnings FATAL => 'all';
-
-use Moose;
-extends 'DBIx::Class::EasyFixture';
-use namespace::autoclean;
-use Digest::SHA1 qw(sha1_hex);
-
-my %definition_for = (
- STEERING_REGEXP => {
- new => 'Type',
- using => {
- id => 987,
- name => 'STEERING_REGEXP',
- description => 'Steering target filter regular expression',
- use_in_table => 'regex',
- },
- },
-);
-
-sub get_definition {
- my ( $self, $name ) = @_;
- return $definition_for{$name};
-}
-
-sub all_fixture_names {
- return keys %definition_for;
-}
-
-__PACKAGE__->meta->make_immutable;
-1;
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c8a7757d/traffic_ops/app/lib/Fixtures/SteeringUsers.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/SteeringUsers.pm b/traffic_ops/app/lib/Fixtures/SteeringUsers.pm
deleted file mode 100644
index de30cac..0000000
--- a/traffic_ops/app/lib/Fixtures/SteeringUsers.pm
+++ /dev/null
@@ -1,90 +0,0 @@
-package Fixtures::SteeringUsers;
-
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-use strict;
-use warnings FATAL => 'all';
-
-use Moose;
-extends 'DBIx::Class::EasyFixture';
-use namespace::autoclean;
-use Digest::SHA1 qw(sha1_hex);
-
-my $local_passwd = sha1_hex('password');
-my %definition_for = (
- steering1 => {
- new => 'TmUser',
- using => {
- id => 101,
- username => 'steering1',
- role => 8,
- uid => '1',
- gid => '1',
- local_passwd => $local_passwd,
- confirm_local_passwd => $local_passwd,
- full_name => 'The steering User 1',
- email => 'steering1@kabletown.com',
- new_user => '1',
- address_line1 => 'address_line1',
- address_line2 => 'address_line2',
- city => 'city',
- state_or_province => 'state_or_province',
- phone_number => '333-333-3333',
- postal_code => '80123',
- country => 'United States',
- token => '',
- registration_sent => '1999-01-01 00:00:00',
- },
- },
- steering2 => {
- new => 'TmUser',
- using => {
- id => 102,
- username => 'steering2',
- role => 8,
- uid => '1',
- gid => '1',
- local_passwd => $local_passwd,
- confirm_local_passwd => $local_passwd,
- full_name => 'The steering User 2',
- email => 'steering2@kabletown.com',
- new_user => '1',
- address_line1 => 'address_line1',
- address_line2 => 'address_line2',
- city => 'city',
- state_or_province => 'state_or_province',
- phone_number => '333-333-3333',
- postal_code => '80123',
- country => 'United States',
- token => '',
- registration_sent => '1999-01-01 00:00:00',
- },
- },
-);
-
-sub get_definition {
- my ( $self, $name ) = @_;
- return $definition_for{$name};
-}
-
-sub all_fixture_names {
- return keys %definition_for;
-}
-
-__PACKAGE__->meta->make_immutable;
-1;
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/c8a7757d/traffic_ops/app/t/api/1.2/steering_internal.t
----------------------------------------------------------------------
diff --git a/traffic_ops/app/t/api/1.2/steering_internal.t b/traffic_ops/app/t/api/1.2/steering_internal.t
deleted file mode 100644
index b1cda5c..0000000
--- a/traffic_ops/app/t/api/1.2/steering_internal.t
+++ /dev/null
@@ -1,432 +0,0 @@
-package main;
-
-#
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-use Mojo::Base -strict;
-use Test::More;
-use Test::Mojo;
-use DBI;
-use Schema;
-use strict;
-use warnings;
-use Test::TestHelper;
-use Fixtures::TmUser;
-use Fixtures::SteeringUsers;
-use Fixtures::SteeringType;
-use Fixtures::SteeringDeliveryservice;
-use Fixtures::SteeringDeliveryserviceRegex;
-use Fixtures::SteeringTarget;
-use Fixtures::SteeringDeliveryServiceUsers;
-
-BEGIN { $ENV{MOJO_MODE} = "test" }
-
-my $t = Test::Mojo->new("TrafficOps");
-my $dbh = Schema->database_handle;
-my $schema = Schema->connect_to_database;
-
-#unload data for a clean test
-Test::TestHelper->unload_core_data($schema);
-Test::TestHelper->teardown( $schema, "SteeringTarget" );
-
-#load core test data
-Test::TestHelper->load_core_data($schema);
-
-my $schema_values = { schema => $schema, no_transactions => 1 };
-
-my $steering_users = Fixtures::SteeringUsers->new($schema_values);
-Test::TestHelper->load_all_fixtures($steering_users);
-
-my $steering_type = Fixtures::SteeringType->new($schema_values);
-Test::TestHelper->load_all_fixtures($steering_type);
-
-my $steering_deliveryservice = Fixtures::SteeringDeliveryservice->new($schema_values);
-Test::TestHelper->load_all_fixtures($steering_deliveryservice);
-
-my $steering_deliveryservice_regex = Fixtures::SteeringDeliveryserviceRegex->new($schema_values);
-Test::TestHelper->load_all_fixtures($steering_deliveryservice_regex);
-
-my $steering_target = Fixtures::SteeringTarget->new($schema_values);
-Test::TestHelper->load_all_fixtures($steering_target);
-
-my $steering_deliveryservice_users = Fixtures::SteeringDeliveryServiceUsers->new($schema_values);
-Test::TestHelper->load_all_fixtures($steering_deliveryservice_users);
-
-####### Unauthorized User ################################################################################
-ok $t->post_ok( "/api/1.2/user/login", => json => { u => Test::TestHelper::CODEBIG_USER, p => Test::TestHelper::CODEBIG_PASSWORD } )
- ->status_is(200)
- ->or( sub { diag $t->tx->res->content->asset->{content}; } );
-
-$t->get_ok("/internal/api/1.2/steering.json")
- ->status_is(401)
- ->or( sub { diag $t->tx->res->headers->to_string(); } );
-
-$t->post_ok("/api/1.2/user/logout")->status_is(200);
-
-####### Administrator ##################################################################################
-ok $t->post_ok( "/api/1.2/user/login", => json => { u => Test::TestHelper::ADMIN_USER, p => Test::TestHelper::ADMIN_USER_PASSWORD } )
- ->status_is(200)
- ->or( sub { diag $t->tx->res->content->asset->{content}; } );
-
-ok $t->get_ok("/internal/api/1.2/steering.json")->status_is(200)
- ->or( sub { diag $t->tx->res->headers->to_string(); } )
- ->json_is("/response/0/deliveryService", "steering-ds1")
- ->json_is("/response/0/targets/0/deliveryService", "target-ds1")
- ->json_is("/response/0/targets/0/weight", 1000)
- ->json_is("/response/0/filters/0/deliveryService", "target-ds1")
- ->json_is("/response/0/filters/0/pattern", ".*/force-to-one-also/.*")
- ->json_is("/response/0/filters/1/deliveryService", "target-ds1")
- ->json_is("/response/0/filters/1/pattern", ".*/force-to-one/.*")
- ->json_is("/response/0/targets/1/deliveryService", "target-ds2")
- ->json_is("/response/0/targets/1/weight", 7654)
- ->json_is("/response/1/deliveryService", "steering-ds2")
- ->json_is("/response/1/targets/0/deliveryService", "target-ds3")
- ->json_is("/response/1/targets/0/weight", 123)
- ->json_is("/response/1/filters/0/pattern", ".*/use-three/.*")
- ->json_is("/response/1/filters/0/deliveryService", "target-ds3")
- ->json_is("/response/1/targets/1/deliveryService", "target-ds4")
- ->json_is("/response/1/targets/1/weight", 999)
- ->json_is("/response/1/filters/1/pattern", ".*/go-to-four/.*")
- ->json_is("/response/1/filters/1/deliveryService", "target-ds4");
-
-ok $t->get_ok("/internal/api/1.2/steering/steering-ds1.json")->status_is(200)
- ->or(sub {diag $t->tx->res->headers->to_string();})
- ->json_is("/response/deliveryService", "steering-ds1")
- ->json_is("/response/targets/0/deliveryService", "target-ds1")
- ->json_is("/response/targets/0/weight", 1000)
- ->json_is("/response/filters/0/pattern", ".*/force-to-one-also/.*")
- ->json_is("/response/filters/1/pattern", ".*/force-to-one/.*");
-
-ok $t->post_ok("/internal/api/1.2/steering",
- json => {
- "stuff" => "junk",
- }
- )->status_is(400)
- ->or(sub {diag $t->tx->res->headers->to_string();});
-
-ok $t->post_ok("/internal/api/1.2/steering",
- json => {
- "deliveryService" => "steering-ds1"
- }
- )->status_is(400)
- ->or(sub {diag $t->tx->res->headers->to_string();});
-
-ok $t->post_ok("/internal/api/1.2/steering",
- json => {
- "deliveryService" => "steering-ds1",
- "targets" => "stuff"
- }
- )->status_is(400)
- ->or(sub {diag $t->tx->res->headers->to_string();});
-
-ok $t->post_ok("/internal/api/1.2/steering",
- json => {
- "deliveryService" => "steering-ds1",
- "targets" => [
- {"deliveryService" => "example"},
- {"woops" => "example"},
- ]
- }
- )->status_is(400)
- ->or(sub {diag $t->tx->res->headers->to_string();});
-
-ok $t->post_ok("/internal/api/1.2/steering",
- json => {
- "deliveryService" => "nonexistent-ds",
- "targets" => [
- {"deliveryService" => "target-ds1"},
- {"deliveryService" => "target-ds3"}
- ]
- }
- )->status_is(409)
- ->or(sub {diag $t->tx->res->headers->to_string();});
-
-ok $t->post_ok("/internal/api/1.2/steering",
- json => {
- "deliveryService" => "steering-ds1",
- "targets" => [
- {"deliveryService" => "nonexistent-ds1"},
- {"deliveryService" => "target-ds3"}
- ]
- }
- )->status_is(409)
- ->or(sub {diag $t->tx->res->headers->to_string();});
-
-ok $t->post_ok("/internal/api/1.2/steering",
- json => {
- "deliveryService" => "new-steering-ds",
- "targets" => [
- {"deliveryService" => "target-ds1"},
- {"deliveryService" => "target-ds3"}
- ]
- }
- )->status_is(201)
- ->header_is('Location', "/internal/api/1.2/steering/new-steering-ds.json")
- ->or(sub {diag $t->tx->res->headers->to_string();});
-
-$t->post_ok("/api/1.2/user/logout")->status_is(200);
-
-####### Steering User 1 ################################################################################
-ok $t->post_ok( "/api/1.2/user/login", => json => { u => Test::TestHelper::STEERING_USER_1, p => Test::TestHelper::STEERING_PASSWORD_1 } )
- ->status_is(200)
- ->or( sub { diag $t->tx->res->content->asset->{content}; } );
-
-ok $t->get_ok("/internal/api/1.2/steering.json")->status_is(200)
- ->or( sub { diag $t->tx->res->headers->to_string(); } )
- ->json_is("/response/0/deliveryService", "steering-ds1")
- ->json_is("/response/0/targets/0/deliveryService", "target-ds1")
- ->json_is("/response/0/targets/0/weight", 1000)
- ->json_is("/response/0/filters/0/pattern", ".*/force-to-one-also/.*")
- ->json_is("/response/0/filters/1/pattern", ".*/force-to-one/.*")
- ->json_hasnt("/response/0/filters/2/pattern")
- ->json_is("/response/0/targets/1/deliveryService", "target-ds2")
- ->json_is("/response/0/targets/1/weight", 7654)
- ->json_hasnt("/response/0/filters/1/filter/0")
- ->json_hasnt("/response/1");
-
-ok $t->post_ok("/internal/api/1.2/steering", json => { "something" => "value" } )->status_is(401)
- ->or(sub {diag $t->tx->res->headers->to_string();});
-
-ok $t->get_ok("/internal/api/1.2/steering/steering-ds2.json")->status_is(404)
- ->or( sub { diag $t->tx->res->content->asset->{content}; } );
-
-ok $t->put_ok("/internal/api/1.2/steering/steering-ds2", json => {"any" => "thing"})->status_is(401)
- ->or( sub { diag $t->tx->res->headers->to_string(); } );
-
-ok $t->put_ok("/internal/api/1.2/steering/steering-ds1",
- json => {
- "targets" => [
- { "deliveryService" => "target-ds1", "weight" => 5555 },
- { "deliveryService" => "target-ds2", "weight" => 4444 }
- ],
- "filters" => [
- {
- "deliveryService" => "target-ds3",
- "pattern" => ".*/force-to-one/.*"
- },
- ]
- })
- ->status_is(409);
-
-ok $t->put_ok("/internal/api/1.2/steering/steering-ds1",
- json => {
- "targets" => [
- {
- "deliveryService" => "target-ds1",
- "weight" => 5555
- },
- {
- "deliveryService" => "target-ds2",
- "weight" => 4444
- }
- ],
- "filters" => [
- {
- "deliveryService" => "target-ds1",
- "pattern" => ".*/force-to-one/.*"
- },
- {
- "deliveryService" => "target-ds1",
- "pattern" => ".*/andnowforsomethingcompletelydifferent/.*"
- },
- {
- "deliveryService" => "target-ds2",
- "pattern" => ".*/always-two/.*"
- },
- ]
- })
- ->status_is(200)->or(sub { diag $t->tx->res->headers->to_string(); })
- ->json_is("/response/deliveryService", "steering-ds1")
- ->json_is("/response/targets/0/deliveryService", "target-ds1")
- ->json_is("/response/targets/0/weight", 5555)
- ->json_is("/response/targets/1/deliveryService", "target-ds2")
- ->json_is("/response/targets/1/weight", 4444)
- ->json_is("/response/filters/0/pattern", ".*/andnowforsomethingcompletelydifferent/.*")
- ->json_is("/response/filters/1/pattern", ".*/force-to-one/.*")
- ->json_is("/response/filters/2/pattern", ".*/always-two/.*" );
-
-ok $t->get_ok("/internal/api/1.2/steering/steering-ds1.json")
- ->status_is(200)->or(sub { diag $t->tx->res->headers->to_string(); })
- ->json_is("/response/deliveryService", "steering-ds1")
- ->json_is("/response/targets/0/deliveryService", "target-ds1")
- ->json_is("/response/targets/0/weight", 5555)
- ->json_is("/response/targets/1/deliveryService", "target-ds2")
- ->json_is("/response/targets/1/weight", 4444)
- ->json_is("/response/filters/0/pattern", ".*/andnowforsomethingcompletelydifferent/.*")
- ->json_is("/response/filters/1/pattern", ".*/force-to-one/.*")
- ->json_is("/response/filters/2/pattern", ".*/always-two/.*" );
-
-ok $t->put_ok("/internal/api/1.2/steering/steering-ds1",
- json => {
- "targets" => [
- {
- "deliveryService" => "target-ds1",
- "weight" => 1111
- },
- {
- "deliveryService" => "target-ds2",
- "weight" => 8888
- }
- ]
- })
- ->status_is(200)->or(sub { diag $t->tx->res->headers->to_string(); })
- ->json_is("/response/deliveryService", "steering-ds1")
- ->json_is("/response/targets/0/deliveryService", "target-ds1")
- ->json_is("/response/targets/0/weight", 1111)
- ->json_hasnt("/response/filter/0/pattern")
- ->json_is("/response/targets/1/deliveryService", "target-ds2")
- ->json_is("/response/targets/1/weight", 8888)
- ->json_is("/response/filters/2/pattern", ".*/always-two/.*" );
-
-ok $t->get_ok("/internal/api/1.2/steering/steering-ds1.json")
- ->status_is(200)->or(sub { diag $t->tx->res->headers->to_string(); })
- ->json_is("/response/deliveryService", "steering-ds1")
- ->json_is("/response/targets/0/deliveryService", "target-ds1")
- ->json_is("/response/targets/0/weight", 1111)
- ->json_hasnt("/response/filter/0/pattern")
- ->json_is("/response/targets/1/deliveryService", "target-ds2")
- ->json_is("/response/targets/1/weight", 8888)
- ->json_is("/response/filters/2/pattern", ".*/always-two/.*" );
-
-#bad json
-ok $t->put_ok("/internal/api/1.2/steering/steering-ds1",
- json => {"foo" => "bar"})
- ->status_is(400)
- ->json_is("/message", "please provide a valid json including targets");
-
-#remove filters for single DS
-ok $t->put_ok("/internal/api/1.2/steering/steering-ds1",
- json => {
- "targets" => [
- {
- "deliveryService" => "target-ds1",
- "weight" => 5555
- },
- {
- "deliveryService" => "target-ds2",
- "weight" => 4444
- }
- ],
- "filters" => [
- {
- "deliveryService" => "target-ds1",
- "pattern" => ".*/force-to-one/.*"
- }
- ]
- })
- ->status_is(200)->or(sub { diag $t->tx->res->headers->to_string(); })
- ->json_is("/response/deliveryService", "steering-ds1")
- ->json_is("/response/targets/0/deliveryService", "target-ds1")
- ->json_is("/response/targets/0/weight", 5555)
- ->json_is("/response/targets/1/deliveryService", "target-ds2")
- ->json_is("/response/targets/1/weight", 4444)
- ->json_hasnt("/response/filters/1/pattern");
-
- #remove all filters
-ok $t->put_ok("/internal/api/1.2/steering/steering-ds1",
- json => {
- "targets" => [
- {
- "deliveryService" => "target-ds1",
- "weight" => 5555
- },
- {
- "deliveryService" => "target-ds2",
- "weight" => 4444
- }
- ],
- "filters" => []
- })
- ->status_is(200)->or(sub { diag $t->tx->res->headers->to_string(); })
- ->json_is("/response/deliveryService", "steering-ds1")
- ->json_is("/response/targets/0/deliveryService", "target-ds1")
- ->json_is("/response/targets/0/weight", 5555)
- ->json_is("/response/targets/1/deliveryService", "target-ds2")
- ->json_is("/response/targets/1/weight", 4444)
- ->json_hasnt("/response/filters/0/pattern");
-
-#invalid json
-ok $t->put_ok("/internal/api/1.2/steering/steering-ds1",
- json => {
- "targets" => [
- {
- "deliveryService" => "target-ds1",
- "weight" => 5555
- },
- {
- "deliveryService" => "target-ds2",
- "weight" => 4444
- }
- ],
- "filters" => [
- {
- "pattern" => ".*/force-to-one/.*"
- }
- ]
- })
- ->status_is(400)
- ->json_is("/message", "please provide a valid json for filters");
-
-ok $t->put_ok("/internal/api/1.2/steering/steering-ds1",
- json => {
- "targets" => [
- {
- "deliveryService" => "target-ds1",
- "weight" => 5555
- },
- {
- "deliveryService" => "target-ds2",
- "weight" => 4444
- }
- ],
- "filters" => [
- {
- "deliveryService" => "target-ds1"
- }
- ]
- })
- ->status_is(400)
- ->json_is("/message", "please provide a valid json for filters");
-
-ok $t->put_ok("/internal/api/1.2/steering/steering-ds1",
- json => {
- "filters" => [
- {
- "deliveryService" => "target-ds1",
- "pattern" => ".*/force-to-one/.*"
- }
- ]
- })
- ->status_is(400)->json_is("/message", "please provide a valid json including targets");
-
-ok $t->put_ok("/internal/api/1.2/steering/steering-ds1",
- json => {
- "targets" => [
- {
- "deliveryService" => "target-ds1",
- },
- {
- "deliveryService" => "target-ds2",
- "weight" => 4444
- }
- ]
- })
- ->status_is(400)->json_is("/message", "please provide a valid json for targets");
-
-
-$t->post_ok("/api/1.2/user/logout")->status_is(200);
-
-$dbh->disconnect();
-done_testing();
-