You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ja...@apache.org on 2015/04/24 05:23:51 UTC

[1/2] trafficserver git commit: add redirection test

Repository: trafficserver
Updated Branches:
  refs/heads/master fad02a76e -> 231f11e9a


add redirection test


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/609e1435
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/609e1435
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/609e1435

Branch: refs/heads/master
Commit: 609e143589d89b5be167914b70de99658776745f
Parents: fad02a7
Author: Feifei Cai <ff...@yahoo-inc.com>
Authored: Fri Mar 27 07:38:52 2015 +0000
Committer: Thomas Jackson <ja...@apache.org>
Committed: Thu Apr 23 20:17:06 2015 -0700

----------------------------------------------------------------------
 ci/new_tsqa/tests/test_redirection.py | 46 ++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/609e1435/ci/new_tsqa/tests/test_redirection.py
----------------------------------------------------------------------
diff --git a/ci/new_tsqa/tests/test_redirection.py b/ci/new_tsqa/tests/test_redirection.py
new file mode 100644
index 0000000..99fed96
--- /dev/null
+++ b/ci/new_tsqa/tests/test_redirection.py
@@ -0,0 +1,46 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+import requests
+import logging
+
+import helpers
+
+import tsqa.test_cases
+import tsqa.utils
+import tsqa.endpoint
+
+log = logging.getLogger(__name__)
+
+class TestRedirection(helpers.EnvironmentCase):
+    @classmethod
+    def setUpEnv(cls, env):
+        cls.configs['records.config']['CONFIG'].update({
+            'proxy.config.http.redirection_enabled': 1,
+            'proxy.config.http.number_of_redirections': 10
+        })
+        cls.configs['remap.config'].add_line('map / http://httpbin.org');
+
+    def test_redirection(self):
+        server_ports = self.configs['records.config']['CONFIG']['proxy.config.http.server_ports']
+
+        # By default Requests will perform location redirection
+        # Disable redirection handling with the allow_redirects parameter
+        r = requests.get('http://127.0.0.1:{0}/redirect/9'.format(server_ports), allow_redirects=False)
+        self.assertEqual(r.status_code, 200)
+
+        r = requests.get('http://127.0.0.1:{0}/redirect/10'.format(server_ports), allow_redirects=False)
+        self.assertEqual(r.status_code, 302)


[2/2] trafficserver git commit: use the in-build httpbin as origin server

Posted by ja...@apache.org.
use the in-build httpbin as origin server

This closes #183


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/231f11e9
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/231f11e9
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/231f11e9

Branch: refs/heads/master
Commit: 231f11e9ac59d028f1b92d44c6ee28af43515ee9
Parents: 609e143
Author: Feifei Cai <ff...@yahoo-inc.com>
Authored: Wed Apr 22 16:27:32 2015 +0000
Committer: Thomas Jackson <ja...@apache.org>
Committed: Thu Apr 23 20:17:11 2015 -0700

----------------------------------------------------------------------
 ci/new_tsqa/tests/test_redirection.py | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/231f11e9/ci/new_tsqa/tests/test_redirection.py
----------------------------------------------------------------------
diff --git a/ci/new_tsqa/tests/test_redirection.py b/ci/new_tsqa/tests/test_redirection.py
index 99fed96..1100dc1 100644
--- a/ci/new_tsqa/tests/test_redirection.py
+++ b/ci/new_tsqa/tests/test_redirection.py
@@ -15,24 +15,19 @@
 #  limitations under the License.
 
 import requests
-import logging
-
 import helpers
-
 import tsqa.test_cases
 import tsqa.utils
 import tsqa.endpoint
 
-log = logging.getLogger(__name__)
-
-class TestRedirection(helpers.EnvironmentCase):
+class TestRedirection(helpers.EnvironmentCase, tsqa.test_cases.HTTPBinCase):
     @classmethod
     def setUpEnv(cls, env):
         cls.configs['records.config']['CONFIG'].update({
             'proxy.config.http.redirection_enabled': 1,
             'proxy.config.http.number_of_redirections': 10
         })
-        cls.configs['remap.config'].add_line('map / http://httpbin.org');
+        cls.configs['remap.config'].add_line('map / http://127.0.0.1:{0}'.format(cls.http_endpoint.address[1]))
 
     def test_redirection(self):
         server_ports = self.configs['records.config']['CONFIG']['proxy.config.http.server_ports']