Run letsencrypt/tests/boulder-integration.sh from integration tests.

This commit is contained in:
Jakub Warmuz 2015-06-26 06:30:47 +00:00
parent 9e892b0773
commit f8b3750c02
No known key found for this signature in database
GPG Key ID: 2A7BAD3A489B52EA
3 changed files with 20 additions and 47 deletions

View File

@ -31,15 +31,15 @@ before_install:
# we add a symlink. # we add a symlink.
- mkdir -p $TRAVIS_BUILD_DIR $GOPATH/src/github.com/letsencrypt - 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 - 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 - git clone https://www.github.com/letsencrypt/lets-encrypt-preview.git "$LETSENCRYPT_PATH"
- cd /tmp/letsencrypt - cd "$LETSENCRYPT_PATH"
- sudo ./bootstrap/debian.sh - sudo ./bootstrap/debian.sh
- virtualenv --no-site-packages -p python2 ./venv - virtualenv --no-site-packages -p python2 ./venv
- travis_retry ./venv/bin/pip install -r requirements.txt -e . - travis_retry ./venv/bin/pip install -r requirements.txt -e .
- "cd -" - "cd -"
env: env:
- LETSENCRYPT_VENV=/tmp/letsencrypt/venv - LETSENCRYPT_PATH=/tmp/letsencrypt
script: script:
- make -j4 # Travis has 2 cores per build instance - make -j4 # Travis has 2 cores per build instance

22
test.sh
View File

@ -73,26 +73,26 @@ if [ ${FAILURE} != 0 ]; then
exit ${FAILURE} exit ${FAILURE}
fi fi
if [ -z "$LETSENCRYPT_VENV" ]; then if [ -z "$LETSENCRYPT_PATH" ]; then
DEFAULT_LETSENCRYPT_PATH=$(mktemp -d -t leXXXX) LETSENCRYPT_PATH=$(mktemp -d -t leXXXX)
LETSENCRYPT_VENV="$DEFAULT_LETSENCRYPT_PATH/venv"
echo "----------------------------------------------------" echo "------------------------------------------------"
echo "--- Checking out letsencrypt client is slow -------" echo "--- Checking out letsencrypt client is slow. ---"
echo "--- Recommend setting \$LETSENCRYPT_VENV to -------" echo "--- Recommend setting \$LETSENCRYPT_PATH to ---"
echo "--- an already-initialized client virtualenv -------" echo "--- client repo with initialized virtualenv ---"
echo "----------------------------------------------------" echo "------------------------------------------------"
run git clone \ run git clone \
https://www.github.com/letsencrypt/lets-encrypt-preview.git \ 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 && \ run virtualenv --no-site-packages -p python2 ./venv && \
./venv/bin/pip install -r requirements.txt -e . || exit 1 ./venv/bin/pip install -r requirements.txt -e . || exit 1
cd - cd -
fi fi
export LETSENCRYPT_VENV source $LETSENCRYPT_PATH/venv/bin/activate
export LETSENCRYPT_PATH
run python test/amqp-integration-test.py run python test/amqp-integration-test.py

View File

@ -64,42 +64,15 @@ def run_node_test():
return 0 return 0
def run_client_tests(): def run_client_tests():
letsencrypt_bin = os.path.join(os.environ.get("LETSENCRYPT_VENV"), 'bin', 'letsencrypt') assert "LETSENCRYPT_PATH" in os.environ
root = os.environ["LETSENCRYPT_PATH"]
tempconfig = os.path.join(tempdir, "conf") test_script_path = os.path.join(root, 'tests', 'boulder-integration.sh')
tempwork = os.path.join(tempdir, "work") if subprocess.Popen(test_script_path, shell=True, cwd=root).wait() != 0:
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:
die() die()
try: try:
start() start()
run_node_test() run_node_test()