Commit graph

144 commits

Author SHA1 Message Date
Zach Shepherd
9e206f8024 DigitalOcean DNS Authenticator
Implement an Authenticator which can fulfill a dns-01 challenge using the
DigitalOcean API. Applicable only for domains using DigitalOcean for DNS.

Testing Done:
 * `tox -e py27`
 * `tox -e lint`
 * Manual testing:
    * Used `certbot certonly --dns-digitalocean -d`, specifying a
      credentials file as a command line argument. Verified that a
      certificate was successfully obtained without user interaction.
    * Used `certbot certonly --dns-digitalocean -d`, without specifying a
      credentials file as a command line argument. Verified that the user
      was prompted and that a certificate was successfully obtained.
    * Used `certbot certonly -d`. Verified that the user was prompted for
      a credentials file after selecting digitalocean interactively and
      that a certificate was successfully obtained.
    * Used `certbot renew --force-renewal`. Verified that certificates
      were renewed without user interaction.
 * Negative testing:
    * Path to non-existent credentials file.
    * Credentials file with unsafe permissions (644).
    * Credentials file missing token.
    * Credentials file with blank token.
    * Credentials file with incorrect token.
    * Domain name not registered to DigitalOcean account.
2017-05-11 17:26:02 -07:00
Brad Warren
be7e99a461 Pin dependency versions when using tools/venv.sh (#4629)
* Revert "Pin python-augeas version to avoid error with 1.0.0 (#4422)"

This reverts commit 1c51ae2588.

* make dependency-requirements

* separate certbot and dependency requirements

* fix build.py

* update hashin comment

* simplify release pinning

* separate letsencrypt dependency

* pin hashes in venv

* error out when bad things happen

* use pinned dependencies in tox

* Revert "pin hashes in venv"

This reverts commit 1cd38a9e50.

* use pip_install.sh in venv_common

* quote pip install args

* bump mock version
2017-05-11 10:06:05 -07:00
Zach Shepherd
db6defe614 Cloudflare DNS Authenticator
Implement an Authenticator which can fulfill a dns-01 challenge using the
Cloudflare API. Applicable only for domains using Cloudflare for DNS.

Testing Done:
 * `tox -e py27`
 * `tox -e lint`
 * Manual testing:
    * Used `certbot certonly --dns-cloudflare -d`, specifying a
      credentials file as a command line argument. Verified that a
      certificate was successfully obtained without user interaction.
    * Used `certbot certonly --dns-cloudflare -d`, without specifying a
      credentials file as a command line argument. Verified that the user
      was prompted and that a certificate was successfully obtained.
    * Used `certbot certonly -d`. Verified that the user was prompted for
      a credentials file after selecting cloudflare interactively and
      that a certificate was successfully obtained.
    * Used `certbot renew --force-renewal`. Verified that certificates
      were renewed without user interaction.
 * Negative testing:
    * Path to non-existent credentials file.
    * Credentials file with unsafe permissions (644).
    * Credentials file missing e-mail address.
    * Credentials file with blank API key.
    * Credentials file with incorrect e-mail address.
    * Credentials file with malformed API key.
    * Credentials file with invalid API key.
    * Domain name not registered to Cloudflare account.
2017-05-10 15:26:51 -07:00
Zach Shepherd
6670f828ef Deduplicate package lists in tox.ini (#4608)
Use substitution of values form other sections[1] to deduplicate information
in tox.ini, including pip install arguments and package paths.

1 - https://tox.readthedocs.io/en/latest/config.html#substitution-for-values-from-other-sections
2017-05-08 11:54:12 -07:00
Brad Warren
5ca8f7c5b9 Add lockfile (#4449)
* add lock_file

* cleanup lock file

* Add LockFile tests

* add lock_dir

* add lock_dir_until_exit

* add set_up_core_dir and move lock_dir_until_exit

* Move lock_and_call to certbot.test.util

* Add lock to Apache

* Add lock to the Nginx plugin

* Improve permissions error message

* sort plugins

* add test_prepare_order

* provide more actionable permissions error

* Document and catch use of OSError

* don't lock a directory twice

* add conditional dependency on ordereddict

* Add lock_test

* expand sorted plugins comment

* Add lock_test to lint

* make make_lineage more conventional and flexible

* enhance lock_test.py

* add lock_test to tox

* Readd success message

* make py26 happy

* add test_acquire_without_deletion
2017-05-01 14:49:12 -07:00
dokazaki
8011fb2879 Add mypy (#4386)
* Initial configuration of mypy in box, correction of base mypy errors.

* Move mypy install to toe

* Add pylint comments for typing imports.

* Remove typing module for Python 2.6 compatibility.
2017-03-18 19:10:10 -07:00
Yen Chi Hsuan
4cad594b4b Python 3 compatibility for all tests (#4358) 2017-03-17 13:10:02 -07:00
Brad Warren
0d8a4b4ebd Make mod-check more flexible (#4268)
* fixes #4166

* Run mod-check from anywhere

* pass TRAVIS_BRANCH through in tox
2017-02-28 15:17:07 -08:00
Yen Chi Hsuan
7d02e129f9 Fix certbot-apache tests on Python 3 (#4172) 2017-02-24 18:21:21 -08:00
Brad Warren
be5bcfe463 Remove optional dependencies (#4088)
* Stop using already_listening in standalone

* remove already_listening

* remove psutil entirely

* fix #595

* Add basic perform test

* make pep8 happy

* Add test_perform_eacces

* add _setup_perform_error

* Add test_perform_unexpected_socket_error

* add test_perform_eaddrinuse_no_retry

* add test_perform_eaddrinuse_retry

* cleanup tests

* stop using dnspython

* don't install dns extras in tox

* remove dns extras from setup.py

* Add simple_verify back to DNS response

* remove dnspython from oldest tests
2017-01-30 16:55:54 -08:00
Brad Warren
ea951150a4 Enable Py36 Tests (#3972)
* add py36 to tox

* Add Python 3.6 tests to Travis

* Provide real path to python stdlib during tests

* set logs_dir in config_test

* set *_dirs in DetermineAccountTest

* Fix TLSSNI01Test

* Fix RenewalTest

* fix test_ancient_webroot_renewal_conf
2017-01-18 10:41:11 -08:00
Peter Eckersley
796220f6f1 Adopt consistent linting practices for the entire tree (#3843)
* Use the certbot pylintrc for the ACME module

* Further parallelise lint, and don't run PEP8 checks
2017-01-17 12:53:13 -08:00
Brad Warren
00e143d369 Serialize coverage tests (#3919)
* Serialize coverage tests

* add py27_install env

* Separate cover from integration tests

* Add docker to py27 integration tests
2016-12-20 16:24:33 -08:00
Peter Eckersley
59c602d9ca Parallalelise nosetests from tox (#3836)
* Parallalelise nosetests from tox

* Parallelise even more things, break even more things

* Now unbreak all the tests that aren't ready for ||ism

* Try to pass tests!

 - Remove non-working hack in reporter_test
 - also be selective about ||ism in the cover environment

* Try again

* certbot-apache tests also work, given enough time

* Nginx may need more time in Travis's cloud

* Unbreak reporter_test under ||ism

* More timeout

* Working again?

* This goes way faster

* Another big win

* Split a couple more large test suites

* A last improvement

* More ||ism!

* ||ise lint too

* Allow nosetests to figure out how many cores to use

* simplify merge

* Mark the new CLI tests as ||izable

* Simplify reporter_test changes

* Rationalise ||ism flags

* Re-up coverage

* Clean up reporter tests

* Stop modifying testdata during tests

* remove unused os
2016-12-06 20:39:16 -08:00
Brad Warren
edbb3a73c6 Take advantage of urllib3 pyopenssl rewrite (#3805)
* pin requests version in py26-oldest

* Determine requests security deps dynamically

Starting with requests 2.12, pyasn1 and ndg-httpsclient are no longer
needed to inject pyopenssl into urllib3. This change allows us to
determine whether or not these dependencies are required at install
time. If an older version of requests is used, these packages are
still installed. If a new version of requests is used, they are not
reducing the number of dependencies we have.

* Bump requests version in certbot-auto

* Use pkg_resources in activate test

Due to pip's lack of dependency resolution, the change to use
requests[extras] causes errors in acme.util_test because pkg_resources
accurately detects the "missing" dependency.

There isn't a real problem here. The problem comes from a brand new
requests and ancient pyopenssl as well as a unit test for
functionality we plan to remove in our next release. I modified
the unit test to fix the problem for now.

* Use six instead of pkg_resources for test

* Require requests<=2.11.1 in py27-oldest test

If we don't do this, we get test failures for the certbot package
which is actually a good thing! pkg_resources is catching the
unlikely but possible problem I describe in #3803 and erroring out
saying it is missing the necessary dependencies to run certbot.
Good job package resources.

* Undo changes to acme.util_test
2016-12-01 10:47:08 -08:00
Brad Warren
494c305b04 pin requests version in py26-oldest (#3803) 2016-11-21 17:56:22 -08:00
Amjad Mashaal
1e27e43c14 Expanding tests for le-auto, adding CentOS test suite (#2671)
* Adding Dockerfile for CentOS 6

* Adding CentOS 7 to LEA tests

* Enabling CentOS 6 LEA test

* Removing CentOS 7

* Fixing nits

* Using yum to install epel-release
2016-11-10 15:05:03 -08:00
Amjad Mashaal
c89bd421da Expanding tests for le-auto, adding Debian test suite (#2635)
* Adding Debian 7 (Wheezy) to LE tests

* Adding Debian 8 (Jessie) to LE tests

* Fixing Debian Wheezy certificate addition error

* Adding packages to LEA Debian Jessie test and refining the code commenting

* Adding installing OpenSSL to the Debian Wheezy LEA test script

* Removing LEA tests for Debian Jessie

* Fixing nits
2016-11-10 14:01:15 -08:00
Amjad Mashaal
469fc3775f Expanding tests for le-auto, adding Ubuntu test suite (#2548)
* Adding Ubuntu Wily to LEA testing

* Setting up certs correctly for Ubuntu 15.10

* Adding 12.04

* Removing redundant update-ca-certificates from 12.04 le-auto testing script

* Fixing OpenSSL on Precise

* Adding Vivid to le_auto tests

* Cleaning up LEA tests configuration for Trusty

* Ordering LEA test entries in .travis.yml and renaming them correctly

* Removing Ubuntu Vivid

* Refining comments

* Removing Ubuntu Wily since it reached EOL

* Removing .travis.yml duplicates

* Fixing nits
2016-11-10 13:15:17 -08:00
Amjad Mashaal
3534e4cb1f Allowing modification check to run using "tox" (#3704)
#3337 and #3338 should ideally run when the user type tox. This allows them to catch the problem locally before they make a PR.
2016-10-28 15:05:25 -07:00
Erica Portnoy
d54cb76432 Remove the curses dialog, thereby deprecating the --help and --dialog command line options (#3665)
* Remove the curses dialog, thereby deprecating the --help and --dialog command line options

* Deprecate --dialog and suppress --text
2016-10-21 15:45:57 -07:00
Brad Warren
cd74a07edf Fix Travis tests due to cffi error 2016-09-14 10:31:31 -07:00
Brad Warren
cb982af635 put dnspython in alphabetical order 2016-09-14 10:27:39 -07:00
Brad Warren
a54d9061ba Merge pull request #3342 from TheNavigat/test-modification
Adding modification check against the current /letsencrypt-auto
2016-08-29 10:16:20 -07:00
Brad Warren
8aadacbbb3 Merge pull request #3375 from yan12125/python3-certbot-unittests
Enable unit tests of certbot core on Python 3
2016-08-12 17:55:50 -07:00
Brad Warren
df96798642 Merge pull request #3393 from certbot/nginx-compatibility-test
Nginx compatibility test
2016-08-10 17:52:05 -07:00
Brad Warren
f864cd0cfe Add nginxroundtrip to tox 2016-08-10 16:43:15 -07:00
Brad Warren
fc86f869a7 add compatibility tests to travis 2016-08-10 16:33:56 -07:00
Joona Hoikkala
3591667d02
Fix tox tests 2016-08-10 10:43:54 +03:00
Yen Chi Hsuan
fe76d558ed Enable unit tests of certbot core on Python 3 2016-08-06 21:09:43 +08:00
Amjad Mashaal
1fdf41e636 Adding modification check against the current /letsencrypt-auto 2016-08-04 14:22:20 +02:00
Wilfried Teiken
827c93510c Merge branch 'add_dns01_challenge' of github.com:wteiken/letsencrypt into add_dns01_challenge 2016-07-31 20:13:36 -04:00
bmw
950710bdce Merge pull request #3042 from TheNavigat/envlist
Limiting tox envlist to really needed tests
2016-06-17 12:37:17 -07:00
Jacob Hoffman-Andrews
91cd19158e Improve user experience for linting.
Don't run pep8 for directories that we don't actually enforce pep8 on.
Install dependencies with -q.
Don't print reports, they make it hard to find the actual errors.
Remove deprecated fields from acme .pylintrc, they cause unnecessary messages
about deprecation.
2016-06-04 22:53:51 -07:00
Amjad Mashaal
4a8f71277c Limiting tox envlist to really needed tests 2016-05-28 02:03:51 +02:00
Wilfried Teiken
6196cf0aa7 Merge branch 'master' into add_dns01_challenge 2016-04-25 00:40:27 -04:00
Brad Warren
214343ed6a rename letshelp-letsencrypt 2016-04-13 17:42:19 -07:00
Brad Warren
4fab8751b2 s/letsencrypt/certbot letsencrypt-compatibility-test 2016-04-13 16:58:21 -07:00
Brad Warren
a43fac3277 s/letsencrypt/certbot letsencrypt-nginx tests 2016-04-13 16:45:54 -07:00
Brad Warren
2002511f81 s/letsencrypt/certbot letsencrypt-apache 2016-04-13 16:30:57 -07:00
Brad Warren
3961b70deb s/letsencrypt/certbot 2016-04-13 16:03:59 -07:00
Jakub Warmuz
3516b70884
apacheconftest: toxinidir instead of . 2016-04-10 18:45:08 +00:00
Jakub Warmuz
df2baae476
apacheconf: sane sudo letsencrypt (fixes #2800)
- hardcoded
  `LETSENCRYPT=/home/travis/build/letsencrypt/letsencrypt/.tox/apacheconftest/bin/letsencrypt`
  causes Travis tests to fail if running under any other Travis user
  (from e.g. a fork)

- `sudo env "PATH=$PATH" letsencrypt` should make sure that sudo can
  find letsencrypt binary from virtualenv; realpath is not necessary

- sudo is called already from within the test script, no need to sudo
  the entire script
2016-04-10 17:57:21 +00:00
Roy Wellington Ⅳ
af22467e07 Newline at end of tox.ini. 2016-02-26 21:53:31 -08:00
Wilfried Teiken
e8d09ea994 Merge remote-tracking branch 'upstream/master' into add_dns01_challenge 2016-02-12 23:32:34 -05:00
Brad Warren
45ee1eb889 Merge branch 'testing-dev-extras' 2016-02-12 16:19:57 -08:00
Erik Rose
aefd5b25e1 Revert switch to python setup.py test in tox.ini.
This had more of a purpose when we were moving mock to test_requires. I'll reintroduce this in the separate PR for that.

Also bring back the testing extra in tox for now.
2016-01-19 16:10:17 -05:00
Wilfried Teiken
b9dafc203f Merge branch 'master' into add_dns01_challenge 2016-01-14 23:01:06 -05:00
Erik Rose
ed562645e0 Master master into letsencrypt-auto-release so Travis will build it. 2016-01-11 21:45:16 -05:00
Erik Rose
6c05197a43 Remove mock as an install requirement.
The motivation is to free us of a reliance on a rather modern version of setuptools, which caused le-auto failures for people on Wheezy and other older distros. (The alternative would have been to forcibly upgrade setuptools as the old le-auto did, but less is more.)

Mock is used only in tests, so we move it to tests_require. It will still be installed automatically when setup.py test is run. Give all packages a test_suite so this works.

The "testing" extra remains for optional packages not required for the nose tests but used in tox. However, the extra is much less useful now and is a candidate for deletion. We could roll the list of packages therein into the tox config so as not to favor any particular package.

Remove tests_require=install_requires, which I don't think does anything useful, since install requirements are implicitly installed when running setup.py test.

Fix tests to pass with mock removed. We had to stop them pulling down LE from PyPI, since the current version there (0.1.1) requires mock and explodes when `letsencrypt` is run.
2016-01-11 21:26:41 -05:00