Github user ericcarlschwartz commented on a diff in the pull request: https://github.com/apache/trafficserver/pull/172#discussion_r25521956 --- Diff: ci/new_tsqa/tests/test_spdy_protocol_select.py --- @@ -0,0 +1,141 @@ +# 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 os +import requests +import time +import logging +import subprocess + +import helpers + +import tsqa.test_cases +import tsqa.utils +import tsqa.endpoint + +log = logging.getLogger(__name__) + +class TestSPDY(helpers.EnvironmentCase): + environment_factory = { + 'configure': {'enable-spdy': None}, + 'env': {'PKG_CONFIG_PATH': '/opt/spdylay/lib/pkgconfig/'}, + } + + @classmethod + def setUpEnv(cls, env): + ''' + This function is responsible for setting up the environment for this fixture + This includes everything pre-daemon start + ''' + + # set up spdycat + build_dir = os.environ.get('top_builddir', '../..') + cls.client = '%s/spdylay/src/spdycat' % build_dir + log.info('top build_dir = {0}'.format(build_dir)) + log.info('spdycat path = {0}'.format(cls.client)) + + # get spdy server ports + cls.spdy_port = tsqa.utils.bind_unused_port()[1] + log.info('spdy server port = {0}'.format(cls.spdy_port)) + cls.http_port = tsqa.utils.bind_unused_port()[1] + log.info('http server port = {0}'.format(cls.http_port)) + + cls.configs['remap.config'].add_line('map / http://www.yahoo.com/\n') + + # set only one ET_NET thread (so we don't have to worry about the per-thread pools causing issues) + cls.configs['records.config']['CONFIG']['proxy.config.exec_thread.limit'] = 1 + cls.configs['records.config']['CONFIG']['proxy.config.exec_thread.autoconfig'] = 0 + + # SPDY configs + cls.configs['records.config']['CONFIG']['proxy.config.http.server_ports'] += ' {0}:ssl {1}:proto=http:ssl'.format(cls.spdy_port, cls.http_port) + cls.configs['records.config']['CONFIG']['proxy.config.ssl.server.cert.path'] = helpers.tests_file_path('rsa_keys') + + # optional enable debug logs + #cls.configs['records.config']['CONFIG']['proxy.config.diags.debug.enabled'] = 1 + #cls.configs['records.config']['CONFIG']['proxy.config.diags.debug.tags'] = 'http.*|dns.*|ssl' + + # configure SSL multicert + cls.configs['ssl_multicert.config'].add_line('dest_ip=* ssl_cert_name={0}\n'.format(helpers.tests_file_path('rsa_keys/www.example.com.pem'))) + + @classmethod + def callSpdycat(self, port, path, args): + full_args = [self.client,'https://localhost:%d%s' % (port, path)] + args + self.log.info('full args = {0}'.format(full_args)) + p = subprocess.Popen(full_args, stdout=subprocess.PIPE, + stdin=subprocess.PIPE) + self.stdout, self.stderr = p.communicate() + return p.returncode + +""" +TODO: re-add spdy2 tests. looks like support here might be lacking some way. was not able to get ATS to advertise spdy/2 +even when it was explicitly set with proto=spdy/2 +""" +class TestSPDYv2(TestSPDY): + @classmethod + def setUpClass(cls): + ''' + Skip spdy2 tests for now + ''' + raise helpers.unittest.SkipTest('Skipping spdy/2 tests') + + @classmethod + def setUpEnv(cls, env): + ''' + This function is responsible for setting up the environment for this fixture + This includes everything pre-daemon start + ''' + + cls.spdy2_port = tsqa.utils.bind_unused_port()[1] + log.info('spdy2 server port = {0}'.format(cls.spdy2_port)) + # make sure we add port supports spdy2 + cls.configs['records.config']['CONFIG']['proxy.config.http.server_ports'] += ' {0}:proto=spdy/2:ssl'.format(cls.spdy2_port) + + super(TestSPDYv2, cls).setUpEnv(env) --- End diff -- This still isn't working for me. I'm checking that the correct config values are being set and seeing a spdy 2 port but getting a fatal EOF INFO 2015-02-27 09:04:59,501 - 44771 51987:ssl 58998:proto=http:ssl 57071:proto=spdy/2:ssl Test that the origin does in fact support spdy 2 ... INFO 2015-02-27 09:05:02,728 - full args = ['../../spdylay/src/spdycat', 'https://localhost:57071/', '-v', '--spdy2'] Fatal: EOF reqnum=1, completed=0 Some requests were not processed. total=1, processed=0 INFO 2015-02-27 09:05:02,840 - [ 0.005] Handshake complete [ 0.005] send SYN_STREAM frame <version=2, flags=1, length=182> (stream_id=1, assoc_stream_id=0, pri=3) :host: localhost:57071 :method: GET :path: / :scheme: https :version: HTTP/1.1 accept: */* accept-encoding: gzip, deflate user-agent: spdylay/1.3.2-DEV
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---