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:35 UTC
[20/40] incubator-trafficcontrol git commit: more fixture migration
from master
more fixture migration from master
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/3aa83856
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/3aa83856
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/3aa83856
Branch: refs/heads/psql-rebase
Commit: 3aa838561dd9a66831f13f1e788dc73be87e7d6a
Parents: d844c7a
Author: Dewayne Richardson <de...@apache.org>
Authored: Wed Nov 16 10:20:47 2016 -0700
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Mon Nov 21 12:04:09 2016 -0700
----------------------------------------------------------------------
traffic_ops/app/lib/Fixtures/Cachegroup.pm | 24 +-
traffic_ops/app/lib/Fixtures/EdgeCachegroup.pm | 3 +-
traffic_ops/app/lib/Fixtures/Regex.pm | 78 +++---
traffic_ops/app/lib/Fixtures/Type.pm | 296 ++++++++++----------
4 files changed, 205 insertions(+), 196 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/3aa83856/traffic_ops/app/lib/Fixtures/Cachegroup.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/Cachegroup.pm b/traffic_ops/app/lib/Fixtures/Cachegroup.pm
index 28f8e1f..ad0e919 100644
--- a/traffic_ops/app/lib/Fixtures/Cachegroup.pm
+++ b/traffic_ops/app/lib/Fixtures/Cachegroup.pm
@@ -18,27 +18,27 @@ extends 'DBIx::Class::EasyFixture';
use namespace::autoclean;
my %definition_for = (
- ## id => 1
mid_northeast => {
new => 'Cachegroup',
using => {
+ id => 1,
name => 'mid-northeast-group',
short_name => 'ne',
- type => 18,
- latitude => 98.0,
- longitude => 98.0,
+ type => 2,
+ latitude => 120,
+ longitude => 120,
parent_cachegroup_id => undef,
},
},
- ## id => 2
mid_northwest => {
new => 'Cachegroup',
using => {
+ id => 2,
name => 'mid-northwest-group',
short_name => 'nw',
- type => 18,
- latitude => 98.0,
- longitude => 98.0,
+ type => 2,
+ latitude => 100,
+ longitude => 100,
parent_cachegroup_id => 1,
},
},
@@ -49,8 +49,8 @@ my %definition_for = (
name => 'mid_cg3',
short_name => 'mid_cg3',
type => 6,
- latitude => 98.0,
- longitude => 98.0,
+ latitude => 100,
+ longitude => 100,
parent_cachegroup_id => undef,
},
},
@@ -61,8 +61,8 @@ my %definition_for = (
name => 'edge_cg4',
short_name => 'edge_cg4',
type => 5,
- latitude => 98.0,
- longitude => 98.0,
+ latitude => 100,
+ longitude => 100,
parent_cachegroup_id => 8,
},
},
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/3aa83856/traffic_ops/app/lib/Fixtures/EdgeCachegroup.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/EdgeCachegroup.pm b/traffic_ops/app/lib/Fixtures/EdgeCachegroup.pm
index 6d68d1a..371c015 100644
--- a/traffic_ops/app/lib/Fixtures/EdgeCachegroup.pm
+++ b/traffic_ops/app/lib/Fixtures/EdgeCachegroup.pm
@@ -21,9 +21,10 @@ my %definition_for = (
edge_atl => {
new => 'Cachegroup',
using => {
+ id => 3,
name => 'edge_atl_group',
short_name => 'atl',
- type => 10,
+ type => 5,
latitude => 120,
longitude => 120,
parent_cachegroup_id => 1,
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/3aa83856/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 c72a3ad..abc2d94 100644
--- a/traffic_ops/app/lib/Fixtures/Regex.pm
+++ b/traffic_ops/app/lib/Fixtures/Regex.pm
@@ -18,108 +18,108 @@ extends 'DBIx::Class::EasyFixture';
use namespace::autoclean;
my %definition_for = (
- ## id => 1
+ regex_omg01 => {
+ new => 'Regex',
+ using => {
+ id => 1,
+ pattern => '.*\.omg-01\..*',
+ type => 19,
+ },
+ },
+ regex_1 => {
+ new => 'Regex',
+ using => {
+ id => 2,
+ pattern => '.*\.foo\..*',
+ type => 19,
+ },
+ },
target_filter_1 => {
new => 'Regex',
using => {
+ id => 3,
pattern => '.*/force-to-one/.*',
- type => 28,
+ type => 20,
},
},
- ## id => 2
target_filter_1_2 => {
new => 'Regex',
using => {
+ id => 4,
pattern => '.*/force-to-one-also/.*',
- type => 28,
+ type => 20,
},
},
- ## id => 3
target_filter_4 => {
new => 'Regex',
using => {
+ id => 5,
pattern => '.*/go-to-four/.*',
- type => 28,
+ type => 20,
},
},
- ## id => 4
target_filter_3 => {
new => 'Regex',
using => {
+ id => 6,
pattern => '.*/use-three/.*',
- type => 28,
+ type => 20,
},
},
- ## id => 5
- regex_1 => {
- new => 'Regex',
- using => {
- pattern => '.*\.foo\..*',
- type => 15,
- },
- },
- ## id => 6
hr_new_steering => {
new => 'Regex',
using => {
+ id => 7,
pattern => '.*\.new-steering-ds\..*',
- type => 15,
- },
- },
- ## id => 7
- regex_omg01 => {
- new => 'Regex',
- using => {
- pattern => '.*\.omg-01\..*',
- type => 15,
+ type => 19,
},
},
- ## id => 8
hr_steering_1 => {
new => 'Regex',
using => {
+ id => 8,
pattern => '.*\.steering-ds1\..*',
- type => 15,
+ type => 19,
},
},
- ## id => 9
hr_steering_2 => {
new => 'Regex',
using => {
+ id => 9,
pattern => '.*\.steering-ds2\..*',
- type => 15,
+ type => 19,
},
},
- ## id => 10
hr_target_1 => {
new => 'Regex',
using => {
+ id => 10,
pattern => '.*\.target-ds1\..*',
- type => 15,
+ type => 19,
},
},
- ## id => 11
hr_target_2 => {
new => 'Regex',
using => {
+ id => 11,
pattern => '.*\.target-ds2\..*',
- type => 15,
+ type => 19,
},
},
- ## id => 12
hr_target_3 => {
new => 'Regex',
using => {
+ id => 12,
pattern => '.*\.target-ds3\..*',
- type => 15,
+ type => 19,
},
},
- ## id => 13
hr_target_4 => {
new => 'Regex',
using => {
+ id => 13,
pattern => '.*\.target-ds4\..*',
- type => 15,
+ type => 19,
},
},
);
@@ -131,7 +131,7 @@ sub get_definition {
sub all_fixture_names {
# sort by db pattern to guarantee insertion order
- return (sort { $definition_for{$a}{using}{pattern} cmp $definition_for{$b}{using}{pattern} } 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/3aa83856/traffic_ops/app/lib/Fixtures/Type.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/Type.pm b/traffic_ops/app/lib/Fixtures/Type.pm
index ce46c13..5749f88 100644
--- a/traffic_ops/app/lib/Fixtures/Type.pm
+++ b/traffic_ops/app/lib/Fixtures/Type.pm
@@ -19,265 +19,274 @@ use namespace::autoclean;
use Digest::SHA1 qw(sha1_hex);
my %definition_for = (
- ## id => 1
- AAAA_RECORD => {
- new => 'Type',
- using => {
- name => 'AAAA_RECORD',
- description => 'Static DNS AAAA entry',
- use_in_table => 'staticdnsentry',
- }
- },
- ## id => 2
- ACTIVE_DIRECTORY => {
+ EDGE => {
new => 'Type',
using => {
- name => 'ACTIVE_DIRECTORY',
- description => 'Active Directory User',
- use_in_table => 'tm_user',
- }
+ id => 1,
+ name => 'EDGE',
+ description => 'Edge Cache',
+ use_in_table => 'server',
+ },
},
- ## id => 3
- A_RECORD => {
+ MID => {
new => 'Type',
using => {
- name => 'A_RECORD',
- description => 'Static DNS A entry',
- use_in_table => 'staticdnsentry',
- }
+ id => 2,
+ name => 'MID',
+ description => 'Mid Tier Cache',
+ use_in_table => 'server',
+ },
},
- ## id => 4
- ANY_MAP => {
+ ORG => {
new => 'Type',
using => {
- name => 'ANY_MAP',
- description => 'any_map type',
- use_in_table => 'deliveryservice',
- }
+ id => 3,
+ name => 'ORG',
+ description => 'Origin',
+ use_in_table => 'server',
+ },
},
- ## id => 5
CCR => {
new => 'Type',
using => {
+ id => 4,
name => 'CCR',
description => 'Kabletown Content Router',
use_in_table => 'server',
},
},
- ## id => 6
- CNAME_RECORD => {
+ EDGE_LOC => {
new => 'Type',
using => {
- name => 'CNAME_RECORD',
- description => 'Static DNS CNAME entry',
- use_in_table => 'staticdnsentry',
- }
+ id => 5,
+ name => 'EDGE_LOC',
+ description => 'Edge Cachegroup',
+ use_in_table => 'cachegroup',
+ },
},
- ## id => 7
- DNS => {
+ MID_LOC => {
new => 'Type',
using => {
- name => 'DNS',
- description => 'DNS Content Routing',
- use_in_table => 'deliveryservice',
+ id => 6,
+ name => 'MID_LOC',
+ description => 'Mid Cachegroup',
+ use_in_table => 'cachegroup',
},
},
- ## id => 8
- DNS_LIVE_NATNL => {
+ DNS => {
new => 'Type',
using => {
- name => 'DNS_LIVE_NATNL',
- description => 'DNS Content routing, RAM cache, National',
+ id => 7,
+ name => 'DNS',
+ description => 'DNS Content Routing',
use_in_table => 'deliveryservice',
- }
- },
- ## id => 9
- EDGE => {
- new => 'Type',
- using => {
- name => 'EDGE',
- description => 'Edge Cache',
- use_in_table => 'server',
},
},
- ## id => 10
- EDGE_LOC => {
+ OTHER_CDN => {
new => 'Type',
using => {
- name => 'EDGE_LOC',
- description => 'Edge Cachegroup',
- use_in_table => 'cachegroup',
+ id => 8,
+ name => 'OTHER_CDN',
+ description => 'Other CDN (CDS-IS, Akamai, etc)',
+ use_in_table => 'server',
},
},
- ## id => 11
- HTTP => {
+ HTTP_NO_CACHE => {
new => 'Type',
using => {
- name => 'HTTP',
- description => 'HTTP Content routing cache ',
+ id => 9,
+ name => 'HTTP_NO_CACHE',
+ description => 'HTTP Content Routing, no caching',
use_in_table => 'deliveryservice',
},
},
- ## id => 12
HTTP_LIVE => {
new => 'Type',
using => {
+ id => 11,
name => 'HTTP_LIVE',
description => 'HTTP Content routing cache in RAM ',
use_in_table => 'deliveryservice',
},
},
- ## id => 13
- HTTP_LIVE_NATNL => {
+ HTTP_LIVE => {
new => 'Type',
using => {
- name => 'HTTP_LIVE_NATNL',
- description => 'HTTP Content routing, RAM cache, National',
+ id => 12,
+ name => 'HTTP_LIVE',
+ description => 'HTTP Content routing cache in RAM ',
use_in_table => 'deliveryservice',
- }
+ },
},
- ## id => 14
- HTTP_NO_CACHE => {
+ RASCAL => {
new => 'Type',
using => {
- name => 'HTTP_NO_CACHE',
- description => 'HTTP Content Routing, no caching',
- use_in_table => 'deliveryservice',
+ id => 14,
+ name => 'RASCAL',
+ description => 'Rascal health polling & reporting',
+ use_in_table => 'server',
},
},
- ## id => 15
HOST_REGEXP => {
new => 'Type',
using => {
+ id => 19,
name => 'HOST_REGEXP',
description => 'Host header regular expression',
use_in_table => 'regex',
},
},
- ## id => 16
- INFLUXDB => {
+ PATH_REGEXP => {
new => 'Type',
using => {
- name => 'INFLUXDB',
- description => 'influxdb type',
- use_in_table => 'server',
+ id => 20,
+ name => 'PATH_REGEXP',
+ description => 'Path regular expression',
+ use_in_table => 'regex',
+ },
+ },
+ A_RECORD => {
+ new => 'Type',
+ using => {
+ id => 21,
+ name => 'A_RECORD',
+ description => 'Static DNS A entry',
+ use_in_table => 'staticdnsentry',
}
},
- ## id => 17
- LOCAL => {
+ AAAA_RECORD => {
new => 'Type',
using => {
- name => 'LOCAL',
- description => 'Local User',
- use_in_table => 'tm_user',
+ id => 22,
+ name => 'AAAA_RECORD',
+ description => 'Static DNS AAAA entry',
+ use_in_table => 'staticdnsentry',
}
},
- ## id => 18
- MID => {
+ CNAME_RECORD => {
new => 'Type',
using => {
- name => 'MID',
- description => 'Mid Tier Cache',
- use_in_table => 'server',
- },
+ id => 23,
+ name => 'CNAME_RECORD',
+ description => 'Static DNS CNAME entry',
+ use_in_table => 'staticdnsentry',
+ }
},
- ## id => 19
- MID_LOC => {
+ HTTP_LIVE_NATNL => {
new => 'Type',
using => {
- name => 'MID_LOC',
- description => 'Mid Cachegroup',
- use_in_table => 'cachegroup',
- },
+ id => 24,
+ name => 'HTTP_LIVE_NATNL',
+ description => 'HTTP Content routing, RAM cache, National',
+ use_in_table => 'deliveryservice',
+ }
},
- ## id => 20
- ORG => {
+ DNS_LIVE_NATNL => {
new => 'Type',
using => {
- name => 'ORG',
- description => 'Origin',
- use_in_table => 'server',
- },
+ id => 26,
+ name => 'DNS_LIVE_NATNL',
+ description => 'DNS Content routing, RAM cache, National',
+ use_in_table => 'deliveryservice',
+ }
},
- ## id => 21
- OTHER_CDN => {
+ DNS_LIVE_NATNL => {
new => 'Type',
using => {
- name => 'OTHER_CDN',
- description => 'Other CDN (CDS-IS, Akamai, etc)',
+ id => 27,
+ name => 'DNS_LIVE_NATNL',
+ description => 'DNS Content routing, RAM cache, National',
+ use_in_table => 'deliveryservice',
+ }
+ },
+ LOCAL => {
+ new => 'Type',
+ using => {
+ id => 28,
+ name => 'LOCAL',
+ description => 'Local User',
+ use_in_table => 'tm_user',
+ }
+ },
+ ACTIVE_DIRECTORY => {
+ new => 'Type',
+ using => {
+ id => 29,
+ name => 'ACTIVE_DIRECTORY',
+ description => 'Active Directory User',
+ use_in_table => 'tm_user',
+ }
+ },
+ TOOLS_SERVER => {
+ new => 'Type',
+ using => {
+ id => 30,
+ name => 'TOOLS_SERVER',
+ description => 'Ops hosts for management',
use_in_table => 'server',
- },
+ }
},
- ## id => 22
- PATH_REGEXP => {
+ RIAK => {
new => 'Type',
using => {
- name => 'PATH_REGEXP',
- description => 'Path regular expression',
- use_in_table => 'regex',
- },
+ id => 31,
+ name => 'RIAK',
+ description => 'riak type',
+ use_in_table => 'server',
+ }
},
- ## id => 23
- RASCAL => {
+ INFLUXDB => {
new => 'Type',
using => {
- name => 'RASCAL',
- description => 'Rascal health polling & reporting',
+ id => 32,
+ name => 'INFLUXDB',
+ description => 'influxdb type',
use_in_table => 'server',
- },
+ }
},
- ## id => 24
RESOLVE4 => {
new => 'Type',
using => {
+ id => 33,
name => 'RESOLVE4',
description => 'federation type resolve4',
use_in_table => 'federation',
}
},
- ## id => 25
RESOLVE6 => {
new => 'Type',
using => {
+ id => 34,
name => 'RESOLVE6',
description => 'federation type resolve6',
use_in_table => 'federation',
},
},
- ## id => 26
- RIAK => {
- new => 'Type',
- using => {
- name => 'RIAK',
- description => 'riak type',
- use_in_table => 'server',
- }
- },
- ## id => 27
- STEERING => {
+ ANY_MAP => {
new => 'Type',
using => {
- name => 'STEERING',
- description => 'Steering Delivery Service',
+ id => 35,
+ name => 'ANY_MAP',
+ description => 'any_map type',
use_in_table => 'deliveryservice',
}
},
- ## id => 28
- STEERING_REGEXP => {
+ HTTP => {
new => 'Type',
using => {
- name => 'STEERING_REGEXP',
- description => 'Steering target filter regular expression',
- use_in_table => 'regex',
+ id => 36,
+ name => 'HTTP',
+ description => 'HTTP Content routing cache ',
+ use_in_table => 'deliveryservice',
},
},
- ## id => 29
- TOOLS_SERVER => {
+ STEERING => {
new => 'Type',
using => {
- name => 'TOOLS_SERVER',
- description => 'Ops hosts for management',
- use_in_table => 'server',
+ id => 37,
+ name => 'STEERING',
+ description => 'Steering Delivery Service',
+ use_in_table => 'deliveryservice',
}
}
);
@@ -288,8 +297,7 @@ sub get_definition {
}
sub all_fixture_names {
- # sort by db name to guarantee insertion order
- return (sort { $definition_for{$a}{using}{id} cmp $definition_for{$b}{using}{id} } keys %definition_for);
+ return keys %definition_for;
}
__PACKAGE__->meta->make_immutable;