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:38 UTC

[23/40] incubator-trafficcontrol git commit: fixed the health.t testcase and data

fixed the health.t testcase and data


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/e6a0fd82
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/e6a0fd82
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/e6a0fd82

Branch: refs/heads/psql-rebase
Commit: e6a0fd8202a2f49de67ee150b4715e6749bcb5e8
Parents: abfcc14
Author: Dewayne Richardson <de...@apache.org>
Authored: Thu Nov 17 12:44:39 2016 -0700
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Mon Nov 21 12:04:09 2016 -0700

----------------------------------------------------------------------
 .../app/lib/Fixtures/FederationDeliveryservice.pm       |  8 ++++----
 traffic_ops/app/lib/Fixtures/Server.pm                  | 12 ++++++------
 traffic_ops/app/lib/MojoPlugins/Health.pm               |  2 ++
 traffic_ops/app/t/deliveryservice.t                     |  2 +-
 traffic_ops/app/t/health.t                              |  6 +++---
 5 files changed, 16 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e6a0fd82/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 29a421e..9a4eb3d 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 => 1,
+			deliveryservice => 100,
 		},
 	},
 	federation_deliveryservice2 => {
 		new   => 'FederationDeliveryservice',
 		using => {
 			federation      => 2,
-			deliveryservice => 2,
+			deliveryservice => 200,
 		},
 	},
 	federation_deliveryservice3 => {
 		new   => 'FederationDeliveryservice',
 		using => {
 			federation      => 3,
-			deliveryservice => 3,
+			deliveryservice => 300,
 		},
 	},
 	federation_deliveryservice4 => {
 		new   => 'FederationDeliveryservice',
 		using => {
 			federation      => 4,
-			deliveryservice => 4,
+			deliveryservice => 400,
 		},
 	},
 );

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e6a0fd82/traffic_ops/app/lib/Fixtures/Server.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/Fixtures/Server.pm b/traffic_ops/app/lib/Fixtures/Server.pm
index 24f0b34..3624a51 100644
--- a/traffic_ops/app/lib/Fixtures/Server.pm
+++ b/traffic_ops/app/lib/Fixtures/Server.pm
@@ -115,10 +115,10 @@ my %definition_for = (
 			ilo_password     => '',
 			router_host_name => '',
 			router_port_name => '',
-			type             => 14,
+			type             => 4,
 			status           => 2,
-			profile          => 6,
-			cdn_id           => 1,
+			profile          => 3,
+			cdn_id           => 2,
 			cachegroup       => 1,
 			phys_location    => 1,
 		},
@@ -185,9 +185,9 @@ my %definition_for = (
 			ilo_password     => '',
 			router_host_name => '',
 			router_port_name => '',
-			type             => 14,
+			type             => 4,
 			status           => 2,
-			profile          => 7,
+			profile          => 3,
 			cdn_id           => 2,
 			cachegroup       => 1,
 			phys_location    => 1,
@@ -535,7 +535,7 @@ my %definition_for = (
 			ilo_password     => '',
 			router_host_name => '',
 			router_port_name => '',
-			type             => 1,
+			type             => 2,
 			status           => 2,
 			profile          => 1,
 			cdn_id           => 1,

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e6a0fd82/traffic_ops/app/lib/MojoPlugins/Health.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/MojoPlugins/Health.pm b/traffic_ops/app/lib/MojoPlugins/Health.pm
index cd2eda8..b06c33f 100755
--- a/traffic_ops/app/lib/MojoPlugins/Health.pm
+++ b/traffic_ops/app/lib/MojoPlugins/Health.pm
@@ -50,6 +50,8 @@ sub register {
 			);
 
 			while ( my $row = $rs_pp->next ) {
+			    my $profile_name = $row->profile->name;
+				$self->app->log->debug("profile_name #-> " . Dumper($profile_name));
 				if ( $row->profile->name =~ m/^RASCAL/ ) {
 					$rascal_profile = $row->profile->name;
 				}

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e6a0fd82/traffic_ops/app/t/deliveryservice.t
----------------------------------------------------------------------
diff --git a/traffic_ops/app/t/deliveryservice.t b/traffic_ops/app/t/deliveryservice.t
index 9dacd0b..b1d47a0 100644
--- a/traffic_ops/app/t/deliveryservice.t
+++ b/traffic_ops/app/t/deliveryservice.t
@@ -149,7 +149,7 @@ ok $t->post_ok(
 		'ds.geolimit_redirect_url'       => '',
 	}
 )->status_is(302), "create DNS DeliveryService";
-my $t2_id = &get_ds_id('tst_xml_id_2');
+$t2_id = &get_ds_id('tst_xml_id_2');
 ok defined($t2_id), "validated dns ds was added";
 
 #create DS ALL FIELDS

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e6a0fd82/traffic_ops/app/t/health.t
----------------------------------------------------------------------
diff --git a/traffic_ops/app/t/health.t b/traffic_ops/app/t/health.t
index bb9ac6a..c60bd9c 100644
--- a/traffic_ops/app/t/health.t
+++ b/traffic_ops/app/t/health.t
@@ -63,7 +63,7 @@ while ( my @row = $select->fetchrow_array ) {
 	push( @{ $lines->{ $row[0] } }, @row );
 }
 
-$query  = "select xml_id, global_max_mbps, global_max_tps from deliveryservice where active=1";
+$query  = "select xml_id, global_max_mbps, global_max_tps from deliveryservice where active=true";
 $select = $dbh->prepare($query);
 $select->execute();
 my $ds;
@@ -113,8 +113,8 @@ while ( my @row = $select->fetchrow_array ) {
 	push( @{ $lines->{ $row[0] } }, @row );
 }
 
-$t->get_ok("/health/cdn1.json")->status_is(200)->json_is( "/profiles/MID/MID1/health.threshold.loadavg", "25.0" )
-	->json_is( "/profiles/MID/MID1/history.count", "30" )->json_is( "/deliveryServices/test-ds1/status", "REPORTED" )
+$t->get_ok("/health/cdn2.json")->status_is(200)->json_is( "/profiles/MID/MID1/health.threshold.loadavg", "25.0" )
+	->json_is( "/profiles/MID/MID1/history.count", "30" )->json_is( "/deliveryServices/test-ds5/status", "REPORTED" )
 	->or( sub { diag $t->tx->res->content->asset->{content}; } );
 
 ok $t->get_ok('/logout')->status_is(302)->or( sub { diag $t->tx->res->content->asset->{content}; } );