From 1fdf41e636ca81a9871b41c48d3e2e9a75083d0d Mon Sep 17 00:00:00 2001 From: Amjad Mashaal Date: Wed, 27 Jul 2016 19:21:26 +0200 Subject: [PATCH 1/2] Adding modification check against the current /letsencrypt-auto --- letsencrypt-auto-source/pieces/fetch.py | 2 +- tests/modification-check.sh | 21 +++++++++++++++++++++ tox.ini | 1 + 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100755 tests/modification-check.sh diff --git a/letsencrypt-auto-source/pieces/fetch.py b/letsencrypt-auto-source/pieces/fetch.py index d11f8da61..365a5a36a 100644 --- a/letsencrypt-auto-source/pieces/fetch.py +++ b/letsencrypt-auto-source/pieces/fetch.py @@ -2,7 +2,7 @@ # Print latest released version of LE to stdout: python fetch.py --latest-version - + # Download letsencrypt-auto script from git tag v1.2.3 into the folder I'm # in, and make sure its signature verifies: python fetch.py --le-auto-script v1.2.3 diff --git a/tests/modification-check.sh b/tests/modification-check.sh new file mode 100755 index 000000000..b9cc669ff --- /dev/null +++ b/tests/modification-check.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +temp_dir=`mktemp -d` + +# Script should be run from Certbot's root directory +cp letsencrypt-auto ${temp_dir}/to-be-checked +cp letsencrypt-auto-source/pieces/fetch.py ${temp_dir}/fetch.py +cd ${temp_dir} + +LATEST_VERSION=`python fetch.py --latest-version` +python fetch.py --le-auto-script v${LATEST_VERSION} + +cmp -s letsencrypt-auto to-be-checked + +if [ $? != 0 ]; then + echo "Root letsencrypt-auto has changed." + rm -rf temp_dir + exit 1 +fi + +rm -rf temp_dir diff --git a/tox.ini b/tox.ini index 27979d9df..e0fbc9502 100644 --- a/tox.ini +++ b/tox.ini @@ -84,6 +84,7 @@ commands = # At the moment, this tests under Python 2.7 only, as only that version is # readily available on the Trusty Docker image. commands = + {toxinidir}/tests/modification-check.sh docker build -t lea letsencrypt-auto-source docker run --rm -t -i lea whitelist_externals = From cd5b91e4ae0e323044a7264dcd00e4a70d18615e Mon Sep 17 00:00:00 2001 From: Amjad Mashaal Date: Sat, 27 Aug 2016 19:14:42 +0200 Subject: [PATCH 2/2] Adding root certbot-auto to modification check --- tests/modification-check.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/modification-check.sh b/tests/modification-check.sh index b9cc669ff..53a5efa93 100755 --- a/tests/modification-check.sh +++ b/tests/modification-check.sh @@ -3,19 +3,33 @@ temp_dir=`mktemp -d` # Script should be run from Certbot's root directory -cp letsencrypt-auto ${temp_dir}/to-be-checked +cp letsencrypt-auto ${temp_dir}/letsencrypt-to-be-checked +cp certbot-auto ${temp_dir}/certbot-to-be-checked + cp letsencrypt-auto-source/pieces/fetch.py ${temp_dir}/fetch.py cd ${temp_dir} LATEST_VERSION=`python fetch.py --latest-version` python fetch.py --le-auto-script v${LATEST_VERSION} -cmp -s letsencrypt-auto to-be-checked +cmp -s letsencrypt-auto letsencrypt-to-be-checked if [ $? != 0 ]; then echo "Root letsencrypt-auto has changed." rm -rf temp_dir exit 1 +else + echo "Root letsencrypt-auto is unchanged." +fi + +cmp -s letsencrypt-auto certbot-to-be-checked + +if [ $? != 0 ]; then + echo "Root certbot-auto has changed." + rm -rf temp_dir + exit 1 +else + echo "Root certbot-auto is unchanged." fi rm -rf temp_dir