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/14 17:07:09 UTC

[06/53] [abbrv] incubator-trafficcontrol git commit: fixing integration.

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e9139ad5/traffic_ops/app/lib/Fixtures/Integration/PhysLocation.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/Integration/PhysLocation.pm b/traffic_ops/app/lib/Fixtures/Integration/PhysLocation.pm
index 487a3ef..9022d85 100644
--- a/traffic_ops/app/lib/Fixtures/Integration/PhysLocation.pm
+++ b/traffic_ops/app/lib/Fixtures/Integration/PhysLocation.pm
@@ -26,33 +26,273 @@ extends 'DBIx::Class::EasyFixture';
 use namespace::autoclean;
 
 my %definition_for = (
-'0' => { new => 'PhysLocation', => using => { id => '1', region => '1', short_name => 'nyc-1', phone => undef, poc => undef, address => '1 Main Street', city => 'nyc', comments => undef, email => undef, last_updated => '2015-12-10 15:43:45', name => 'plocation-nyc-1', state => 'NY', zip => '12345', }, }, 
-'1' => { new => 'PhysLocation', => using => { city => 'nyc', name => 'plocation-nyc-2', poc => undef, last_updated => '2015-12-10 15:43:45', phone => undef, region => '1', short_name => 'nyc-2', address => '2 Broadway', comments => undef, email => undef, id => '2', state => 'NY', zip => '12345', }, }, 
-'2' => { new => 'PhysLocation', => using => { comments => undef, id => '3', name => 'plocation-lax-1', phone => undef, region => '2', short_name => 'lax-1', state => 'CA', address => '3 Main Street', city => 'lax', email => undef, last_updated => '2015-12-10 15:43:45', poc => undef, zip => '12345', }, }, 
-'3' => { new => 'PhysLocation', => using => { address => '4 Broadway', comments => undef, email => undef, id => '4', last_updated => '2015-12-10 15:43:45', phone => undef, zip => '12345', city => 'lax', name => 'plocation-lax-2', poc => undef, region => '2', short_name => 'lax-2', state => 'CA', }, }, 
-'4' => { new => 'PhysLocation', => using => { state => 'IL', zip => '12345', address => '5 Main Street', comments => undef, email => undef, last_updated => '2015-12-10 15:43:45', name => 'plocation-chi-1', phone => undef, city => 'chi', id => '5', poc => undef, region => '3', short_name => 'chi-1', }, }, 
-'5' => { new => 'PhysLocation', => using => { phone => undef, short_name => 'chi-2', state => 'IL', address => '6 Broadway', city => 'chi', comments => undef, id => '6', last_updated => '2015-12-10 15:43:45', zip => '12345', email => undef, name => 'plocation-chi-2', poc => undef, region => '3', }, }, 
-'6' => { new => 'PhysLocation', => using => { id => '7', last_updated => '2015-12-10 15:43:45', name => 'plocation-hou-1', phone => undef, poc => undef, address => '7 Main Street', city => 'hou', email => undef, region => '3', state => 'TX', comments => undef, short_name => 'hou-1', zip => '12345', }, }, 
-'7' => { new => 'PhysLocation', => using => { phone => undef, poc => undef, state => 'TX', zip => '12345', email => undef, city => 'hou', comments => undef, id => '8', last_updated => '2015-12-10 15:43:45', name => 'plocation-hou-2', region => '3', short_name => 'hou-2', address => '8 Broadway', }, }, 
-'8' => { new => 'PhysLocation', => using => { region => '1', address => '9 Main Street', email => undef, name => 'plocation-phl-1', last_updated => '2015-12-10 15:43:45', phone => undef, poc => undef, short_name => 'phl-1', state => 'PA', city => 'phl', comments => undef, id => '9', zip => '12345', }, }, 
-'9' => { new => 'PhysLocation', => using => { email => undef, state => 'PA', zip => '12345', comments => undef, city => 'phl', id => '10', last_updated => '2015-12-10 15:43:45', name => 'plocation-phl-2', phone => undef, poc => undef, region => '1', address => '10 Broadway', short_name => 'phl-2', }, }, 
-'10' => { new => 'PhysLocation', => using => { name => 'plocation-den-1', region => '2', short_name => 'den-1', zip => '12345', city => 'den', comments => undef, last_updated => '2015-12-10 15:43:45', phone => undef, poc => undef, state => 'CO', address => '11 Main Street', email => undef, id => '11', }, }, 
-'11' => { new => 'PhysLocation', => using => { id => '12', state => 'CO', zip => '12345', address => '12 Broadway', comments => undef, email => undef, last_updated => '2015-12-10 15:43:45', name => 'plocation-den-2', phone => undef, poc => undef, region => '2', city => 'den', short_name => 'den-2', }, }, 
-'12' => { new => 'PhysLocation', => using => { phone => undef, region => '1', short_name => 'clw', comments => undef, email => undef, id => '100', last_updated => '2015-12-10 15:43:45', state => '-', zip => '-', address => '-', city => '-', name => 'cloud-east', poc => undef, }, }, 
-'13' => { new => 'PhysLocation', => using => { region => '2', city => '-', comments => undef, email => undef, id => '101', name => 'cloud-west', phone => undef, address => '-', last_updated => '2015-12-10 15:43:45', poc => undef, short_name => 'cle', state => '-', zip => '-', }, }, 
-); 
+	## id => 1
+	'0' => {
+		new => 'PhysLocation',
+		using => {
+			name => 'cloud-east',
+			phone => undef,
+			region => '1',
+			short_name => 'clw',
+			comments => undef,
+			email => undef,
+			last_updated => '2015-12-10 15:43:45',
+			state => '-',
+			zip => '-',
+			address => '-',
+			city => '-',
+			poc => undef,
+		},
+	},
+	## id => 2
+	'1' => {
+		new => 'PhysLocation',
+		using => {
+			name => 'cloud-west',
+			region => '2',
+			city => '-',
+			comments => undef,
+			email => undef,
+			phone => undef,
+			address => '-',
+			last_updated => '2015-12-10 15:43:45',
+			poc => undef,
+			short_name => 'cle',
+			state => '-',
+			zip => '-',
+		},
+	},
+	## id => 3
+	'2' => {
+		new => 'PhysLocation',
+		using => {
+			name => 'plocation-chi-1',
+			state => 'IL',
+			zip => '12345',
+			address => '5 Main Street',
+			comments => undef,
+			email => undef,
+			last_updated => '2015-12-10 15:43:45',
+			phone => undef,
+			city => 'chi',
+			poc => undef,
+			region => '3',
+			short_name => 'chi-1',
+		},
+	},
+	## id => 4
+	'3' => {
+		new => 'PhysLocation',
+		using => {
+			name => 'plocation-chi-2',
+			phone => undef,
+			short_name => 'chi-2',
+			state => 'IL',
+			address => '6 Broadway',
+			city => 'chi',
+			comments => undef,
+			last_updated => '2015-12-10 15:43:45',
+			zip => '12345',
+			email => undef,
+			poc => undef,
+			region => '3',
+		},
+	},
+	## id => 5
+	'4' => {
+		new => 'PhysLocation',
+		using => {
+			name => 'plocation-den-1',
+			region => '2',
+			short_name => 'den-1',
+			zip => '12345',
+			city => 'den',
+			comments => undef,
+			last_updated => '2015-12-10 15:43:45',
+			phone => undef,
+			poc => undef,
+			state => 'CO',
+			address => '11 Main Street',
+			email => undef,
+		},
+	},
+	## id => 6
+	'5' => {
+		new => 'PhysLocation',
+		using => {
+			name => 'plocation-den-2',
+			state => 'CO',
+			zip => '12345',
+			address => '12 Broadway',
+			comments => undef,
+			email => undef,
+			last_updated => '2015-12-10 15:43:45',
+			phone => undef,
+			poc => undef,
+			region => '2',
+			city => 'den',
+			short_name => 'den-2',
+		},
+	},
+	## id => 7
+	'6' => {
+		new => 'PhysLocation',
+		using => {
+			name => 'plocation-hou-1',
+			last_updated => '2015-12-10 15:43:45',
+			phone => undef,
+			poc => undef,
+			address => '7 Main Street',
+			city => 'hou',
+			email => undef,
+			region => '3',
+			state => 'TX',
+			comments => undef,
+			short_name => 'hou-1',
+			zip => '12345',
+		},
+	},
+	## id => 8
+	'7' => {
+		new => 'PhysLocation',
+		using => {
+			name => 'plocation-hou-2',
+			phone => undef,
+			poc => undef,
+			state => 'TX',
+			zip => '12345',
+			email => undef,
+			city => 'hou',
+			comments => undef,
+			last_updated => '2015-12-10 15:43:45',
+			region => '3',
+			short_name => 'hou-2',
+			address => '8 Broadway',
+		},
+	},
+	## id => 9
+	'8' => {
+		new => 'PhysLocation',
+		using => {
+			name => 'plocation-lax-1',
+			comments => undef,
+			phone => undef,
+			region => '2',
+			short_name => 'lax-1',
+			state => 'CA',
+			address => '3 Main Street',
+			city => 'lax',
+			email => undef,
+			last_updated => '2015-12-10 15:43:45',
+			poc => undef,
+			zip => '12345',
+		},
+	},
+	## id => 10
+	'9' => {
+		new => 'PhysLocation',
+		using => {
+			name => 'plocation-lax-2',
+			address => '4 Broadway',
+			comments => undef,
+			email => undef,
+			last_updated => '2015-12-10 15:43:45',
+			phone => undef,
+			zip => '12345',
+			city => 'lax',
+			poc => undef,
+			region => '2',
+			short_name => 'lax-2',
+			state => 'CA',
+		},
+	},
+	## id => 11
+	'10' => {
+		new => 'PhysLocation',
+		using => {
+			name => 'plocation-nyc-1',
+			region => '1',
+			short_name => 'nyc-1',
+			phone => undef,
+			poc => undef,
+			address => '1 Main Street',
+			city => 'nyc',
+			comments => undef,
+			email => undef,
+			last_updated => '2015-12-10 15:43:45',
+			state => 'NY',
+			zip => '12345',
+		},
+	},
+	## id => 12
+	'11' => {
+		new => 'PhysLocation',
+		using => {
+			name => 'plocation-nyc-2',
+			city => 'nyc',
+			poc => undef,
+			last_updated => '2015-12-10 15:43:45',
+			phone => undef,
+			region => '1',
+			short_name => 'nyc-2',
+			address => '2 Broadway',
+			comments => undef,
+			email => undef,
+			state => 'NY',
+			zip => '12345',
+		},
+	},
+	## id => 13
+	'12' => {
+		new => 'PhysLocation',
+		using => {
+			name => 'plocation-phl-1',
+			region => '1',
+			address => '9 Main Street',
+			email => undef,
+			last_updated => '2015-12-10 15:43:45',
+			phone => undef,
+			poc => undef,
+			short_name => 'phl-1',
+			state => 'PA',
+			city => 'phl',
+			comments => undef,
+			zip => '12345',
+		},
+	},
+	## id => 14
+	'13' => {
+		new => 'PhysLocation',
+		using => {
+			name => 'plocation-phl-2',
+			email => undef,
+			state => 'PA',
+			zip => '12345',
+			comments => undef,
+			city => 'phl',
+			last_updated => '2015-12-10 15:43:45',
+			phone => undef,
+			poc => undef,
+			region => '1',
+			address => '10 Broadway',
+			short_name => 'phl-2',
+		},
+	},
+);
 
 sub name {
 		return "PhysLocation";
 }
 
-sub get_definition { 
-		my ( $self, $name ) = @_;
+sub get_definition {
+		my ( $self,
+$name ) = @_;
 		return $definition_for{$name};
 }
 
 sub all_fixture_names {
-		return keys %definition_for;
+	# sort by db name to guarantee insertion order
+	return (sort { $definition_for{$a}{using}{name} cmp $definition_for{$b}{using}{name} } keys %definition_for);
 }
 
 __PACKAGE__->meta->make_immutable;

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e9139ad5/traffic_ops/app/lib/Fixtures/Integration/Profile.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/Integration/Profile.pm b/traffic_ops/app/lib/Fixtures/Integration/Profile.pm
index 188d956..784f885 100644
--- a/traffic_ops/app/lib/Fixtures/Integration/Profile.pm
+++ b/traffic_ops/app/lib/Fixtures/Integration/Profile.pm
@@ -25,42 +25,220 @@ use Moose;
 extends 'DBIx::Class::EasyFixture';
 use namespace::autoclean;
 
-my %definition_for = (
-'0' => { new => 'Profile', => using => { description => 'HP DL380 Edge', id => '2', last_updated => '2015-12-10 15:43:48', name => 'EDGE2_CDN1', }, }, 
-'1' => { new => 'Profile', => using => { description => 'HP DL380 Mid', id => '4', last_updated => '2015-12-10 15:43:48', name => 'MID2_CDN1', }, }, 
-'2' => { new => 'Profile', => using => { description => 'Comcast Content Router for cdn1.cdn.net', id => '5', last_updated => '2015-12-10 15:43:48', name => 'CCR_CDN1', }, }, 
-'3' => { new => 'Profile', => using => { description => 'GLOBAL Traffic Ops Profile -- DO NOT DELETE', id => '6', last_updated => '2015-12-10 15:43:48', name => 'GLOBAL', }, }, 
-'4' => { new => 'Profile', => using => { description => 'Comcast Content Router for cdn2.comcast.net', id => '8', last_updated => '2015-12-10 15:43:48', name => 'CCR_CDN2', }, }, 
-'5' => { new => 'Profile', => using => { description => 'TrafficMonitor for CDN1', id => '11', last_updated => '2015-12-10 15:43:48', name => 'RASCAL_CDN1', }, }, 
-'6' => { new => 'Profile', => using => { id => '12', last_updated => '2015-12-10 15:43:48', name => 'RASCAL_CDN2', description => 'TrafficMonitor for CDN2 ', }, }, 
-'7' => { new => 'Profile', => using => { last_updated => '2015-12-10 15:43:48', name => 'EDGE1_CDN2_402', description => 'Dell R720xd, Edge, CDN2 CDN, ATS v4.0.2', id => '16', }, }, 
-'8' => { new => 'Profile', => using => { description => 'Dell R720xd, Edge, CDN1 CDN, ATS v4.0.2', id => '19', last_updated => '2015-12-10 15:43:48', name => 'EDGE1_CDN1_402', }, }, 
-'9' => { new => 'Profile', => using => { description => 'Dell R720xd, Mid, CDN2 CDN, new vol config, ATS v4.0.x', id => '20', last_updated => '2015-12-10 15:43:48', name => 'MID1_CDN2_402', }, }, 
-'10' => { new => 'Profile', => using => { description => 'HP DL380, Edge, CDN1 CDN, ATS v4.0.x', id => '21', last_updated => '2015-12-10 15:43:48', name => 'EDGE2_CDN1_402', }, }, 
-'11' => { new => 'Profile', => using => { description => 'HP DL380, Edge, CDN2 CDN, ATS v4.0.x', id => '23', last_updated => '2015-12-10 15:43:48', name => 'EDGE2_CDN2_402', }, }, 
-'12' => { new => 'Profile', => using => { description => 'Dell R720xd, Edge, CDN2 CDN, ATS v4.2.1, Consistent Parent', id => '26', last_updated => '2015-12-10 15:43:48', name => 'EDGE1_CDN2_421', }, }, 
-'13' => { new => 'Profile', => using => { description => 'Dell R720xd, Edge, CDN1 CDN, ATS v4.2.1, Consistent Parent', id => '27', last_updated => '2015-12-10 15:43:48', name => 'EDGE1_CDN1_421', }, }, 
-'14' => { new => 'Profile', => using => { description => 'Dell R720xd, Mid, CDN2 CDN, ATS v4.2.1', id => '30', last_updated => '2015-12-10 15:43:48', name => 'MID1_CDN2_421', }, }, 
-'15' => { new => 'Profile', => using => { name => 'MID1_CDN1_421', description => 'Dell R720xd, Mid, CDN1 CDN, ATS v4.2.1', id => '31', last_updated => '2015-12-10 15:43:48', }, }, 
-'16' => { new => 'Profile', => using => { id => '34', last_updated => '2015-12-10 15:43:48', name => 'TRAFFIC_STATS', description => 'Traffic Stats profile for all CDNs', }, }, 
-'17' => { new => 'Profile', => using => { description => 'HP DL380, Edge, CDN2 CDN, ATS v4.2.1, Consistent Parent', id => '37', last_updated => '2015-12-10 15:43:48', name => 'EDGE2_CDN2_421', }, }, 
-'18' => { new => 'Profile', => using => { description => 'Dell r720xd, Edge, CDN1 CDN, ATS v4.2.1, SSL enabled', id => '45', last_updated => '2015-12-10 15:43:48', name => 'EDGE1_CDN1_421_SSL', }, }, 
-'19' => { new => 'Profile', => using => { description => 'Riak profile for all CDNs', id => '47', last_updated => '2015-12-10 15:43:48', name => 'RIAK_ALL', }, }, 
-'20' => { new => 'Profile', => using => { last_updated => '2015-12-10 15:43:48', name => 'ORG1_CDN1', description => 'Multi site origin profile 1', id => '48', }, }, 
-'21' => { new => 'Profile', => using => { name => 'ORG2_CDN1', description => 'Multi site origin profile 2', id => '49', last_updated => '2015-12-10 15:43:48', }, }, 
-); 
+	my %definition_for = (
+	## id => 1
+	'0' => {
+		new => 'Profile',
+		using => {
+			name => 'CCR_CDN1',
+			description => 'Comcast Content Router for cdn1.cdn.net',
+			last_updated => '2015-12-10 15:43:48',
+		},
+	},
+	## id => 2
+	'1' => {
+		new => 'Profile',
+		using => {
+			name => 'CCR_CDN2',
+			description => 'Comcast Content Router for cdn2.comcast.net',
+			last_updated => '2015-12-10 15:43:48',
+		},
+	},
+	## id => 3
+	'2' => {
+		new => 'Profile',
+		using => {
+			name => 'EDGE1_CDN1_402',
+			description => 'Dell R720xd, Edge, CDN1 CDN, ATS v4.0.2',
+			last_updated => '2015-12-10 15:43:48',
+		},
+	},
+	## id => 4
+	'3' => {
+		new => 'Profile',
+		using => {
+			name => 'EDGE1_CDN1_421',
+			description => 'Dell R720xd, Edge, CDN1 CDN, ATS v4.2.1, Consistent Parent',
+			last_updated => '2015-12-10 15:43:48',
+		},
+	},
+	## id => 5
+	'4' => {
+		new => 'Profile',
+		using => {
+			name => 'EDGE1_CDN1_421_SSL',
+			description => 'Dell r720xd, Edge, CDN1 CDN, ATS v4.2.1, SSL enabled',
+			last_updated => '2015-12-10 15:43:48',
+		},
+	},
+	## id => 6
+	'5' => {
+		new => 'Profile',
+		using => {
+			name => 'EDGE1_CDN2_402',
+			last_updated => '2015-12-10 15:43:48',
+			description => 'Dell R720xd, Edge, CDN2 CDN, ATS v4.0.2',
+		},
+	},
+	## id => 7
+	'6' => {
+		new => 'Profile',
+		using => {
+			name => 'EDGE1_CDN2_421',
+			description => 'Dell R720xd, Edge, CDN2 CDN, ATS v4.2.1, Consistent Parent',
+			last_updated => '2015-12-10 15:43:48',
+		},
+	},
+	## id => 8
+	'7' => {
+		new => 'Profile',
+		using => {
+			name => 'EDGE2_CDN1',
+			description => 'HP DL380 Edge',
+			last_updated => '2015-12-10 15:43:48',
+		},
+	},
+	## id => 9
+	'8' => {
+		new => 'Profile',
+		using => {
+			name => 'EDGE2_CDN1_402',
+			description => 'HP DL380, Edge, CDN1 CDN, ATS v4.0.x',
+			last_updated => '2015-12-10 15:43:48',
+		},
+	},
+	## id => 10
+	'9' => {
+		new => 'Profile',
+		using => {
+			name => 'EDGE2_CDN2_402',
+			description => 'HP DL380, Edge, CDN2 CDN, ATS v4.0.x',
+			last_updated => '2015-12-10 15:43:48',
+		},
+	},
+	## id => 11
+	'10' => {
+		new => 'Profile',
+		using => {
+			name => 'EDGE2_CDN2_421',
+			description => 'HP DL380, Edge, CDN2 CDN, ATS v4.2.1, Consistent Parent',
+			last_updated => '2015-12-10 15:43:48',
+		},
+	},
+	## id => 12
+	'11' => {
+		new => 'Profile',
+		using => {
+			name => 'GLOBAL',
+			description => 'GLOBAL Traffic Ops Profile -- DO NOT DELETE',
+			last_updated => '2015-12-10 15:43:48',
+		},
+	},
+	## id => 13
+	'12' => {
+		new => 'Profile',
+		using => {
+			name => 'MID1_CDN1_421',
+			description => 'Dell R720xd, Mid, CDN1 CDN, ATS v4.2.1',
+			last_updated => '2015-12-10 15:43:48',
+		},
+	},
+	## id => 14
+	'13' => {
+		new => 'Profile',
+		using => {
+			name => 'MID1_CDN2_402',
+			description => 'Dell R720xd, Mid, CDN2 CDN, new vol config, ATS v4.0.x',
+			last_updated => '2015-12-10 15:43:48',
+		},
+	},
+	## id => 15
+	'14' => {
+		new => 'Profile',
+		using => {
+			name => 'MID1_CDN2_421',
+			description => 'Dell R720xd, Mid, CDN2 CDN, ATS v4.2.1',
+			last_updated => '2015-12-10 15:43:48',
+		},
+	},
+	## id => 16
+	'15' => {
+		new => 'Profile',
+		using => {
+			name => 'MID2_CDN1',
+			description => 'HP DL380 Mid',
+			last_updated => '2015-12-10 15:43:48',
+		},
+	},
+	## id => 17
+	'16' => {
+		new => 'Profile',
+		using => {
+			name => 'ORG1_CDN1',
+			last_updated => '2015-12-10 15:43:48',
+			description => 'Multi site origin profile 1',
+		},
+	},
+	## id => 18
+	'17' => {
+		new => 'Profile',
+		using => {
+			name => 'ORG2_CDN1',
+			description => 'Multi site origin profile 2',
+			last_updated => '2015-12-10 15:43:48',
+		},
+	},
+	## id => 19
+	'18' => {
+		new => 'Profile',
+		using => {
+			name => 'RASCAL_CDN1',
+			description => 'TrafficMonitor for CDN1',
+			last_updated => '2015-12-10 15:43:48',
+		},
+	},
+	## id => 20
+	'19' => {
+		new => 'Profile',
+		using => {
+			name => 'RASCAL_CDN2',
+			last_updated => '2015-12-10 15:43:48',
+			description => 'TrafficMonitor for CDN2 ',
+		},
+	},
+	## id => 21
+	'20' => {
+		new => 'Profile',
+		using => {
+			name => 'RIAK_ALL',
+			description => 'Riak profile for all CDNs',
+			last_updated => '2015-12-10 15:43:48',
+		},
+	},
+	## id => 22
+	'21' => {
+		new => 'Profile',
+		using => {
+			name => 'TRAFFIC_STATS',
+			last_updated => '2015-12-10 15:43:48',
+			description => 'Traffic Stats profile for all CDNs',
+		},
+	},
+);
 
 sub name {
 		return "Profile";
 }
 
-sub get_definition { 
-		my ( $self, $name ) = @_;
+sub get_definition {
+		my ( $self,
+$name ) = @_;
 		return $definition_for{$name};
 }
 
 sub all_fixture_names {
-		return keys %definition_for;
+	# sort by db name to guarantee insertion order
+	return (sort { $definition_for{$a}{using}{name} cmp $definition_for{$b}{using}{name} } keys %definition_for);
 }
 
 __PACKAGE__->meta->make_immutable;