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 19:05:34 UTC
[19/40] incubator-trafficcontrol git commit: realigned the ids so
that the fixture ids are higher than the generated ones
realigned the ids so that the fixture ids are higher than the generated ones
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/028cdd3f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/028cdd3f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/028cdd3f
Branch: refs/heads/psql-rebase
Commit: 028cdd3f0d717cd3bdce820c2f18ae733c4ea6d4
Parents: 68fb685
Author: Dewayne Richardson <de...@apache.org>
Authored: Thu Nov 17 10:37:27 2016 -0700
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Mon Nov 21 12:04:09 2016 -0700
----------------------------------------------------------------------
traffic_ops/app/lib/Fixtures/Deliveryservice.pm | 30 +++---
.../app/lib/Fixtures/DeliveryserviceRegex.pm | 58 +++++-----
.../app/lib/Fixtures/DeliveryserviceServer.pm | 18 ++--
.../app/lib/Fixtures/DeliveryserviceTmuser.pm | 8 +-
traffic_ops/app/lib/Fixtures/Division.pm | 3 +-
traffic_ops/app/lib/Fixtures/Federation.pm | 10 +-
.../lib/Fixtures/FederationDeliveryservice.pm | 8 +-
.../app/lib/Fixtures/FederationResolver.pm | 18 ++--
.../app/lib/Fixtures/FederationTmuser.pm | 9 +-
traffic_ops/app/lib/Fixtures/Hwinfo.pm | 37 ++++++-
traffic_ops/app/lib/Fixtures/JobAgent.pm | 4 +-
traffic_ops/app/lib/Fixtures/JobStatus.pm | 34 +++---
traffic_ops/app/lib/Fixtures/Log.pm | 4 +-
traffic_ops/app/lib/Fixtures/Parameter.pm | 2 +-
traffic_ops/app/lib/Fixtures/PhysLocation.pm | 36 +++----
traffic_ops/app/lib/Fixtures/Regex.pm | 26 ++---
traffic_ops/app/lib/Fixtures/Role.pm | 2 +-
traffic_ops/app/lib/Fixtures/Staticdnsentry.pm | 17 +--
traffic_ops/app/lib/Fixtures/SteeringTarget.pm | 2 +-
traffic_ops/app/lib/UI/DeliveryService.pm | 3 +-
traffic_ops/app/t/deliveryservice.t | 106 ++++++++++---------
21 files changed, 236 insertions(+), 199 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/028cdd3f/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 7198e01..d9f5a34 100644
--- a/traffic_ops/app/lib/Fixtures/Deliveryservice.pm
+++ b/traffic_ops/app/lib/Fixtures/Deliveryservice.pm
@@ -22,7 +22,7 @@ my %definition_for = (
ds_cdn1 => {
new => 'Deliveryservice',
using => {
- id => 1,
+ id => 100,
xml_id => 'test-ds1',
active => 1,
dscp => 40,
@@ -60,7 +60,7 @@ my %definition_for = (
ds_cdn2 => {
new => 'Deliveryservice',
using => {
- id => 2,
+ id => 200,
xml_id => 'test-ds2',
active => 1,
dscp => 40,
@@ -98,7 +98,7 @@ my %definition_for = (
ds_cdn3 => {
new => 'Deliveryservice',
using => {
- id => 3,
+ id => 300,
xml_id => 'test-ds3',
active => 1,
dscp => 40,
@@ -136,7 +136,7 @@ my %definition_for = (
ds_cdn4 => {
new => 'Deliveryservice',
using => {
- id => 4,
+ id => 400,
xml_id => 'test-ds4',
active => 1,
dscp => 40,
@@ -174,7 +174,7 @@ my %definition_for = (
ds_dns => {
new => 'Deliveryservice',
using => {
- id => 5,
+ id => 500,
xml_id => 'test-ds5',
active => 1,
dscp => 40,
@@ -212,7 +212,7 @@ my %definition_for = (
ds_http_no_cache => {
new => 'Deliveryservice',
using => {
- id => 6,
+ id => 600,
xml_id => 'test-ds6',
active => 1,
dscp => 40,
@@ -250,7 +250,7 @@ my %definition_for = (
steering_ds1 => {
new => 'Deliveryservice',
using => {
- id => 7,
+ id => 700,
xml_id => 'steering-ds1',
active => 1,
dscp => 40,
@@ -286,7 +286,7 @@ my %definition_for = (
steering_ds2 => {
new => 'Deliveryservice',
using => {
- id => 8,
+ id => 800,
xml_id => 'steering-ds2',
active => 1,
dscp => 40,
@@ -322,7 +322,7 @@ my %definition_for = (
new_steering => {
new => 'Deliveryservice',
using => {
- id => 9,
+ id => 900,
xml_id => 'steering-ds3',
active => 1,
dscp => 40,
@@ -355,11 +355,10 @@ my %definition_for = (
regional_geo_blocking => 1,
},
},
- ## id => 4
target_ds1 => {
new => 'Deliveryservice',
using => {
- id => 10,
+ id => 1000,
xml_id => 'steering-target-ds1',
active => 1,
dscp => 40,
@@ -392,11 +391,10 @@ my %definition_for = (
regional_geo_blocking => 1,
},
},
- ## id => 5
target_ds2 => {
new => 'Deliveryservice',
using => {
- id => 11,
+ id => 1100,
xml_id => 'steering-target-ds2',
active => 1,
dscp => 40,
@@ -429,11 +427,10 @@ my %definition_for = (
regional_geo_blocking => 1,
},
},
- ## id => 6
target_ds3 => {
new => 'Deliveryservice',
using => {
- id => 12,
+ id => 1200,
xml_id => 'steering-target-ds3',
active => 1,
dscp => 40,
@@ -466,11 +463,10 @@ my %definition_for = (
regional_geo_blocking => 1,
},
},
- ## id => 7
target_ds4 => {
new => 'Deliveryservice',
using => {
- id => 13,
+ id => 1300,
xml_id => 'steering-target-ds4',
active => 1,
dscp => 40,
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/028cdd3f/traffic_ops/app/lib/Fixtures/DeliveryserviceRegex.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/DeliveryserviceRegex.pm b/traffic_ops/app/lib/Fixtures/DeliveryserviceRegex.pm
index f1716b1..1627636 100644
--- a/traffic_ops/app/lib/Fixtures/DeliveryserviceRegex.pm
+++ b/traffic_ops/app/lib/Fixtures/DeliveryserviceRegex.pm
@@ -18,107 +18,107 @@ extends 'DBIx::Class::EasyFixture';
use namespace::autoclean;
my %definition_for = (
- regex2 => {
+ regex1 => {
new => 'DeliveryserviceRegex',
using => {
- deliveryservice => 9,
- regex => 7,
+ deliveryservice => 100,
+ regex => 200,
set_number => 0,
},
},
- target_r1_filter => {
+ regex2 => {
new => 'DeliveryserviceRegex',
using => {
- deliveryservice => 4,
- regex => 1,
+ deliveryservice => 200,
+ regex => 100,
set_number => 0,
},
},
- regex1 => {
+ target_r1_filter => {
new => 'DeliveryserviceRegex',
using => {
- deliveryservice => 8,
- regex => 5,
+ deliveryservice => 400,
+ regex => 100,
set_number => 0,
},
},
target_r2_filter => {
new => 'DeliveryserviceRegex',
using => {
- deliveryservice => 4,
- regex => 2,
+ deliveryservice => 400,
+ regex => 200,
set_number => 0,
},
},
target_r4_filter => {
new => 'DeliveryserviceRegex',
using => {
- deliveryservice => 7,
- regex => 3,
+ deliveryservice => 700,
+ regex => 300,
set_number => 0,
},
},
target_r3_filter => {
new => 'DeliveryserviceRegex',
using => {
- deliveryservice => 6,
- regex => 4,
+ deliveryservice => 600,
+ regex => 400,
set_number => 0,
},
},
new_steering => {
new => 'DeliveryserviceRegex',
using => {
- deliveryservice => 3,
- regex => 6,
+ deliveryservice => 300,
+ regex => 600,
set_number => 0,
},
},
steering_1 => {
new => 'DeliveryserviceRegex',
using => {
- deliveryservice => 1,
- regex => 8,
+ deliveryservice => 100,
+ regex => 800,
set_number => 0,
},
},
steering_2 => {
new => 'DeliveryserviceRegex',
using => {
- deliveryservice => 2,
- regex => 9,
+ deliveryservice => 200,
+ regex => 900,
set_number => 0,
},
},
target_1 => {
new => 'DeliveryserviceRegex',
using => {
- deliveryservice => 4,
- regex => 10,
+ deliveryservice => 400,
+ regex => 1000,
set_number => 0,
},
},
target_2 => {
new => 'DeliveryserviceRegex',
using => {
- deliveryservice => 5,
- regex => 11,
+ deliveryservice => 500,
+ regex => 1100,
set_number => 0,
},
},
target_3 => {
new => 'DeliveryserviceRegex',
using => {
- deliveryservice => 6,
- regex => 12,
+ deliveryservice => 600,
+ regex => 1200,
set_number => 0,
},
},
target_4 => {
new => 'DeliveryserviceRegex',
using => {
- deliveryservice => 7,
- regex => 13,
+ deliveryservice => 700,
+ regex => 1300,
set_number => 0,
},
},
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/028cdd3f/traffic_ops/app/lib/Fixtures/DeliveryserviceServer.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/DeliveryserviceServer.pm b/traffic_ops/app/lib/Fixtures/DeliveryserviceServer.pm
index 7f61b8a..a518602 100644
--- a/traffic_ops/app/lib/Fixtures/DeliveryserviceServer.pm
+++ b/traffic_ops/app/lib/Fixtures/DeliveryserviceServer.pm
@@ -21,63 +21,63 @@ my %definition_for = (
test_ds1_server_edge1 => {
new => 'DeliveryserviceServer',
using => {
- deliveryservice => 1,
+ deliveryservice => 100,
server => 1,
},
},
test_ds1_server_edge13 => {
new => 'DeliveryserviceServer',
using => {
- deliveryservice => 1,
+ deliveryservice => 100,
server => 13,
},
},
test_ds1_server_mid1 => {
new => 'DeliveryserviceServer',
using => {
- deliveryservice => 1,
+ deliveryservice => 100,
server => 2,
},
},
test_ds2_server_edge1 => {
new => 'DeliveryserviceServer',
using => {
- deliveryservice => 2,
+ deliveryservice => 200,
server => 7,
},
},
test_ds2_server_mid1 => {
new => 'DeliveryserviceServer',
using => {
- deliveryservice => 2,
+ deliveryservice => 200,
server => 8,
},
},
test_ds5_server_edge14 => {
new => 'DeliveryserviceServer',
using => {
- deliveryservice => 5,
+ deliveryservice => 500,
server => 14,
},
},
test_ds5_server_edge15 => {
new => 'DeliveryserviceServer',
using => {
- deliveryservice => 5,
+ deliveryservice => 500,
server => 15,
},
},
test_ds6_server_edge14 => {
new => 'DeliveryserviceServer',
using => {
- deliveryservice => 6,
+ deliveryservice => 600,
server => 14,
},
},
test_ds6_server_edge15 => {
new => 'DeliveryserviceServer',
using => {
- deliveryservice => 6,
+ deliveryservice => 600,
server => 15,
},
},
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/028cdd3f/traffic_ops/app/lib/Fixtures/DeliveryserviceTmuser.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/DeliveryserviceTmuser.pm b/traffic_ops/app/lib/Fixtures/DeliveryserviceTmuser.pm
index d27e932..2e03281 100644
--- a/traffic_ops/app/lib/Fixtures/DeliveryserviceTmuser.pm
+++ b/traffic_ops/app/lib/Fixtures/DeliveryserviceTmuser.pm
@@ -21,28 +21,28 @@ my %definition_for = (
admin => {
new => 'DeliveryserviceTmuser',
using => {
- deliveryservice => 1,
+ deliveryservice => 100,
tm_user_id => 1,
},
},
portal_ds1 => {
new => 'DeliveryserviceTmuser',
using => {
- deliveryservice => 1,
+ deliveryservice => 100,
tm_user_id => 2,
},
},
ds_steering_user1 => {
new => 'DeliveryserviceTmuser',
using => {
- deliveryservice => 1,
+ deliveryservice => 700,
tm_user_id => 7,
},
},
ds_steering_user2 => {
new => 'DeliveryserviceTmuser',
using => {
- deliveryservice => 2,
+ deliveryservice => 800,
tm_user_id => 7,
},
},
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/028cdd3f/traffic_ops/app/lib/Fixtures/Division.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/Division.pm b/traffic_ops/app/lib/Fixtures/Division.pm
index 984f556..5a1f8d5 100644
--- a/traffic_ops/app/lib/Fixtures/Division.pm
+++ b/traffic_ops/app/lib/Fixtures/Division.pm
@@ -22,6 +22,7 @@ my %definition_for = (
mountain => {
new => 'Division',
using => {
+ id => 1,
name => 'mountain',
},
},
@@ -34,7 +35,7 @@ sub get_definition {
sub all_fixture_names {
# sort by db name to guarantee insertion order
- return (sort { $definition_for{$a}{using}{name} cmp $definition_for{$b}{using}{name} } keys %definition_for);
+ return (sort { $definition_for{$a}{using}{id} cmp $definition_for{$b}{using}{id} } keys %definition_for);
}
__PACKAGE__->meta->make_immutable;
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/028cdd3f/traffic_ops/app/lib/Fixtures/Federation.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/Federation.pm b/traffic_ops/app/lib/Fixtures/Federation.pm
index e5c8b7f..788b81b 100644
--- a/traffic_ops/app/lib/Fixtures/Federation.pm
+++ b/traffic_ops/app/lib/Fixtures/Federation.pm
@@ -21,37 +21,37 @@ use namespace::autoclean;
use Digest::SHA1 qw(sha1_hex);
my %definition_for = (
- ## id => 1
name1 => {
new => 'Federation',
using => {
+ id => 1,
cname => 'cname1.',
description => 'resolver4 type',
ttl => 86400,
},
},
- ## id => 2
name2 => {
new => 'Federation',
using => {
+ id => 2,
cname => 'cname2.',
description => 'resolver4 type',
ttl => 86400,
},
},
- ## id => 3
name3 => {
new => 'Federation',
using => {
+ id => 3,
cname => 'cname3.',
description => 'resolver4 type',
ttl => 86400,
},
},
- ## id => 4
name4 => {
new => 'Federation',
using => {
+ id => 4,
cname => 'cname4.',
description => 'resolver4 type',
ttl => 86400,
@@ -66,7 +66,7 @@ sub get_definition {
sub all_fixture_names {
# sort by db cname to guarantee insertion order
- return (sort { $definition_for{$a}{using}{cname} cmp $definition_for{$b}{using}{cname} } keys %definition_for);
+ return (sort { $definition_for{$a}{using}{id} cmp $definition_for{$b}{using}{id} } keys %definition_for);
}
__PACKAGE__->meta->make_immutable;
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/028cdd3f/traffic_ops/app/lib/Fixtures/FederationDeliveryservice.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/FederationDeliveryservice.pm b/traffic_ops/app/lib/Fixtures/FederationDeliveryservice.pm
index 6b1c810..29a421e 100644
--- a/traffic_ops/app/lib/Fixtures/FederationDeliveryservice.pm
+++ b/traffic_ops/app/lib/Fixtures/FederationDeliveryservice.pm
@@ -25,28 +25,28 @@ my %definition_for = (
new => 'FederationDeliveryservice',
using => {
federation => 1,
- deliveryservice => 8,
+ deliveryservice => 1,
},
},
federation_deliveryservice2 => {
new => 'FederationDeliveryservice',
using => {
federation => 2,
- deliveryservice => 9,
+ deliveryservice => 2,
},
},
federation_deliveryservice3 => {
new => 'FederationDeliveryservice',
using => {
federation => 3,
- deliveryservice => 10,
+ deliveryservice => 3,
},
},
federation_deliveryservice4 => {
new => 'FederationDeliveryservice',
using => {
federation => 4,
- deliveryservice => 11,
+ deliveryservice => 4,
},
},
);
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/028cdd3f/traffic_ops/app/lib/Fixtures/FederationResolver.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/FederationResolver.pm b/traffic_ops/app/lib/Fixtures/FederationResolver.pm
index 6e879f6..9d0730f 100644
--- a/traffic_ops/app/lib/Fixtures/FederationResolver.pm
+++ b/traffic_ops/app/lib/Fixtures/FederationResolver.pm
@@ -21,36 +21,36 @@ use namespace::autoclean;
use Digest::SHA1 qw(sha1_hex);
my %definition_for = (
- ## id => 1
ipv4_resolver1 => {
new => 'FederationResolver',
using => {
+ id => 1,
ip_address => "127.0.0.1/32",
- type => 24,
+ type => 33,
},
},
- ## id => 2
ipv4_resolver2 => {
new => 'FederationResolver',
using => {
+ id => 2,
ip_address => "127.0.0.2/32",
- type => 24,
+ type => 33,
},
},
- ## id => 3
ipv6_resolver1 => {
new => 'FederationResolver',
using => {
+ id => 3,
ip_address => "FE80::0202:B3FF:FE1E:8329/128",
- type => 25,
+ type => 34,
},
},
- ## id => 4
ipv6_resolver2 => {
new => 'FederationResolver',
using => {
+ id => 4,
ip_address => "FE80::0202:B3FF:FE1E:8330/128",
- type => 25,
+ type => 34,
},
},
);
@@ -62,7 +62,7 @@ sub get_definition {
sub all_fixture_names {
# sort by db ip_address to guarantee insertion order
- return (sort { $definition_for{$a}{using}{ip_address} cmp $definition_for{$b}{using}{ip_address} } keys %definition_for);
+ return (sort { $definition_for{$a}{using}{id} cmp $definition_for{$b}{using}{id} } keys %definition_for);
}
__PACKAGE__->meta->make_immutable;
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/028cdd3f/traffic_ops/app/lib/Fixtures/FederationTmuser.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/FederationTmuser.pm b/traffic_ops/app/lib/Fixtures/FederationTmuser.pm
index 54f4999..a9d5f13 100644
--- a/traffic_ops/app/lib/Fixtures/FederationTmuser.pm
+++ b/traffic_ops/app/lib/Fixtures/FederationTmuser.pm
@@ -25,20 +25,21 @@ my %definition_for = (
new => 'FederationTmuser',
using => {
federation => 1,
- tm_user => 3,
- role => 3,
+ tm_user => 5,
+ role => 7,
},
},
federation_tm_user2 => {
new => 'FederationTmuser',
using => {
federation => 2,
- tm_user => 3,
- role => 3,
+ tm_user => 5,
+ role => 7,
},
}
);
+
sub get_definition {
my ( $self, $name ) = @_;
return $definition_for{$name};
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/028cdd3f/traffic_ops/app/lib/Fixtures/Hwinfo.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/Hwinfo.pm b/traffic_ops/app/lib/Fixtures/Hwinfo.pm
index 4ba9cdb..b9a24c2 100644
--- a/traffic_ops/app/lib/Fixtures/Hwinfo.pm
+++ b/traffic_ops/app/lib/Fixtures/Hwinfo.pm
@@ -19,24 +19,51 @@ use namespace::autoclean;
use Digest::SHA1 qw(sha1_hex);
my %definition_for = (
- ## id => 1
hw1 => {
new => 'Hwinfo',
using => {
- serverid => 2,
+ id => 1,
+ serverid => 1,
description => 'BACKPLANE FIRMWA',
val => '7.0.0.29',
},
},
- ## id => 2
hw2 => {
new => 'Hwinfo',
using => {
- serverid => 4,
+ id => 2,
+ serverid => 2,
description => 'DRAC FIRMWA',
val => '1.0.0.29',
},
- }
+ },
+ hw3 => {
+ new => 'Hwinfo',
+ using => {
+ id => 3,
+ serverid => 2,
+ description => 'ServiceTag',
+ val => 'XXX',
+ },
+ },
+ hw4 => {
+ new => 'Hwinfo',
+ using => {
+ id => 4,
+ serverid => 2,
+ description => 'Manufacturer',
+ val => 'Dell Inc.',
+ },
+ },
+ hw5 => {
+ new => 'Hwinfo',
+ using => {
+ id => 5,
+ serverid => 2,
+ description => 'Model',
+ val => 'Beetle',
+ },
+ },
);
sub get_definition {
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/028cdd3f/traffic_ops/app/lib/Fixtures/JobAgent.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/JobAgent.pm b/traffic_ops/app/lib/Fixtures/JobAgent.pm
index 8ad3d7b..0fc224e 100644
--- a/traffic_ops/app/lib/Fixtures/JobAgent.pm
+++ b/traffic_ops/app/lib/Fixtures/JobAgent.pm
@@ -18,10 +18,10 @@ extends 'DBIx::Class::EasyFixture';
use namespace::autoclean;
my %definition_for = (
- ## id => 1
agent1 => {
new => 'JobAgent',
using => {
+ id => 1,
name => 'agent1',
description => 'Test Agent1'
},
@@ -35,7 +35,7 @@ sub get_definition {
sub all_fixture_names {
# sort by db name to guarantee insertion order
- return (sort { $definition_for{$a}{using}{name} cmp $definition_for{$b}{using}{name} } keys %definition_for);
+ return (sort { $definition_for{$a}{using}{id} cmp $definition_for{$b}{using}{id} } keys %definition_for);
}
__PACKAGE__->meta->make_immutable;
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/028cdd3f/traffic_ops/app/lib/Fixtures/JobStatus.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/JobStatus.pm b/traffic_ops/app/lib/Fixtures/JobStatus.pm
index bb30cf6..5bab0c6 100644
--- a/traffic_ops/app/lib/Fixtures/JobStatus.pm
+++ b/traffic_ops/app/lib/Fixtures/JobStatus.pm
@@ -18,36 +18,36 @@ extends 'DBIx::Class::EasyFixture';
use namespace::autoclean;
my %definition_for = (
- ## id => 1
- cancelled => {
+ pending => {
new => 'JobStatus',
using => {
- name => 'CANCELLED',
- description => 'Job was cancelled'
+ id => 1,
+ name => 'PENDING',
+ description => 'Job is queued, but has not been picked up by any agents yet'
},
},
- ## id => 2
- completed => {
+ in_progress => {
new => 'JobStatus',
using => {
- name => 'COMPLETED',
- description => 'Job has finished'
+ id => 2,
+ name => 'IN_PROGRESS',
+ description => 'Job is being processed by agents'
},
},
- ## id => 3
- in_progress => {
+ completed => {
new => 'JobStatus',
using => {
- name => 'IN_PROGRESS',
- description => 'Job is being processed by agents'
+ id => 3,
+ name => 'COMPLETED',
+ description => 'Job has finished'
},
},
- ## id => 4
- pending => {
+ cancelled => {
new => 'JobStatus',
using => {
- name => 'PENDING',
- description => 'Job is queued, but has not been picked up by any agents yet'
+ id => 4,
+ name => 'CANCELLED',
+ description => 'Job was cancelled'
},
},
);
@@ -59,7 +59,7 @@ sub get_definition {
sub all_fixture_names {
# sort by db name to guarantee insertion order
- return (sort { $definition_for{$a}{using}{name} cmp $definition_for{$b}{using}{name} } keys %definition_for);
+ return (sort { $definition_for{$a}{using}{id} cmp $definition_for{$b}{using}{id} } keys %definition_for);
}
__PACKAGE__->meta->make_immutable;
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/028cdd3f/traffic_ops/app/lib/Fixtures/Log.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/Log.pm b/traffic_ops/app/lib/Fixtures/Log.pm
index cc2d5e1..838a00b 100644
--- a/traffic_ops/app/lib/Fixtures/Log.pm
+++ b/traffic_ops/app/lib/Fixtures/Log.pm
@@ -18,20 +18,20 @@ extends 'DBIx::Class::EasyFixture';
use namespace::autoclean;
my %definition_for = (
- ## id => 1
message1 => {
new => 'Log',
using => {
+ id => 1,
level => 'APICHANGE',
ticketnum => 123,
message => 'Message1',
tm_user => 1,
},
},
- ## id => 2
message2 => {
new => 'Log',
using => {
+ id => 2,
level => 'APICHANGE',
ticketnum => 456,
message => 'Message2',
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/028cdd3f/traffic_ops/app/lib/Fixtures/Parameter.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/Parameter.pm b/traffic_ops/app/lib/Fixtures/Parameter.pm
index 3a07cb6..a3d18b0 100644
--- a/traffic_ops/app/lib/Fixtures/Parameter.pm
+++ b/traffic_ops/app/lib/Fixtures/Parameter.pm
@@ -587,7 +587,7 @@ sub get_definition {
sub all_fixture_names {
# sort by db name to guarantee insertion order
- return (sort { lc($definition_for{$a}{using}{id}) cmp lc($definition_for{$b}{using}{name}) } keys %definition_for);
+ return (sort { lc($definition_for{$a}{using}{id}) cmp lc($definition_for{$b}{using}{id}) } keys %definition_for);
}
__PACKAGE__->meta->make_immutable;
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/028cdd3f/traffic_ops/app/lib/Fixtures/PhysLocation.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/PhysLocation.pm b/traffic_ops/app/lib/Fixtures/PhysLocation.pm
index 9f05055..e2026e1 100644
--- a/traffic_ops/app/lib/Fixtures/PhysLocation.pm
+++ b/traffic_ops/app/lib/Fixtures/PhysLocation.pm
@@ -18,44 +18,44 @@ extends 'DBIx::Class::EasyFixture';
use namespace::autoclean;
my %definition_for = (
- ## id => 1
- boulder => {
+ denver => {
new => 'PhysLocation',
using => {
- name => 'Boulder',
- short_name => 'boulder',
- address => '1234 green way',
- city => 'Boulder',
+ id => 1,
+ name => 'Denver',
+ short_name => 'denver',
+ address => '1234 mile high circle',
+ city => 'Denver',
state => 'CO',
- zip => '80301',
+ zip => '80202',
poc => undef,
- phone => '303-222-2222',
+ phone => '303-111-1111',
email => undef,
comments => undef,
region => 1,
},
},
- ## id => 2
- denver => {
+ boulder => {
new => 'PhysLocation',
using => {
- name => 'Denver',
- short_name => 'denver',
- address => '1234 mile high circle',
- city => 'Denver',
+ id => 2,
+ name => 'Boulder',
+ short_name => 'boulder',
+ address => '1234 green way',
+ city => 'Boulder',
state => 'CO',
- zip => '80202',
+ zip => '80301',
poc => undef,
- phone => '303-111-1111',
+ phone => '303-222-2222',
email => undef,
comments => undef,
region => 1,
},
},
- ## id => 3
atlanta => {
new => 'PhysLocation',
using => {
+ id => 3,
name => 'HotAtlanta',
short_name => 'atlanta',
address => '1234 southern way',
@@ -78,7 +78,7 @@ sub get_definition {
sub all_fixture_names {
# sort by db name to guarantee insertion order
- return (sort { $definition_for{$a}{using}{name} cmp $definition_for{$b}{using}{name} } keys %definition_for);
+ return (sort { $definition_for{$a}{using}{id} cmp $definition_for{$b}{using}{id} } keys %definition_for);
}
__PACKAGE__->meta->make_immutable;
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/028cdd3f/traffic_ops/app/lib/Fixtures/Regex.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/Regex.pm b/traffic_ops/app/lib/Fixtures/Regex.pm
index abc2d94..b48b48e 100644
--- a/traffic_ops/app/lib/Fixtures/Regex.pm
+++ b/traffic_ops/app/lib/Fixtures/Regex.pm
@@ -21,7 +21,7 @@ my %definition_for = (
regex_omg01 => {
new => 'Regex',
using => {
- id => 1,
+ id => 100,
pattern => '.*\.omg-01\..*',
type => 19,
},
@@ -29,7 +29,7 @@ my %definition_for = (
regex_1 => {
new => 'Regex',
using => {
- id => 2,
+ id => 200,
pattern => '.*\.foo\..*',
type => 19,
},
@@ -37,7 +37,7 @@ my %definition_for = (
target_filter_1 => {
new => 'Regex',
using => {
- id => 3,
+ id => 300,
pattern => '.*/force-to-one/.*',
type => 20,
},
@@ -45,7 +45,7 @@ my %definition_for = (
target_filter_1_2 => {
new => 'Regex',
using => {
- id => 4,
+ id => 400,
pattern => '.*/force-to-one-also/.*',
type => 20,
},
@@ -53,7 +53,7 @@ my %definition_for = (
target_filter_4 => {
new => 'Regex',
using => {
- id => 5,
+ id => 500,
pattern => '.*/go-to-four/.*',
type => 20,
},
@@ -61,7 +61,7 @@ my %definition_for = (
target_filter_3 => {
new => 'Regex',
using => {
- id => 6,
+ id => 600,
pattern => '.*/use-three/.*',
type => 20,
},
@@ -69,7 +69,7 @@ my %definition_for = (
hr_new_steering => {
new => 'Regex',
using => {
- id => 7,
+ id => 700,
pattern => '.*\.new-steering-ds\..*',
type => 19,
},
@@ -77,7 +77,7 @@ my %definition_for = (
hr_steering_1 => {
new => 'Regex',
using => {
- id => 8,
+ id => 800,
pattern => '.*\.steering-ds1\..*',
type => 19,
},
@@ -85,7 +85,7 @@ my %definition_for = (
hr_steering_2 => {
new => 'Regex',
using => {
- id => 9,
+ id => 900,
pattern => '.*\.steering-ds2\..*',
type => 19,
},
@@ -93,7 +93,7 @@ my %definition_for = (
hr_target_1 => {
new => 'Regex',
using => {
- id => 10,
+ id => 1000,
pattern => '.*\.target-ds1\..*',
type => 19,
},
@@ -101,7 +101,7 @@ my %definition_for = (
hr_target_2 => {
new => 'Regex',
using => {
- id => 11,
+ id => 1100,
pattern => '.*\.target-ds2\..*',
type => 19,
},
@@ -109,7 +109,7 @@ my %definition_for = (
hr_target_3 => {
new => 'Regex',
using => {
- id => 12,
+ id => 1200,
pattern => '.*\.target-ds3\..*',
type => 19,
},
@@ -117,7 +117,7 @@ my %definition_for = (
hr_target_4 => {
new => 'Regex',
using => {
- id => 13,
+ id => 1300,
pattern => '.*\.target-ds4\..*',
type => 19,
},
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/028cdd3f/traffic_ops/app/lib/Fixtures/Role.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/Role.pm b/traffic_ops/app/lib/Fixtures/Role.pm
index 0987486..c87dc5b 100644
--- a/traffic_ops/app/lib/Fixtures/Role.pm
+++ b/traffic_ops/app/lib/Fixtures/Role.pm
@@ -100,7 +100,7 @@ sub get_definition {
sub all_fixture_names {
# sort by db name to guarantee insertion order
- return (sort { $definition_for{$a}{using}{name} cmp $definition_for{$b}{using}{name} } keys %definition_for);
+ return (sort { $definition_for{$a}{using}{id} cmp $definition_for{$b}{using}{id} } keys %definition_for);
}
__PACKAGE__->meta->make_immutable;
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/028cdd3f/traffic_ops/app/lib/Fixtures/Staticdnsentry.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/Staticdnsentry.pm b/traffic_ops/app/lib/Fixtures/Staticdnsentry.pm
index d1c574f..d43b223 100644
--- a/traffic_ops/app/lib/Fixtures/Staticdnsentry.pm
+++ b/traffic_ops/app/lib/Fixtures/Staticdnsentry.pm
@@ -18,41 +18,42 @@ extends 'DBIx::Class::EasyFixture';
use namespace::autoclean;
my %definition_for = (
- ## id => 1
a_record_host => {
new => 'Staticdnsentry',
using => {
+ id => 1,
host => 'A_RECORD_HOST',
address => '127.0.0.1',
- type => 1,
+ type => 21,
deliveryservice => 1,
- cachegroup => 3,
+ cachegroup => 1,
},
},
- ## id => 2
aaaa_record_host => {
new => 'Staticdnsentry',
using => {
+ id => 2,
host => 'AAAA_RECORD_HOST',
address => '127.0.0.1',
deliveryservice => 1,
cachegroup => 1,
- type => 1,
+ type => 22,
},
},
- ## id => 3
cname_host => {
new => 'Staticdnsentry',
using => {
+ id => 3,
host => 'CNAME_HOST',
address => '127.0.0.1',
deliveryservice => 2,
- type => 6,
+ type => 23,
cachegroup => 2,
},
},
);
+
sub get_definition {
my ( $self, $name ) = @_;
return $definition_for{$name};
@@ -60,7 +61,7 @@ sub get_definition {
sub all_fixture_names {
# sort by db host to guarantee insertion order
- return (sort { $definition_for{$a}{using}{host} cmp $definition_for{$b}{using}{host} } keys %definition_for);
+ return (sort { $definition_for{$a}{using}{id} cmp $definition_for{$b}{using}{id} } keys %definition_for);
}
__PACKAGE__->meta->make_immutable;
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/028cdd3f/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
index 6372493..b24a6f1 100644
--- a/traffic_ops/app/lib/Fixtures/SteeringTarget.pm
+++ b/traffic_ops/app/lib/Fixtures/SteeringTarget.pm
@@ -30,7 +30,7 @@ my %definition_for = (
steering_target_1 => {
new => 'SteeringTarget',
using => {
- deliveryservice => 1,
+ deliveryservice => 10,
target => 4,
weight => 1000,
}
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/028cdd3f/traffic_ops/app/lib/UI/DeliveryService.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/UI/DeliveryService.pm b/traffic_ops/app/lib/UI/DeliveryService.pm
index a3fce79..089cfcf 100644
--- a/traffic_ops/app/lib/UI/DeliveryService.pm
+++ b/traffic_ops/app/lib/UI/DeliveryService.pm
@@ -196,7 +196,7 @@ sub read {
my $self = shift;
my @data;
my $orderby = "xml_id";
- $orderby = $self->param('orderby') if ( defined $self->param('orderby') );
+ $orderby = $self->param('orderby') || 'id';
my $rs_data = $self->db->resultset("Deliveryservice")->search(
undef, {
prefetch => [ 'cdn', 'deliveryservice_regexes' ],
@@ -219,6 +219,7 @@ sub read {
}
push(
@data, {
+ "id" => $row->id,
"xml_id" => $row->xml_id,
"display_name" => $row->display_name,
"dscp" => $row->dscp,
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/028cdd3f/traffic_ops/app/t/deliveryservice.t
----------------------------------------------------------------------
diff --git a/traffic_ops/app/t/deliveryservice.t b/traffic_ops/app/t/deliveryservice.t
index 48939ca..9dacd0b 100644
--- a/traffic_ops/app/t/deliveryservice.t
+++ b/traffic_ops/app/t/deliveryservice.t
@@ -31,8 +31,7 @@ BEGIN { $ENV{MOJO_MODE} = "test" }
my $dbh = Schema->database_handle;
my $schema = Schema->connect_to_database;
my $t = Test::Mojo->new('TrafficOps');
-my $t3_id;
-
+my $t2_id;
#unload data for a clean test
Test::TestHelper->unload_core_data($schema);
@@ -49,15 +48,6 @@ ok $t->post_ok(
}
)->status_is(302)->or( sub { diag $t->tx->res->content->asset->{content}; } );
-#add - validate 200 response (data is actually added to DB when create is called)
-ok $t->get_ok('/ds/add')->status_is(200), "validate add screen";
-
-# validate existing delivery service
-ok $t->get_ok('/ds/1')->status_is(200), "validate existing delivery service";
-
-# validate existing delivery service
-ok $t->get_ok('/ds/2')->status_is(200), "validate existing delivery service";
-
# ####################### RW testing - careful with these! #####################################################
# create
@@ -193,7 +183,7 @@ ok $t->post_ok(
'ds.qstring_ignore' => '1',
'ds.signed' => '1',
'ds.type' => '9',
- 'ds.xml_id' => 'tst_xml_id_3',
+ 'ds.xml_id' => 'tst_xml_id_2',
'ds.protocol' => '0',
'ds.edge_header_rewrite' => '',
'ds.mid_header_rewrite' => '',
@@ -211,27 +201,39 @@ ok $t->post_ok(
'ds.regional_geo_blocking' => '0',
'ds.geolimit_redirect_url' => 'http://knutsel3.com',
}
-)->status_is(302), "create HTTP_NO_CACHE deliveryservice";
+)->status_is(200), "create HTTP_NO_CACHE deliveryservice";
+
+#add - validate 200 response (data is actually added to DB when create is called)
+ok $t->get_ok('/ds/add')->status_is(200), "validate add screen";
+
+# validate existing delivery service
+ok $t->get_ok('/ds/1')->status_is(200), "validate existing delivery service";
+
+# validate existing delivery service
+ok $t->get_ok('/ds/1')->status_is(200), "validate existing delivery service";
#Validate create
# Note the 4 is the index, not the id.
#This can potentially make the tests fragile if more ds's are added to the fixtures...
-ok $t->get_ok('/datadeliveryservice')->status_is(200)
- ->json_is( '/4/xml_id' => 'steering-target-ds2' )->json_is( '/4/dscp' => '40' )
- ->json_is( '/4/active' => '1' )->json_is( '/4/protocol' => '1' )
- ->json_is( '/4/display_name' => 'target-ds2-displayname' )
- ->json_is( '/4/regional_geo_blocking' => '1' )
- ->json_is( '/0/regional_geo_blocking' => '1' )
- ->json_is( '/1/regional_geo_blocking' => '1' ),
- "validate delivery services were created";
-$t3_id = &get_ds_id('tst_xml_id_3');
-ok defined($t3_id), "validated delivery service with all fields was added";
+ok $t->get_ok('/datadeliveryservice')->
+ status_is(200)->
+ json_is( '/0/dscp' => '40' )
+ ->json_is( '/0/active' => '1' )
+ ->json_is( '/0/protocol' => '3' )
+ ->json_is( '/0/display_name' => 'display name 1' )
+ ->json_is( '/0/regional_geo_blocking' => '1' )
+ ->json_is( '/0/regional_geo_blocking' => '1' )
+ ->json_is( '/1/regional_geo_blocking' => '0' ),
+ "validate delivery services were created";
+
+$t2_id = &get_ds_id('tst_xml_id_2');
+ok defined($t2_id), "validated delivery service with all fields was added";
# update DS
#post update
ok $t->post_ok(
- "/ds/$t3_id/update" => form => {
+ "/ds/$t2_id/update" => form => {
'ds.active' => '0',
'ds.ccr_dns_ttl' => '3601',
'ds.check_path' => '/clientaccesspolicy.xml_update',
@@ -240,7 +242,7 @@ ok $t->post_ok(
'ds.dns_bypass_cname' => 'updateby.knutsel.com',
'ds.dns_bypass_ttl' => '31',
'ds.dscp' => '41',
- 'ds.geo_limit' => '1',
+ 'ds.geo_limit' => '2',
'ds.geo_limit_countries' => '',
'ds.geo_provider' => '1',
'ds.global_max_mbps' => '4T',
@@ -256,12 +258,12 @@ ok $t->post_ok(
'ds.org_server_fqdn' => 'http://update.knutsel.com',
'ds.multi_site_origin' => '0',
'ds.multi_site_origin_algorithm' => '0',
- 'ds.profile' => '3',
+ 'ds.profile' => '2',
'ds.cdn_id' => '2',
'ds.qstring_ignore' => '0',
'ds.signed' => '0',
'ds.type' => '7',
- 'ds.xml_id' => 'tst_xml_id_3_update',
+ 'ds.xml_id' => 'tst_xml_id_2',
'ds.protocol' => '1',
'ds.edge_header_rewrite' => '',
'ds.mid_header_rewrite' => '',
@@ -286,30 +288,38 @@ ok $t->post_ok(
#This can potentially make the tests fragile if more ds's are added to the fixtures...
ok $t->get_ok('/datadeliveryservice')->status_is(200)
->or( sub { diag $t->tx->res->content->asset->{content}; } )
- ->json_is( '/6/dscp' => '40' )->json_is( '/6/active' => '1' )
- ->json_is( '/6/profile_description' => 'ccr description' )
- ->json_is( '/6/org_server_fqdn' => 'http://target-ds4.edge' )
- ->json_is( '/6/xml_id' => 'steering-target-ds4' )
- ->json_is( '/6/signed' => '0' )->json_is( '/6/qstring_ignore' => '0' )
- ->json_is( '/6/dns_bypass_ip' => 'hokeypokey' )
- ->json_is( '/6/dns_bypass_ttl' => '10' )->json_is( '/6/ccr_dns_ttl' => 3600 )
- ->json_is( '/6/global_max_mbps' => 0 )
- ->json_is( '/6/global_max_tps' => 0 )->json_is( '/6/miss_lat' => '41.881944' )
- ->json_is( '/6/miss_long' => '-87.627778' )->json_is( '/6/long_desc' => 'target-ds4 long_desc' )
- ->json_is( '/6/long_desc_1' => 'target-ds4 long_desc_1' )
- ->json_is( '/6/long_desc_2' => 'target-ds4 long_desc_2' )
- ->json_is( '/6/info_url' => 'http://target-ds4.edge/info_url.html' )
- ->json_is( '/6/protocol' => '1' )->json_is( '/6/profile_name' => 'CCR1' )
- ->json_is( '/6/display_name' => 'target-ds4-displayname' )
- ->json_is( '/6/regional_geo_blocking' => '1' ),
+ ->json_is( '/1/dscp' => '41' )
+ ->json_is( '/1/active' => '0' )
+ ->json_is( '/1/profile_description' => 'mid description' )
+ ->json_is( '/1/org_server_fqdn' => 'http://update.knutsel.com' )
+ ->json_is( '/1/xml_id' => 'tst_xml_id_2' )
+ ->json_is( '/1/signed' => '0' )
+ ->json_is( '/1/qstring_ignore' => '0' )
+ ->json_is( '/1/dns_bypass_ip' => '10.10.10.11' )
+ ->json_is( '/1/dns_bypass_ip6' => '2001:558:fee8:180::1/64' )
+ ->json_is( '/1/dns_bypass_ttl' => '31' )
+ ->json_is( '/1/ccr_dns_ttl' => 3601 )
+ ->json_is( '/1/global_max_mbps' => 4000000 )
+ ->json_is( '/1/global_max_tps' => 10001 )
+ ->json_is( '/1/miss_lat' => '0' )
+ ->json_is( '/1/miss_long' => '0' )
+ ->json_is( '/1/long_desc' => 'long_update' )
+ ->json_is( '/1/long_desc_1' => 'cust_update' )
+ ->json_is( '/1/long_desc_2' => 'service_update' )
+ ->json_is( '/1/info_url' => 'http://knutsel-update.com' )
+ ->json_is( '/1/protocol' => '1' )
+ ->json_is( '/1/profile_name' => 'MID1' )
+ ->json_is( '/1/geolimit_redirect_url' => 'http://update.redirect.url.com' )
+ ->json_is( '/1/display_name' => 'Testing Delivery Service' )
+ ->json_is( '/1/regional_geo_blocking' => '1' ),
"validate delivery service was updated";
#delete delivery service
-# ok $t->get_ok("/ds/$t3_id/delete")->status_is(302), "delete ds";
-#
-# #validate it was deleted
-# $t3_id = &get_ds_id('tst_xml_id_3_update');
-# ok !defined($t3_id), "validated delivery service was deleted";
+ok $t->get_ok("/ds/$t2_id/delete")->status_is(302), "delete ds";
+
+#validate it was deleted
+$t2_id = &get_ds_id('tst_xml_id_2');
+ok !defined($t2_id), "validated delivery service was deleted";
sub get_ds_id {
my $xml_id = shift;