trafficcontrol-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [incubator-trafficcontrol] 06/36: Update TO unit/integration tests for deep_caching_type
Date Wed, 24 Jan 2018 17:23:15 GMT
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit 87cc97c3fa945c7e1fd459bfd510e2605f3e7af3
Author: Rawlin Peters <rawlin_peters@comcast.com>
AuthorDate: Thu Oct 19 15:05:32 2017 -0600

    Update TO unit/integration tests for deep_caching_type
---
 traffic_ops/app/lib/Fixtures/Deliveryservice.pm           | 15 +++++++++++++++
 .../app/lib/Fixtures/Integration/Deliveryservice.pm       |  8 ++++++++
 traffic_ops/app/t/api/1.2/deliveryservice.t               |  7 +++++++
 traffic_ops/app/t/api/1.2/deliveryservice_crud.t          | 13 +++++++++++++
 traffic_ops/app/t/deliveryservice.t                       |  5 +++++
 5 files changed, 48 insertions(+)

diff --git a/traffic_ops/app/lib/Fixtures/Deliveryservice.pm b/traffic_ops/app/lib/Fixtures/Deliveryservice.pm
index 0ca854c..7cd06dc 100644
--- a/traffic_ops/app/lib/Fixtures/Deliveryservice.pm
+++ b/traffic_ops/app/lib/Fixtures/Deliveryservice.pm
@@ -27,6 +27,7 @@ my %definition_for = (
 			active                => 1,
 			tenant_id             => undef,
 			dscp                  => 40,
+			deep_caching_type     => 0,
 			routing_name          => 'foo',
 			qstring_ignore        => 0,
 			geo_limit             => 0,
@@ -66,6 +67,7 @@ my %definition_for = (
 			active                => 1,
 			tenant_id             => undef,
 			dscp                  => 40,
+			deep_caching_type     => 0,
 			routing_name          => 'foo',
 			qstring_ignore        => 0,
 			geo_limit             => 0,
@@ -105,6 +107,7 @@ my %definition_for = (
 			active                => 1,
 			tenant_id             => undef,
 			dscp                  => 40,
+			deep_caching_type     => 0,
 			routing_name          => 'foo',
 			qstring_ignore        => 0,
 			geo_limit             => 0,
@@ -144,6 +147,7 @@ my %definition_for = (
 			active                => 1,
 			tenant_id             => undef,
 			dscp                  => 40,
+			deep_caching_type     => 0,
 			routing_name          => 'foo',
 			qstring_ignore        => 0,
 			geo_limit             => 0,
@@ -183,6 +187,7 @@ my %definition_for = (
 			active                => 1,
 			tenant_id             => undef,
 			dscp                  => 40,
+			deep_caching_type     => 0,
 			routing_name          => 'foo',
 			qstring_ignore        => 0,
 			geo_limit             => 0,
@@ -222,6 +227,7 @@ my %definition_for = (
 			active                => 1,
 			tenant_id             => undef,
 			dscp                  => 40,
+			deep_caching_type     => 0,
 			routing_name          => 'foo',
 			qstring_ignore        => 0,
 			geo_limit             => 0,
@@ -261,6 +267,7 @@ my %definition_for = (
 			active                => 1,
 			tenant_id             => undef,
 			dscp                  => 40,
+			deep_caching_type     => 0,
 			routing_name          => 'foo',
 			qstring_ignore        => 0,
 			geo_limit             => 0,
@@ -298,6 +305,7 @@ my %definition_for = (
 			active                => 1,
 			tenant_id             => undef,
 			dscp                  => 40,
+			deep_caching_type     => 0,
 			routing_name          => 'foo',
 			qstring_ignore        => 0,
 			geo_limit             => 0,
@@ -335,6 +343,7 @@ my %definition_for = (
 			active                => 1,
 			tenant_id             => undef,
 			dscp                  => 40,
+			deep_caching_type     => 0,
 			routing_name          => 'foo',
 			qstring_ignore        => 0,
 			geo_limit             => 0,
@@ -372,6 +381,7 @@ my %definition_for = (
 			active                => 1,
 			tenant_id             => undef,
 			dscp                  => 40,
+			deep_caching_type     => 0,
 			routing_name          => 'foo',
 			qstring_ignore        => 0,
 			geo_limit             => 0,
@@ -409,6 +419,7 @@ my %definition_for = (
 			active                => 1,
 			tenant_id             => undef,
 			dscp                  => 40,
+			deep_caching_type     => 0,
 			routing_name          => 'foo',
 			qstring_ignore        => 0,
 			geo_limit             => 0,
@@ -446,6 +457,7 @@ my %definition_for = (
 			active                => 1,
 			tenant_id             => undef,
 			dscp                  => 40,
+			deep_caching_type     => 0,
 			routing_name          => 'foo',
 			qstring_ignore        => 0,
 			geo_limit             => 0,
@@ -483,6 +495,7 @@ my %definition_for = (
 			active                => 1,
 			tenant_id             => undef,
 			dscp                  => 40,
+			deep_caching_type     => 0,
 			routing_name          => 'foo',
 			qstring_ignore        => 0,
 			geo_limit             => 0,
@@ -520,6 +533,7 @@ my %definition_for = (
 			active                => 1,
 			tenant_id             => 10**9,
 			dscp                  => 40,
+			deep_caching_type     => 0,
 			routing_name          => 'foo',
 			qstring_ignore        => 0,
 			geo_limit             => 0,
@@ -559,6 +573,7 @@ my %definition_for = (
 			active                => 1,
 			tenant_id             => undef,
 			dscp                  => 40,
+			deep_caching_type     => 0,
 			routing_name          => 'foo',
 			qstring_ignore        => 0,
 			geo_limit             => 0,
diff --git a/traffic_ops/app/lib/Fixtures/Integration/Deliveryservice.pm b/traffic_ops/app/lib/Fixtures/Integration/Deliveryservice.pm
index c88ac07..6578119 100644
--- a/traffic_ops/app/lib/Fixtures/Integration/Deliveryservice.pm
+++ b/traffic_ops/app/lib/Fixtures/Integration/Deliveryservice.pm
@@ -47,6 +47,7 @@ my %definition_for = (
 			type                        => '16',
 			dns_bypass_ip6              => undef,
 			dscp                        => '40',
+			deep_caching_type           => 0,
 			routing_name                => 'foo',
 			mid_header_rewrite          => 'cond %{REMAP_PSEUDO_HOOK} __RETURN__ set-config proxy.config.http.parent_origin.dead_server_retry_enabled
1',
 			active                      => '1',
@@ -121,6 +122,7 @@ my %definition_for = (
 			max_dns_answers             => '0',
 			miss_lat                    => '41.881944',
 			dscp                        => '40',
+			deep_caching_type           => 0,
 			routing_name                => 'foo',
 			mid_header_rewrite          => undef,
 			regex_remap                 => undef,
@@ -143,6 +145,7 @@ my %definition_for = (
 			qstring_ignore              => '0',
 			ccr_dns_ttl                 => '3600',
 			dscp                        => '40',
+			deep_caching_type           => 0,
 			routing_name                => 'foo',
 			last_updated                => '2015-12-10 15:44:37',
 			org_server_fqdn             => 'http://images.origin.kabletown.net',
@@ -194,6 +197,7 @@ my %definition_for = (
 			mid_header_rewrite	 				=>
 				'cond %{REMAP_PSEUDO_HOOK} __RETURN__ set-config proxy.config.http.parent_origin.dead_server_retry_enabled
1__RETURN__ set-config proxy.config.http.parent_origin.simple_retry_enabled 1__RETURN__ set-config
proxy.config.http.parent_origin.simple_retry_response_codes "400,404,412"__RETURN__ set-config
proxy.config.http.parent_origin.dead_server_retry_response_codes "502,503" __RETURN__ set-config
proxy.config.http.connect_attempts_timeout 2 __RETURN__ set-config proxy.config.http.conne
[...]
 			dscp                        => '40',
+			deep_caching_type           => 0,
 			routing_name                => 'foo',
 			info_url                    => 'http://movies.info.kabletown.net',
 			last_updated                => '2015-12-10 15:44:37',
@@ -251,6 +255,7 @@ my %definition_for = (
 			regex_remap                 => undef,
 			dns_bypass_ip6              => undef,
 			dscp                        => '40',
+			deep_caching_type           => 0,
 			routing_name                => 'foo',
 			range_request_handling      => '0',
 			display_name                => 'tv-c1',
@@ -305,6 +310,7 @@ my %definition_for = (
 			check_path                  => '/crossdomain.xml',
 			dns_bypass_cname            => undef,
 			dscp                        => '40',
+			deep_caching_type           => 0,
 			routing_name                => 'foo',
 			remap_text                  => undef,
 			global_max_mbps             => '0',
@@ -356,6 +362,7 @@ my %definition_for = (
 			ccr_dns_ttl                 => '3600',
 			dns_bypass_cname            => undef,
 			dscp                        => '40',
+			deep_caching_type           => 0,
 			routing_name                => 'foo',
 			global_max_tps              => '0',
 			initial_dispersion          => '1',
@@ -394,6 +401,7 @@ my %definition_for = (
 			signing_algorithm           => undef,
 			dns_bypass_cname            => undef,
 			dscp                        => '40',
+			deep_caching_type           => 0,
 			routing_name                => 'foo',
 			geo_limit                   => '0',
 			initial_dispersion          => '1',
diff --git a/traffic_ops/app/t/api/1.2/deliveryservice.t b/traffic_ops/app/t/api/1.2/deliveryservice.t
index e73a7c5..6c3f3bf 100644
--- a/traffic_ops/app/t/api/1.2/deliveryservice.t
+++ b/traffic_ops/app/t/api/1.2/deliveryservice.t
@@ -82,6 +82,7 @@ $t->get_ok('/api/1.2/deliveryservices/100/servers/eligible')->status_is(200)->$c
 ok $t->get_ok("/api/1.2/deliveryservices")->status_is(200)->or( sub { diag $t->tx->res->content->asset->{content}
} )
 		->json_is( "/response/0/xmlId", "steering-ds1" )
 		->json_is( "/response/0/routingName", "foo" )
+		->json_is( "/response/0/deepCachingType", 0 )
 		->json_is( "/response/0/logsEnabled", 0 )
 		->json_is( "/response/0/ipv6RoutingEnabled", 1 )
 		->json_is( "/response/1/xmlId", "steering-ds2" );
@@ -205,6 +206,7 @@ ok $t->get_ok("/api/1.2/deliveryservices?logsEnabled=true")->status_is(200)->or(
 	ok $t->post_ok('/api/1.2/deliveryservices' => {Accept => 'application/json'} =>
json => {
 			"active" => \0,
 			"cdnId" => 100,
+			"deepCachingType" => "NEVER",
 			"displayName" => "ds_displayname_1",
 			"dscp" => 0,
 			"geoLimit" => 0,
@@ -228,6 +230,7 @@ ok $t->get_ok("/api/1.2/deliveryservices?logsEnabled=true")->status_is(200)->or(
         ->json_is( "/response/0/tenantId" => $tenant_id)
         ->json_is( "/response/0/cdnName" => "cdn1")
 		->json_is( "/response/0/routingName" => "foo")
+		->json_is( "/response/0/deepCachingType" => 0)
 		->json_is( "/response/0/displayName" => "ds_displayname_1")
 		->json_is( "/response/0/xmlId" => "ds_1")
 		->json_is( "/response/0/multiSiteOrigin" => 0)
@@ -240,6 +243,7 @@ ok $t->get_ok("/api/1.2/deliveryservices?logsEnabled=true")->status_is(200)->or(
 	ok $t->put_ok('/api/1.2/deliveryservices/' . $ds_id => {Accept => 'application/json'}
=> json => {
 			"active" => \1,
 			"cdnId" => 100,
+			"deepCachingType" => "NEVER",
             "displayName" => "ds_displayname_11",
 			"dscp" => 1,
 			"geoLimit" => 1,
@@ -265,6 +269,7 @@ ok $t->get_ok("/api/1.2/deliveryservices?logsEnabled=true")->status_is(200)->or(
 		->json_is( "/response/0/displayName" => "ds_displayname_11")
 		->json_is( "/response/0/xmlId" => "ds_1")
 		->json_is( "/response/0/routingName" => "bar")
+		->json_is( "/response/0/deepCachingType" => 0)
 		->json_is( "/response/0/multiSiteOrigin" => 0)
 		->json_is( "/response/0/orgServerFqdn" => "http://10.75.168.91")
 		->json_is( "/response/0/protocol" => 2)
@@ -277,6 +282,7 @@ ok $t->get_ok("/api/1.2/deliveryservices?logsEnabled=true")->status_is(200)->or(
 				"displayName" => "ds_displayname_11",
 				"dscp" => 1,
 				"routingName" => "baz",
+				"deepCachingType" => 0,
 				"geoLimit" => 1,
 				"geoProvider" => 1,
 				"ipv6RoutingEnabled" => 1,
@@ -306,6 +312,7 @@ ok $t->get_ok("/api/1.2/deliveryservices?logsEnabled=true")->status_is(200)->or(
 				"displayName" => "ds_displayname_11",
 				"dscp" => 1,
 				"routingName" => "foo",
+				"deepCachingType" => 0,
 				"geoLimit" => 1,
 				"geoProvider" => 1,
 				"initialDispersion" => 2,
diff --git a/traffic_ops/app/t/api/1.2/deliveryservice_crud.t b/traffic_ops/app/t/api/1.2/deliveryservice_crud.t
index 7dbe1de..cb36541 100644
--- a/traffic_ops/app/t/api/1.2/deliveryservice_crud.t
+++ b/traffic_ops/app/t/api/1.2/deliveryservice_crud.t
@@ -62,6 +62,7 @@ sub run_ut {
 	ok $t->get_ok("/api/1.2/deliveryservices")->status_is(200)->or( sub { diag $t->tx->res->content->asset->{content}
} )
 			->json_is( "/response/0/xmlId", "steering-ds1" )
 			->json_is( "/response/0/routingName", "foo" )
+			->json_is( "/response/0/deepCachingType", 0)
 			->json_is( "/response/0/logsEnabled", 0 )
 			->json_is( "/response/0/ipv6RoutingEnabled", 1 )
 			->json_is( "/response/1/xmlId", "steering-ds2" );
@@ -143,6 +144,7 @@ sub run_ut {
         	"active" => "false",
         	"dscp" => 0,
         	"routingName" => "foo",
+			"deepCachingType" => 0,
         	"ipv6RoutingEnabled" => "true",
         	"logsEnabled" => "true",
         	"initialDispersion" => 1,
@@ -159,6 +161,7 @@ sub run_ut {
 	    ->json_is( "/response/0/orgServerFqdn" => "http://10.75.168.91")
 	    ->json_is( "/response/0/cdnId" => 100)
 	    ->json_is( "/response/0/routingName" => "foo")
+	    ->json_is( "/response/0/deepCachingType" => 0)
 	    ->json_is( "/response/0/tenantId" => $tenant_id)
 	    ->json_is( "/response/0/profileId" => 300)
 	    ->json_is( "/response/0/protocol" => "1")
@@ -177,6 +180,7 @@ sub run_ut {
 	    ->json_is( "/response/0/orgServerFqdn" => "http://10.75.168.91")
 	    ->json_is( "/response/0/cdnId" => 100)
 	    ->json_is( "/response/0/routingName" => "foo")
+	    ->json_is( "/response/0/deepCachingType" => 0)
 	    ->json_is( "/response/0/tenantId" => $tenant_id)
 	    ->json_is( "/response/0/tenant" => $tenant_name)
 	    ->json_is( "/response/0/profileId" => 300)
@@ -204,6 +208,7 @@ sub run_ut {
 	        "active" => "false",
 	        "dscp" => 0,
 	        "routingName" => "foo",
+	        "deepCachingType" => 0,
 	        "ipv6RoutingEnabled" => "true",
 	        "logsEnabled" => "true",
 	        "initialDispersion" => 1,
@@ -246,6 +251,7 @@ sub run_ut {
 					"active"               => "false",
 					"dscp"                 => 0,
 					"routingName"          => "foo",
+					"deepCachingType"      => 0,
 					"ipv6RoutingEnabled"   => "true",
 					"logsEnabled"          => "true",
 					"initialDispersion"    => 1,
@@ -279,6 +285,7 @@ sub run_ut {
 					"active"               => "false",
 					"dscp"                 => 0,
 					"routingName"          => "foo",
+					"deepCachingType"      => 0,
 					"ipv6RoutingEnabled"   => "true",
 					"logsEnabled"          => "true",
 					"initialDispersion"    => 1,
@@ -312,6 +319,7 @@ sub run_ut {
        	        "active" => "false",
        	        "dscp" => 0,
        	        "routingName" => "foo",
+       	        "deepCachingType" => 0,
        	        "ipv6RoutingEnabled" => "true",
        	        "logsEnabled" => "true",
        	        "initialDispersion" => 1,
@@ -345,6 +353,7 @@ sub run_ut {
        	        "active" => "false",
        	        "dscp" => 0,
        	        "routingName" => "foo",
+       	        "deepCachingType" => 0,
        	        "ipv6RoutingEnabled" => "true",
        	        "logsEnabled" => "true",
        	        "initialDispersion" => 1,
@@ -379,6 +388,7 @@ sub run_ut {
        	        "active" => "false",
        	        "dscp" => 0,
        	        "routingName" => "foo",
+       	        "deepCachingType" => 0,
        	        "ipv6RoutingEnabled" => "true",
        	        "logsEnabled" => "true",
        	        "initialDispersion" => 1,
@@ -413,6 +423,7 @@ sub run_ut {
 	        "active" => "false",
 	        "dscp" => 0,
 	        "routingName" => "foo",
+	        "deepCachingType" => 0,
 	        "ipv6RoutingEnabled" => "true",
 	        "logsEnabled" => "true",
 	        "initialDispersion" => 1,
@@ -463,6 +474,7 @@ sub run_ut {
         "active" => "false",
         "dscp" => 0,
         "routingName" => "foo",
+        "deepCachingType" => 0,
         "ipv6RoutingEnabled" => "true",
         "logsEnabled" => "true",
         "initialDispersion" => 1,
@@ -509,6 +521,7 @@ sub run_ut {
         "active" => "false",
         "dscp" => 0,
         "routingName" => "foo",
+        "deepCachingType" => 0,
         "ipv6RoutingEnabled" => "true",
         "logsEnabled" => "true",
         "initialDispersion" => 1,
diff --git a/traffic_ops/app/t/deliveryservice.t b/traffic_ops/app/t/deliveryservice.t
index e580d2c..2e47697 100644
--- a/traffic_ops/app/t/deliveryservice.t
+++ b/traffic_ops/app/t/deliveryservice.t
@@ -63,6 +63,7 @@ ok $t->post_ok(
 		'ds.dns_bypass_ttl'              => '30',
 		'ds.dscp'                        => '40',
 		'ds.routing_name'                => 'foo',
+		'ds.deep_caching_type'           => '0',
 		'ds.geo_limit'                   => '0',
 		'ds.geo_limit_countries'         => '',
 		'ds.geo_provider'                => '1',
@@ -115,6 +116,7 @@ ok $t->post_ok(
 		'ds.dns_bypass_ttl'              => '30',
 		'ds.dscp'                        => '42',
 		'ds.routing_name'                => '',
+		'ds.deep_caching_type'           => '0',
 		'ds.geo_limit'                   => '0',
 		'ds.geo_limit_countries'         => '',
 		'ds.global_max_mbps'             => '',
@@ -166,6 +168,7 @@ ok $t->post_ok(
 		'ds.dns_bypass_ttl'              => '30',
 		'ds.dscp'                        => '40',
 		'ds.routing_name'                => 'foo',
+		'ds.deep_caching_type'           => '0',
 		'ds.geo_limit'                   => '1',
 		'ds.geo_limit_countries'         => '',
 		'ds.global_max_mbps'             => '30G',
@@ -246,6 +249,7 @@ ok $t->post_ok(
 		'ds.dns_bypass_ttl'              => '31',
 		'ds.dscp'                        => '41',
 		'ds.routing_name'                => 'bar',
+		'ds.deep_caching_type'           => '0',
 		'ds.geo_limit'                   => '2',
 		'ds.geo_limit_countries'         => '',
 		'ds.geo_provider'                => '1',
@@ -294,6 +298,7 @@ ok $t->get_ok('/datadeliveryservice')->status_is(200)
   ->or( sub { diag $t->tx->res->content->asset->{content}; } )
   ->json_is( '/1/dscp' => '41' )
   ->json_is( '/1/routing_name' => 'bar' )
+  ->json_is( '/1/deep_caching_type' => '0' )
   ->json_is( '/1/active' => '0' )
   ->json_is( '/1/profile_description' => 'mid description' )
   ->json_is( '/1/org_server_fqdn'     => 'http://update.knutsel.com' )

-- 
To stop receiving notification emails like this one, please contact
elsloo@apache.org.

Mime
View raw message