From f8b3750c02aedf7188b829306f7b4251b24173ff Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Fri, 26 Jun 2015 06:30:47 +0000 Subject: [PATCH] Run letsencrypt/tests/boulder-integration.sh from integration tests. --- .travis.yml | 6 +++--- test.sh | 22 ++++++++++---------- test/amqp-integration-test.py | 39 ++++++----------------------------- 3 files changed, 20 insertions(+), 47 deletions(-) diff --git a/.travis.yml b/.travis.yml index 608527277..3f4b077aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,15 +31,15 @@ before_install: # we add a symlink. - mkdir -p $TRAVIS_BUILD_DIR $GOPATH/src/github.com/letsencrypt - test ! -d $GOPATH/src/github.com/letsencrypt/boulder && ln -s $TRAVIS_BUILD_DIR $GOPATH/src/github.com/letsencrypt/boulder || true - - git clone https://www.github.com/letsencrypt/lets-encrypt-preview.git /tmp/letsencrypt - - cd /tmp/letsencrypt + - git clone https://www.github.com/letsencrypt/lets-encrypt-preview.git "$LETSENCRYPT_PATH" + - cd "$LETSENCRYPT_PATH" - sudo ./bootstrap/debian.sh - virtualenv --no-site-packages -p python2 ./venv - travis_retry ./venv/bin/pip install -r requirements.txt -e . - "cd -" env: - - LETSENCRYPT_VENV=/tmp/letsencrypt/venv + - LETSENCRYPT_PATH=/tmp/letsencrypt script: - make -j4 # Travis has 2 cores per build instance diff --git a/test.sh b/test.sh index 780f16bdf..d435a589a 100755 --- a/test.sh +++ b/test.sh @@ -73,26 +73,26 @@ if [ ${FAILURE} != 0 ]; then exit ${FAILURE} fi -if [ -z "$LETSENCRYPT_VENV" ]; then - DEFAULT_LETSENCRYPT_PATH=$(mktemp -d -t leXXXX) - LETSENCRYPT_VENV="$DEFAULT_LETSENCRYPT_PATH/venv" +if [ -z "$LETSENCRYPT_PATH" ]; then + LETSENCRYPT_PATH=$(mktemp -d -t leXXXX) - echo "----------------------------------------------------" - echo "--- Checking out letsencrypt client is slow -------" - echo "--- Recommend setting \$LETSENCRYPT_VENV to -------" - echo "--- an already-initialized client virtualenv -------" - echo "----------------------------------------------------" + echo "------------------------------------------------" + echo "--- Checking out letsencrypt client is slow. ---" + echo "--- Recommend setting \$LETSENCRYPT_PATH to ---" + echo "--- client repo with initialized virtualenv ---" + echo "------------------------------------------------" run git clone \ https://www.github.com/letsencrypt/lets-encrypt-preview.git \ - $DEFAULT_LETSENCRYPT_PATH || exit 1 + $LETSENCRYPT_PATH || exit 1 - cd $DEFAULT_LETSENCRYPT_PATH + cd $LETSENCRYPT_PATH run virtualenv --no-site-packages -p python2 ./venv && \ ./venv/bin/pip install -r requirements.txt -e . || exit 1 cd - fi -export LETSENCRYPT_VENV +source $LETSENCRYPT_PATH/venv/bin/activate +export LETSENCRYPT_PATH run python test/amqp-integration-test.py diff --git a/test/amqp-integration-test.py b/test/amqp-integration-test.py index f3ee2a568..07c302dbe 100644 --- a/test/amqp-integration-test.py +++ b/test/amqp-integration-test.py @@ -64,42 +64,15 @@ def run_node_test(): return 0 + def run_client_tests(): - letsencrypt_bin = os.path.join(os.environ.get("LETSENCRYPT_VENV"), 'bin', 'letsencrypt') - - tempconfig = os.path.join(tempdir, "conf") - tempwork = os.path.join(tempdir, "work") - templogs = os.path.join(tempdir, "logs") - - base_cmd = ''' - %s \ - --authenticator standalone \ - --server http://localhost:4300/acme/new-reg \ - --dvsni-port 5001 \ - --config-dir %s \ - --work-dir %s \ - --logs-dir %s \ - --text \ - --agree-eula \ - --email "" \ - ''' % (letsencrypt_bin, tempconfig, tempwork, templogs) - - client_run(base_cmd, '--domains foo.com auth') - - # For now, the client renewer can only be configured by file, not - # command line, so we create a config file. - renewer_config_filename = os.path.join(tempconfig, "renewer.conf") - with open(renewer_config_filename, "w") as r: - r.write("""\ -renew_before_expiry = 10 years -deploy_before_expiry = 10 years -""") - - -def client_run(base_cmd, cmd): - if subprocess.Popen(base_cmd + cmd, shell=True).wait() != 0: + assert "LETSENCRYPT_PATH" in os.environ + root = os.environ["LETSENCRYPT_PATH"] + test_script_path = os.path.join(root, 'tests', 'boulder-integration.sh') + if subprocess.Popen(test_script_path, shell=True, cwd=root).wait() != 0: die() + try: start() run_node_test()