This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 9.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 8283e7e8084f9cf0264e2ec9fe0c5baaa3e25009
Author: Brian Neradt <[email protected]>
AuthorDate: Mon Feb 1 15:59:00 2021 -0600

    Updating to Proxy Verifier v2.0.0 (#7454)
    
    We will want to use Proxy Verifier v2.0.0 for it's delayed transaction
    and HTTP/2 to server capabilities. This updates the AuTest extensions to
    properly handle the new version.
---
 ci/jenkins/bin/autest.sh                           | 26 ++++++++++++++++++++--
 tests/gold_tests/autest-site/conditions.test.ext   |  4 ++++
 tests/gold_tests/autest-site/setup.cli.ext         | 21 ++++++++++++++++-
 .../autest-site/verifier_client.test.ext           | 13 ++++++++---
 .../autest-site/verifier_server.test.ext           | 17 +++++++++-----
 tests/prepare_proxy_verifier.sh                    |  8 +++----
 tests/proxy-verifier-version.txt                   |  1 +
 7 files changed, 74 insertions(+), 16 deletions(-)

diff --git a/ci/jenkins/bin/autest.sh b/ci/jenkins/bin/autest.sh
index dfe4b88..7ec18ee 100755
--- a/ci/jenkins/bin/autest.sh
+++ b/ci/jenkins/bin/autest.sh
@@ -46,6 +46,9 @@ URL="https://ci.trafficserver.apache.org/autest";
 JOB_ID=${ghprbPullId:-${ATS_BRANCH:-master}}
 AUSB="ausb-${JOB_ID}.${BUILD_NUMBER}"
 SANDBOX="/var/tmp/${AUSB}"
+PROXY_VERIFIER_VERSIONS="/home/jenkins/proxy-verifier"
+PROXY_VERIFIER_VERSION_FILE="tests/proxy-verifier-version.txt"
+PROXY_VERIFIER_PREPARE="tests/prepare_proxy_verifier.sh"
 
 # Optional settings
 CCACHE=""
@@ -57,6 +60,7 @@ QUIC=""
 CURL=""
 AUTEST_DEBUG=""
 AUTEST_VERBOSE=""
+PROXY_VERIFIER_ARGUMENT=""
 
 [ "1" == "$enable_ccache" ] && CCACHE="--enable-ccache"
 [ "1" == "$enable_werror" ] && WERROR="--enable-werror"
@@ -86,7 +90,8 @@ set -x
 
 # Configure
 autoreconf -if
-./configure --prefix="${INSTALL}" \
+./configure \
+    --prefix="${INSTALL}" \
     --with-user=jenkins \
     --enable-experimental-plugins \
     --enable-example-plugins \
@@ -111,7 +116,24 @@ AUTEST="/usr/bin/autest"
 [ ! -x ${AUTEST} ] && AUTEST="/usr/local/bin/autest"
 set -x
 
-${AUTEST} -D ./tests/gold_tests --sandbox "$SANDBOX" --ats-bin 
"${INSTALL}/bin" $AUTEST_DEBUG $AUTEST_VERBOSE
+pv_version=""
+if [ -f "${PROXY_VERIFIER_VERSION_FILE}" ]; then
+  pv_version=`cat "${PROXY_VERIFIER_VERSION_FILE}"`
+elif [ -f "${PROXY_VERIFIER_PREPARE}" ]; then
+  pv_version=`awk -F'"' '/^pv_version/ {print $2}' "${PROXY_VERIFIER_PREPARE}"`
+fi
+if [ "x${pv_version}" != "x" ]; then
+  PROXY_VERIFIER_BIN="${PROXY_VERIFIER_VERSIONS}/${pv_version}/bin"
+  PROXY_VERIFIER_ARGUMENT="--proxy-verifier-bin ${PROXY_VERIFIER_BIN}"
+fi
+
+${AUTEST} \
+    -D ./tests/gold_tests \
+    --sandbox "$SANDBOX" \
+    --ats-bin "${INSTALL}/bin" \
+    $PROXY_VERIFIER_ARGUMENT \
+    $AUTEST_DEBUG \
+    $AUTEST_VERBOSE
 status=$?
 
 set +x
diff --git a/tests/gold_tests/autest-site/conditions.test.ext 
b/tests/gold_tests/autest-site/conditions.test.ext
index c9d3a0d..52af993 100644
--- a/tests/gold_tests/autest-site/conditions.test.ext
+++ b/tests/gold_tests/autest-site/conditions.test.ext
@@ -40,6 +40,10 @@ def HasCurlVersion(self, version):
     return self.EnsureVersion(["curl", "--version"], min_version=version)
 
 
+def HasProxyVerifierVersion(self, version):
+    return self.EnsureVersion(["verifier-client", "--version"], 
min_version=version)
+
+
 def HasCurlFeature(self, feature):
 
     def default(output):
diff --git a/tests/gold_tests/autest-site/setup.cli.ext 
b/tests/gold_tests/autest-site/setup.cli.ext
index 14b14fd..e752fa0 100644
--- a/tests/gold_tests/autest-site/setup.cli.ext
+++ b/tests/gold_tests/autest-site/setup.cli.ext
@@ -23,6 +23,8 @@ import pprint
 import subprocess
 import shutil
 
+PROXY_VERIFIER_VERSION_FILENAME = 'proxy-verifier-version.txt'
+
 test_root = dirname(dirname(AutestSitePath))
 repo_root = dirname(test_root)
 
@@ -38,6 +40,9 @@ else:
 
 host.WriteVerbose(['ats'], "Test build root: {}:".format(ENV['BUILD_ROOT']))
 
+proxy_verifer_version_file = os.path.join(test_root, 
PROXY_VERIFIER_VERSION_FILENAME)
+proxy_verifer_version = open(proxy_verifer_version_file, "rt").read().strip()
+
 if Arguments.proxy_verifier_bin is not None:
     ENV['VERIFIER_BIN'] = Arguments.proxy_verifier_bin
     host.WriteVerbose(
@@ -47,7 +52,7 @@ if Arguments.proxy_verifier_bin is not None:
 else:
     # No Verifier bin path was specified. First see if a Proxy Verifier was
     # unpacked as a part of preparing for this test.
-    unpack_bin = os.path.join(test_root, 'proxy-verifier', 'unpack', 'bin')
+    unpack_bin = os.path.join(test_root, 'proxy-verifier', 'unpack', 
proxy_verifer_version, 'bin')
     if os.path.exists(os.path.join(unpack_bin, 'verifier-client')):
         ENV['VERIFIER_BIN'] = unpack_bin
         host.WriteVerbose(
@@ -68,6 +73,20 @@ else:
             host.WriteError("Could not find Proxy Verifier binaries. "
                             "Try running: ", prepare_proxy_verifier_path)
 
+required_pv_version = Version(proxy_verifer_version[1:])
+verifier_client = os.path.join(ENV['VERIFIER_BIN'], 'verifier-client')
+pv_version_out = subprocess.check_output([verifier_client, "--version"])
+pv_version = Version(pv_version_out.decode("utf-8").split()[1])
+if pv_version < required_pv_version:
+    host.WriteError(
+        f"Proxy Verifier at {verifier_client} is too old. "
+        f"Version required: {required_pv_version}, version found: 
{pv_version}")
+else:
+    host.WriteVerbose(
+        ['ats'],
+        f"Proxy Verifier at {verifier_client} has version: {pv_version}")
+
+
 if ENV['ATS_BIN'] is not None:
     # Add variables for Tests
     traffic_layout = os.path.join(ENV['ATS_BIN'], "traffic_layout")
diff --git a/tests/gold_tests/autest-site/verifier_client.test.ext 
b/tests/gold_tests/autest-site/verifier_client.test.ext
index 41ef41a..9ff5c03 100755
--- a/tests/gold_tests/autest-site/verifier_client.test.ext
+++ b/tests/gold_tests/autest-site/verifier_client.test.ext
@@ -24,7 +24,7 @@ from verifier_common import create_address_argument
 
 def _configure_client(obj, process, name, replay_path, http_ports=None,
                       https_ports=None, keys=None, ssl_cert='', ca_cert='',
-                      other_args='--verbose diag'):
+                      verbose=True, other_args=''):
     """
     Configure the process for running the verifier-client.
 
@@ -61,12 +61,14 @@ def _configure_client(obj, process, name, replay_path, 
http_ports=None,
     if not http_ports:
         http_ports = [8080]
     if http_ports:
+        command += "--connect-http "
         command += create_address_argument(http_ports)
         command += " "
 
     if not https_ports:
         https_ports = [4443]
     if https_ports:
+        command += "--connect-https "
         command += create_address_argument(https_ports)
         command += " "
 
@@ -94,6 +96,9 @@ def _configure_client(obj, process, name, replay_path, 
http_ports=None,
             process.Setup.Copy(ca_cert, run_ca_cert, CopyLogic.SoftFiles)
             command += ' --ca-certs "{}" '.format(run_ca_cert)
 
+    if verbose:
+        command += ' --verbose diag '
+
     if other_args:
         command += " {}".format(other_args)
 
@@ -110,7 +115,7 @@ def _configure_client(obj, process, name, replay_path, 
http_ports=None,
 
 def AddVerifierClientProcess(run, name, replay_path, http_ports=None,
                              https_ports=None, keys=None, ssl_cert='', 
ca_cert='',
-                             other_args='--verbose diag'):
+                             verbose=True, other_args=''):
     """
     Set the Default process of the test run to a verifier-client Process.
 
@@ -134,6 +139,8 @@ def AddVerifierClientProcess(run, name, replay_path, 
http_ports=None,
         ca_cert: (path) The location of the CA for HTTPS encryption. If this
             is not provided a stock CA will be used.
 
+        verbose: (bool) Whether to enable debug level logging.
+
         other_args: (str) Any other arbitrary options to pass to 
verifier-client.
 
     Returns:
@@ -143,7 +150,7 @@ def AddVerifierClientProcess(run, name, replay_path, 
http_ports=None,
 
     p = run.Processes.Default
     _configure_client(run, p, name, replay_path, http_ports, https_ports,
-                      keys, ssl_cert, ca_cert, other_args)
+                      keys, ssl_cert, ca_cert, verbose, other_args)
     return p
 
 
diff --git a/tests/gold_tests/autest-site/verifier_server.test.ext 
b/tests/gold_tests/autest-site/verifier_server.test.ext
index 3fd7f44..eab23ab 100755
--- a/tests/gold_tests/autest-site/verifier_server.test.ext
+++ b/tests/gold_tests/autest-site/verifier_server.test.ext
@@ -23,7 +23,7 @@ from verifier_common import create_address_argument
 
 
 def _configure_server(obj, process, name, replay_path, http_ports=None, 
https_ports=None,
-                      ssl_cert='', ca_cert='', other_args='--verbose diag'):
+                      ssl_cert='', ca_cert='', verbose=True, other_args=''):
     """
     Configure the provided process to run a verifier-server command.
 
@@ -55,7 +55,7 @@ def _configure_server(obj, process, name, replay_path, 
http_ports=None, https_po
         process.Variables['http_port'] = http_ports[0]
 
     if len(http_ports) > 0:
-        command += "--listen "
+        command += "--listen-http "
         command += create_address_argument(http_ports)
         command += " "
 
@@ -100,6 +100,9 @@ def _configure_server(obj, process, name, replay_path, 
http_ports=None, https_po
         process.Setup.Copy(replay_path, run_replay_path, CopyLogic.SoftFiles)
         command += "{} ".format(run_replay_path)
 
+    if verbose:
+        command += ' --verbose diag '
+
     if other_args:
         command += "{} ".format(other_args)
     process.Command = command
@@ -114,7 +117,7 @@ def _configure_server(obj, process, name, replay_path, 
http_ports=None, https_po
 
 def MakeVerifierServerProcess(test, name, replay_path, http_ports=None,
                               https_ports=None, ssl_cert='', ca_cert='',
-                              other_args='--verbose diag'):
+                              verbose=True, other_args=''):
     """
     Create a verifier-server process for the Test.
 
@@ -140,6 +143,8 @@ def MakeVerifierServerProcess(test, name, replay_path, 
http_ports=None,
         ca_cert: (path) The location of the CA for HTTPS encryption. If this
             is not provided a stock CA will be used.
 
+        verbose: (bool) Whether to enable debug level logging.
+
         other_args: (str) Any other arbitrary options to pass to 
verifier-server.
 
     Raises:
@@ -148,13 +153,13 @@ def MakeVerifierServerProcess(test, name, replay_path, 
http_ports=None,
     """
     server = test.Processes.Process(name)
     _configure_server(test, server, name, replay_path, http_ports, https_ports,
-                      ssl_cert, ca_cert, other_args)
+                      ssl_cert, ca_cert, verbose, other_args)
     return server
 
 
 def AddVerifierServerProcess(run, name, replay_path, http_ports=None,
                              https_ports=None, ssl_cert='', ca_cert='',
-                             other_args='--verbose diag'):
+                             verbose=True, other_args=''):
     """
     Create a verifier-server process and configure it for the given TestRun.
 
@@ -169,7 +174,7 @@ def AddVerifierServerProcess(run, name, replay_path, 
http_ports=None,
 
     server = run.Processes.Process(name)
     _configure_server(run, server, name, replay_path, http_ports, https_ports,
-                      ssl_cert, ca_cert, other_args)
+                      ssl_cert, ca_cert, verbose, other_args)
 
     client = run.Processes.Default
     client.StartBefore(server)
diff --git a/tests/prepare_proxy_verifier.sh b/tests/prepare_proxy_verifier.sh
index 6690b84..06a2faa 100755
--- a/tests/prepare_proxy_verifier.sh
+++ b/tests/prepare_proxy_verifier.sh
@@ -18,16 +18,16 @@
 #  limitations under the License.
 
 ROOT=${ROOT:-$(cd $(dirname $0) && git rev-parse --show-toplevel)}
+pv_name="proxy-verifier"
+pv_version=`cat ${ROOT}/tests/proxy-verifier-version.txt`
 pv_top_dir="${ROOT}/tests/proxy-verifier"
-pv_unpack_dir="${pv_top_dir}/unpack"
+pv_unpack_dir="${pv_top_dir}/unpack/${pv_version}"
 bin_dir="${pv_unpack_dir}/bin"
-pv_name="proxy-verifier"
-pv_version="v1.10.0"
 pv_dir="${pv_name}-${pv_version}"
 pv_tar_filename="${pv_dir}.tar.gz"
 pv_tar="${pv_top_dir}/${pv_tar_filename}"
 pv_tar_url="https://ci.trafficserver.apache.org/bintray/${pv_tar_filename}";
-expected_sha1="f9ad11942f9098733e0286112a3c17975ebed363"
+expected_sha1="f644ac9838ba74e674b9efe7e7b3d244037faf21"
 pv_client="${bin_dir}/verifier-client"
 pv_server="${bin_dir}/verifier-server"
 TAR=${TAR:-tar}
diff --git a/tests/proxy-verifier-version.txt b/tests/proxy-verifier-version.txt
new file mode 100644
index 0000000..46b105a
--- /dev/null
+++ b/tests/proxy-verifier-version.txt
@@ -0,0 +1 @@
+v2.0.0

Reply via email to