Commit graph

35 commits

Author SHA1 Message Date
Jordan Borean
caba47dd3f
Add support for GSSAPI/Kerberos to urls.py ()
* Add support for GSSAPI/Kerberos to urls.py

* Test out changes with the latest test container

* Get remote hosts working

* Fix up httptester_krb5_password reader

* Fix tests for opensuse and macOS

* Hopefully last lot of testing changes

* Dont do CBT on macOS

* Fixes from review
2020-10-13 14:16:07 +10:00
Jordan Borean
09c2475368
Update the tests to work with new httptester container () 2020-10-01 06:38:44 +10:00
Abhijeet Kasurde
159544610e
get_url: Handle same SHA sum for downloaded files ()
Fixes: 

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-09-01 09:55:08 -04:00
Edwin Hermans
eb8b3a8479
get_url - Allow checksum file to be local file:// url ()
This would be a partial solution for  in that the SHASUMS file can be downloaded and gpg verified but then used from the downloaded location to verify the get_url's file.
* Make checksum url parsing more explicit

Use urlsplit to test if the checksum string has a (currently tested and) supported url scheme.

* Fix whitespace
* Changelog fragment
* Added tests
* Fix typo in test setup
2020-08-17 12:21:15 -04:00
Matt Clay
4816bb4f43
More boilerplate fixes. ()
* Fix boilerplate in hacking dir.
* Fix boilerplate in docs dir.
* Fix boilerplate in integration tests.
* Fix boilerplate in examples.
2020-06-22 19:05:30 -07:00
Abhijeet Kasurde
7714f691eb wait_for simplehttpserver to come up online
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-04-28 09:43:07 -07:00
Yanis Guenane
4fd2dce7f3
Testing: Add support for AIX platform () 2020-01-29 15:56:51 -08:00
Martin Krizek
365f2aaed1 get_url: remove deprecated headers string format ()
Fixes 
2020-01-28 10:39:40 -05:00
Baptiste Mille-Mathias
32a8b620f3 [get_url] Return status_code on HTTP 304 ()
Return field status_code on HTTP status 304 (implemented by lkthomas)
Add an integration test for this case.
Fixes 
2019-12-19 14:50:44 -05:00
Danilo Bargen
35c415de98 get_url integration test: Fix missing conditional () 2019-10-31 15:17:38 -04:00
Matt Martz
7d51cac330 Don't treat no checksum as a checksum match ()
Fixes 
* moar tests for get_url fetch behavior with existing file
* add changelog fragment
2019-09-13 13:24:15 -04:00
Matt Martz
8bd4e2a144 cert validation fixes - Attempt 2 ()
* Attempt 2 of cert validation fixes

* Remove unused code

* Cleanup the tmp cert using atexit

* Fix linting issues

* Only add SSLValidationHandler when not HAS_SSLCONTEXT

* Catch value errors on non PEM certs

* Only catch NotImplementedError to avoid masking issues

* set self._context even with PyOpenSSLContext for conformity

* Fix error building

* normalize how we interact with the context we create

* Remove unused code

* Address test for py3.7 message difference

* open_url should pass the ca_path through

* Account for new error in url lookup test

* Guard some code behind whether or not we are validating certs

* Make _make_context public

* Move atexit.register up to where the tmp file is created
2019-05-31 16:35:25 -04:00
Tony Finch
ccad79d162 get_url: return no change in check mode when checksum matches ()
Signed-off-by: Tony Finch <dot@dotat.at>
2019-03-01 09:53:28 +00:00
Dag Wieers
8f671e6cff Squash redundant tasks ()
This PR includes some changes to reduce the number of tasks.
2019-02-26 15:09:42 -05:00
Matt Clay
a8116497ba More test fixes for split controller/remote tests. 2019-01-25 20:46:53 -08:00
Matt Clay
d2a7cc0b9f Fix integration tests to support remote hosts. 2019-01-24 19:57:04 -08:00
Matt Martz
5785de582f
Fix logic to not re-download existing files when force=no ()
* Fix logic to not re-download existing files when force=no. Fixes 

* Reduce logic complexity
2018-09-11 13:56:13 -05:00
David Rodríguez
600c7ac108 Fix remote checksums when paths have leading dots ()
* Fix remote checksums with paths have leading dots

* Fix result recorded from the wrong file

* Add changelog fragment
2018-09-11 12:47:29 -04:00
Shuang Wang
b03feb6d40 Implement part of [expend checksum format to <algorithm>:(<checksum>|<url>)] ()
* expend checksum format to <algorithm>:(<checksum>|<url>)

* continue to code at office

* ALPHA - expend checksum format to <algorithm>:(<checksum>|<url>)

* clean up tmpfile and comment

* try to add test code for 27617

* try to add test code for 27617

* try to add test code for 27617

* try to fix [Could not find or access 'testserver.py']

* fix test code [Could not find or access 'testserver.py']

* fix test code [add files dir]

* fix test code [files dir not exists]

* as [connection was closed before a valid response was received]

* [connection was closed before a valid response was received]

* [connection was closed before a valid response was received]

* add test item [sha1 and sha256]

* since [connection was closed before a valid response was received]

* fix [connection was closed before a valid response was received]

* fix test code typo

* add docs for 

* PR  is minor change

* fix pep8 issue.

* fix test code style.

* fix unexpected quote
2018-08-24 12:45:32 -04:00
Shuang Wang
68683b4c73 fix issue [ get_url does not change mode when checksum matches ] ()
* fix  

* add change log for 

* Cleanup tests and add tests for this scenario


Co-authored-by: ptux
2018-08-01 15:02:27 -04:00
Matt Clay
4e489d1be8
Update Shippable integration test groups. ()
* Update Shippable integration test groups.
* Update integration test group aliases.
* Rebalance AWS and Azure tests with extra group.
* Rebalance Windows tests with another group.
2018-07-23 20:46:22 -07:00
Matt Clay
c1f9efabf4
Overhaul httptester support in ansible-test. ()
- Works with the --remote option.
- Can be disabled with the --disable-httptester option.
- Change image with the --httptester option.
- Only load and run httptester for targets that require it.
2018-05-09 09:24:40 -07:00
Matt Clay
b92ef8e54a
Use HTTPS instead of HTTP for httpbin tests. ()
The httpbin.org site is now redirecting HTTP to HTTPS.
2018-05-01 16:28:42 -07:00
Matt Clay
7ea68a23c1 Disable failing tests. 2018-04-27 16:12:21 -07:00
Matt Martz
0507c907a9
get_url should accept headers as a dict, instead of only a complicated string ()
* get_url should accept headers as a dict, instead of only a complicated string

* update headers description text

* Add headers string and dict tests for get_url

* Add intg test for string header format parsing error

* Adjust deprecation version ahead 1 release, add the version dict format was added in to description
2018-04-10 11:50:39 -05:00
Pierre-Louis Bonicoli
cbb238522b get_url tests: controller & managed node can be distinct
Templating happens on the Ansible controller, not on the task’s target host.
2018-01-11 10:40:59 -08:00
Matt Martz
4fe08441be Deprecate tests used as filters ()
* Warn on tests used as filters

* Update docs, add aliases for tests that fit more gramatically with test syntax

* Fix rst formatting

* Add successful filter, alias of success

* Remove renamed_deprecation, it was overkill

* Make directory alias for is_dir

* Update tests to use proper jinja test syntax

* Update additional documentation, living outside of YAML files, to reflect proper jinja test syntax

* Add conversion script, porting guide updates, and changelog updates

* Update newly added uses of tests as filters

* No underscore variable

* Convert recent tests as filter changes to win_stat

* Fix some changes related to rebasing a few integration tests

* Make tests_as_filters_warning explicitly accept the name of the test, instead of inferring the name

* Add test for tests_as_filters_warning

* Update tests as filters in newly added/modified tests

* Address recent changes to several integration tests

* Address recent changes in cs_vpc
2017-11-27 17:58:08 -05:00
Matt Clay
a7d5492ea3 Fix github_issue test and enable in CI. 2017-09-01 14:13:34 -07:00
Dag Wieers
0e160d5c7e Ensure exit_json returns failed = False
This is required for modules that may return a non-zero `rc` value for a
successful run, similar to  for Windows fixing **win_chocolatey**.

We also disable the dependency on `rc` value only, even if `failed` was
set.

Adapted unit and integration tests to the new scheme.
Updated raw, shell, script, expect to take `rc` into account.
2017-05-30 14:56:31 -07:00
SesquipedalianDefenestrator
3f321e7591 Add check_mode to get_url ()
* Add check_mode to get_url that does a HEAD request to make sure the URL exists, but doesn't write the real file

* Add info about new --check behavior to docs.  Add tests for the new behavior.  Populate res_args with the info the tests are looking for.

* Add trailing comma

* Change nonexistent test URL to http://{{httpbin_host}/DOESNOTEXIST.  Fix spacing while I'm at it

* Further spacing cleanup

* State that this functionality is in Ansible 2.4+
2017-04-28 14:43:51 +01:00
Matt Martz
621e27b5dd Urls client cert auth ()
* Build HTTPSClientAuthHandler more similarly to how HTTPSHandler works

* Add docs for new client cert authentication

* Support older versions of python

* Simplify logic

* Initial support for client certs in urls.py

* Add an extra test

* Add a get_url test for client cert auth

* Add additional test for client cert auth, with validation and ssl mismatch

* Skip assert when http tester not available

* Update version_added for new options
2017-04-07 09:54:37 -07:00
Matt Clay
9213d0c5b0 Fix and enable more tests for osx and freebsd. ()
* Fix `iterators` test for osx.
* Enable `git` test for osx.
* Enable `get_url` test for osx and freebsd.
* Remove unused SNI_URI from uri test.
* Use ansible hosted SNI host oustside docker.
* Enable `uri` test for osx and freebsd.
* Enable `gathering_facts` test for osx.
* Skip single task on osx until test is fixed.
2017-01-19 17:10:33 -08:00
Matt Clay
6bbd92e422 Initial ansible-test implementation. () 2016-11-29 21:21:53 -08:00
Adrien Vergé
0e834fc9e4 Fix cosmetic problems in YAML source
This change corrects problems reported by the `yamllint` linter.

Since key duplication problems were removed in 4d48711, this commit
mainly fixes trailing spaces and extra empty lines at beginning/end of
files.
2016-11-11 14:50:57 -08:00
Matt Clay
75e4645ee7 Migrate Linux CI roles to test targets. () 2016-10-13 09:09:25 -07:00