From db99970b5ae146f6d1f5e74ec27c945202b8cda5 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Wed, 12 Aug 2015 20:22:03 -0700 Subject: [PATCH 1/6] Allowed for arbitrary length strings from urandom --- letsencrypt/plugins/manual_test.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/letsencrypt/plugins/manual_test.py b/letsencrypt/plugins/manual_test.py index 24d4a7ecc..caf7fb3c4 100644 --- a/letsencrypt/plugins/manual_test.py +++ b/letsencrypt/plugins/manual_test.py @@ -51,7 +51,7 @@ class ManualAuthenticatorTest(unittest.TestCase): @mock.patch("__builtin__.raw_input") def test_perform(self, mock_raw_input, mock_verify, mock_urandom, mock_stdout): - mock_urandom.return_value = "foo" + mock_urandom.side_effect = nonrandom_urandom mock_verify.return_value = True resp = challenges.SimpleHTTPResponse(tls=False) @@ -106,5 +106,10 @@ class ManualAuthenticatorTest(unittest.TestCase): mock_killpg.assert_called_once_with(1234, signal.SIGTERM) +def nonrandom_urandom(num_bytes): + """Returns a string of length num_bytes""" + return "x" * num_bytes + + if __name__ == "__main__": unittest.main() # pragma: no cover From baadccb746046f1c1c48b2e57eedf917144a1954 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Thu, 13 Aug 2015 11:15:43 -0700 Subject: [PATCH 2/6] Added mysql to travis --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 75653d4e9..c4bef391b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ language: python services: - rabbitmq + - mysql # http://docs.travis-ci.com/user/ci-environment/#CI-environment-OS before_install: @@ -25,6 +26,7 @@ env: addons: hosts: - le.wtf + mariadb: "10.0" install: "travis_retry pip install tox coveralls" before_script: '[ "xxx$BOULDER_INTEGRATION" = "xxx" ] || ./tests/boulder-start.sh' From 2b33dd42e8e4d1a542f332a7affeddc067b53dc9 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Thu, 13 Aug 2015 12:00:26 -0700 Subject: [PATCH 3/6] Specify mariadb version before mysql service? --- .travis.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index c4bef391b..621f68785 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,11 @@ language: python +# make sure simplehttp simple verification works (custom /etc/hosts) +addons: + hosts: + - le.wtf + mariadb: "10.0" + services: - rabbitmq - mysql @@ -22,12 +28,6 @@ env: - TOXENV=lint - TOXENV=cover -# make sure simplehttp simple verification works (custom /etc/hosts) -addons: - hosts: - - le.wtf - mariadb: "10.0" - install: "travis_retry pip install tox coveralls" before_script: '[ "xxx$BOULDER_INTEGRATION" = "xxx" ] || ./tests/boulder-start.sh' script: 'travis_retry tox && ([ "xxx$BOULDER_INTEGRATION" = "xxx" ] || (source .tox/$TOXENV/bin/activate && ./tests/boulder-integration.sh))' From f39e6c672d2b0c3d7e231297916379ccaf7842c1 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Thu, 13 Aug 2015 12:24:34 -0700 Subject: [PATCH 4/6] Create databases in travis --- .travis.yml | 12 ++++++------ tests/boulder-start.sh | 5 +++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 621f68785..c4bef391b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,5 @@ language: python -# make sure simplehttp simple verification works (custom /etc/hosts) -addons: - hosts: - - le.wtf - mariadb: "10.0" - services: - rabbitmq - mysql @@ -28,6 +22,12 @@ env: - TOXENV=lint - TOXENV=cover +# make sure simplehttp simple verification works (custom /etc/hosts) +addons: + hosts: + - le.wtf + mariadb: "10.0" + install: "travis_retry pip install tox coveralls" before_script: '[ "xxx$BOULDER_INTEGRATION" = "xxx" ] || ./tests/boulder-start.sh' script: 'travis_retry tox && ([ "xxx$BOULDER_INTEGRATION" = "xxx" ] || (source .tox/$TOXENV/bin/activate && ./tests/boulder-integration.sh))' diff --git a/tests/boulder-start.sh b/tests/boulder-start.sh index 8cb7fefce..6ca9e577f 100755 --- a/tests/boulder-start.sh +++ b/tests/boulder-start.sh @@ -5,5 +5,10 @@ export GOPATH="${GOPATH:-/tmp/go}" go get -d github.com/letsencrypt/boulder cd $GOPATH/src/github.com/letsencrypt/boulder + +if [ "${TRAVIS}" == "true" ]; then + ./test/create_db.sh || die "unable to create the boulder database with test/create_db.sh" +fi + ./start.py & # Hopefully start.py bootstraps before integration test is started... From bda953a2cb903750f26140ac115d1ea7bc060bad Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Thu, 13 Aug 2015 12:31:13 -0700 Subject: [PATCH 5/6] Removed conditional around create_db --- tests/boulder-start.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/boulder-start.sh b/tests/boulder-start.sh index 6ca9e577f..2ab97f53d 100755 --- a/tests/boulder-start.sh +++ b/tests/boulder-start.sh @@ -5,10 +5,6 @@ export GOPATH="${GOPATH:-/tmp/go}" go get -d github.com/letsencrypt/boulder cd $GOPATH/src/github.com/letsencrypt/boulder - -if [ "${TRAVIS}" == "true" ]; then - ./test/create_db.sh || die "unable to create the boulder database with test/create_db.sh" -fi - +./test/create_db.sh ./start.py & # Hopefully start.py bootstraps before integration test is started...