* Move ansible.compat.tests to test/units/compat/.
* Fix unit test references to ansible.compat.tests.
* Move builtins compat to separate file.
* Fix classification of test/units/compat/ dir.
* ansible-test: add skip/windows/... alias to skip tests on specific Windows versions
* show what tests were skipped
* changes to logic to only skip if all Windows targets are set to skip
* codestyle improvements
* change warning message based on review
* check args type before running the Windows path
* Add symlinks sanity test.
* Replace legacy test symlinks with actual content.
* Remove dir symlink from template_jinja2_latest.
* Update import test to use generated library dir.
* Fix copy test symlink setup.
* Add unified diff output to environment validation.
This makes it easier to see where the environment changed.
* Compare Python interpreters by version to pip shebangs.
This helps expose cases where pip executables use a different
Python interpreter than is expected.
* Query `pip.__version__` instead of using `pip --version`.
This is a much faster way to query the pip version. It also more
closely matches how we invoke pip within ansible-test.
* Remove redundant environment scan between tests.
This reuses the environment scan from the end of the previous test
as the basis for comparison during the next test.
* win_exec: refactor PS exec runner
* more changes for PSCore compatibility
* made some changes based on the recent review
* split up module exec scripts for smaller payload
* removed C# module support to focus on just error msg improvement
* cleaned up c# test classifier code
* Fix ansible-test smoke tests across groups.
* Fix ansible-test list arg defaults.
* Fix ansible-test require and exclude delegation.
* Fix detection of Windows specific changes.
* Add minimal Windows testing for Python 3.7.
This removes the old name based version detection behavior and
uses versions defined in the docker completion file instead, as
the new containers do not follow the old naming scheme.
This prevents tests from loading modules outside the source tree,
which could result in testing the wrong module if a system-wide
install is present, or custom modules exist.
This can be used to run Python scripts from the repository with the
correct interpreter and allow collection of code coverage.
Useful for testing contrib inventory scripts.
* Make merge_type a list and apply merge_type in order
Allow use case of preferring strategic-merge and failing
back to merge, or just preferring a different merge type
* Improve k8s module test coverage
* new nios module support
* new nios module support
* new nios module support
* new nios module support
* new nios module support
* new nios module support
* new nios module support
* new nios module integration test support
* new nios module integration test support
* new nios module integration test support
* new nios module integration test support
* new nios module integration test support
* new nios module integration test support
* new nios module integration test support
* new nios module integration test support
* new nios module integration test support
* new nios module integration test support
* new nios module integration test support
* new nios module integration test support
* new nios module integration test support
* new nios module integration test support
* new nios module integration test support
* new nios module integration test support
* new nios module integration test support
* new nios module integration test support
* new nios module integration test support
* new nios module integration test support
* new nios module integration test support
* new nios module integration test support
* new nios module integration test support
* new nios module integration test support
* test/integration/targets/nios_naptr_record/tasks/nios_naptr_record_idempotence.yml
new nios module integration test support
* fix pep8 error
* fix pep8 error
* adding newline at end
* adding newline at end
* adding newline at end
* adding newline at end
* adding newline at end
* adding newline at end
* adding newline at end
* adding newline at end
* adding newline at end
* adding newline at end
* adding newline at end
* adding newline at end
* adding newline at end
* adding newline at end
* Using ACME test container for acme_account integration test.
* Removing dependency on setup_openssl. Waiting for controller and Pebble.
* More tinkering.
* Reducing number of tries.
* One more try.
* Another try.
* Added acme_certificate tests.
* Removed double key.
* Added tests for acme_certificate_revoke.
* Making task names more meaningful (during certificate generation).
* Using newer test container which integrates letsencrypt/pebble#137. Adding test for revoking certificate by its private key.
* Using new version of Pebble which limits the random auth delay.
* Simplifying certificates for revocation tests.
* Reworking acme_certificate tests (there are now more, but they are faster).
* Test whether account_key_content works.
* Preparing TLS-ALPN-01 support.
* Using official Ansible image of testing container on quay.io.
* Bumping version.
* Bumping version of test container to 1.1.0.
* Adjusting to new CI group names.
* Pass ACME simulator IP as playbook variable.
* Let test plugin wait for controller and CA endpoints to become active.
* Refactor common setup parts of tests to setup_acme.
* _ -> dummy
* Moving common obtain-cert.yml to setup_acme.
Now that we don't need to worry about python-2.4 and 2.5, we can make
some improvements to the way AnsiballZ handles modules.
* Change AnsiballZ wrapper to use import to invoke the module
We need the module to think of itself as a script because it could be
coded as:
main()
or as:
if __name__ == '__main__':
main()
Or even as:
if __name__ == '__main__':
random_function_name()
A script will invoke all of those. Prior to this change, we invoked
a second Python interpreter on the module so that it really was
a script. However, this means that we have to run python twice (once
for the AnsiballZ wrapper and once for the module). This change makes
the module think that it is a script (because __name__ in the module ==
'__main__') but it's actually being invoked by us importing the module
code.
There's three ways we've come up to do this.
* The most elegant is to use zipimporter and tell the import mechanism
that the module being loaded is __main__:
* 5959f11c9d/lib/ansible/executor/module_common.py (L175)
* zipimporter is nice because we do not have to extract the module from
the zip file and save it to the disk when we do that. The import
machinery does it all for us.
* The drawback is that modules do not have a __file__ which points
to a real file when they do this. Modules could be using __file__
to for a variety of reasons, most of those probably have
replacements (the most common one is to find a writable directory
for temporary files. AnsibleModule.tmpdir should be used instead)
We can monkeypatch __file__ in fom AnsibleModule initialization
but that's kind of gross. There's no way I can see to do this
from the wrapper.
* Next, there's imp.load_module():
* https://github.com/abadger/ansible/blob/340edf7489/lib/ansible/executor/module_common.py#L151
* imp has the nice property of allowing us to set __name__ to
__main__ without changing the name of the file itself
* We also don't have to do anything special to set __file__ for
backwards compatibility (although the reason for that is the
drawback):
* Its drawback is that it requires the file to exist on disk so we
have to explicitly extract it from the zipfile and save it to
a temporary file
* The last choice is to use exec to execute the module:
* https://github.com/abadger/ansible/blob/f47a4ccc76/lib/ansible/executor/module_common.py#L175
* The code we would have to maintain for this looks pretty clean.
In the wrapper we create a ModuleType, set __file__ on it, read
the module's contents in from the zip file and then exec it.
* Drawbacks: We still have to explicitly extract the file's contents
from the zip archive instead of letting python's import mechanism
handle it.
* Exec also has hidden performance issues and breaks certain
assumptions that modules could be making about their own code:
http://lucumr.pocoo.org/2011/2/1/exec-in-python/
Our plan is to use imp.load_module() for now, deprecate the use of
__file__ in modules, and switch to zipimport once the deprecation
period for __file__ is over (without monkeypatching a fake __file__ in
via AnsibleModule).
* Rename the name of the AnsiBallZ wrapped module
This makes it obvious that the wrapped module isn't the module file that
we distribute. It's part of trying to mitigate the fact that the module
is now named __main)).py in tracebacks.
* Shield all wrapper symbols inside of a function
With the new import code, all symbols in the wrapper become visible in
the module. To mitigate the chance of collisions, move most symbols
into a toplevel function. The only symbols left in the global namespace
are now _ANSIBALLZ_WRAPPER and _ansiballz_main.
revised porting guide entry
Integrate code coverage collection into AnsiballZ.
ci_coverage
ci_complete
* Update Shippable integration test groups.
* Update integration test group aliases.
* Rebalance AWS and Azure tests with extra group.
* Rebalance Windows tests with another group.
* leave vmware_guest_powerstate tests enabled, but revert changes from: 66743f33
* leave VM poweroff tests enabled, but revert changes from: 87d6bdaf
* bumped 'vcenter-test-container' version to '1.3.0'
* updated test task names based on PR feedback
* add aks module and integration tests
* linting
* update tests
* sanity check
* make some changes to AKS module
* make integration test work
* add fact
* add resource_group name
* add fact test
* fix test
* fix test
* linting
* changed line endings for facts
* output kubeconfig
* Update azure_rm_aks.py
* update integration test aliases
* update aliases
* add cloud_environment and auth_source to args
* Fix comments from Jborean93 (#3)
* update
* fix
* fix
* fix
* fix
* update doc
* fix
Previously the test framework (DCI, Zuul) were installing the various
dependencies, this meant the list of what was required was duplicated.
Having everything defined in ansible-test makes it easier for people to
run tests locally.
Also this allows the test to work correctly on Python 2 & Python 3
- 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.
* Include change classification data in metadata.
* Add support for disabled tests.
* Add support for unstable tests.
* Add support for unsupported tests.
* Overhaul integration aliases sanity test.
* Update Shippable scripts to handle unstable tests.
* Mark unstable Azure tests.
* Mark unstable Windows tests.
* Mark disabled tests.
* Fix type hint typos.
* Add one-time cloud env setup after delegation.
* Add generate_password to util.
* Add username/password support to HttpClient.
* Avoid pip requirement for ansible-test shell.
* Support provisioning Tower instances.
* allow ANSIBLE_KEEP_REMOTE_FILES for local test runner
* add ANSIBLE_KEEP_REMOTE_FILES to tox.ini, update docs
* Clarify handling of environment variables.
* added support for --testcase flag in ansible-test
* fixed command format
* added tab completion
* fixed sanity issues
* added documenation for --testcase
* don't autocomplete when multiple modules are selected
* hardcoded API profiles in azure_rm_common
* changed azure_rm_securitygroup module to use api_profiles, dynamic models, kwargs on all SDK methods
* changed azure_rm_containerinstance module to use api_profiles, dynamic models, kwargs on all SDK methods
* fixed polling performance issue in azure_rm_securitygroup (default poll interval was 30s)
* Adding new code for new module and new module_utils with the pip pyfmg package
* Changed login and logout functionality and renamed mod_utils file as well as cleaned up PEP8 syntax
* Removing extra Ansible parameters and fixing more syntax issues
* Fixing more syntax issues and comparing against previous FTNT script module
* Changing import location to pass syntax checks
* Fixing pylint errors
* Removing test files
* Add unit tests and enabling a login session check within main in order to throw error if network connection exception
* Fixing syntax issues for adding unit tests
* Changing case for pip package requirements
* adding comments
* adding version restriction on pip package for testing
* adding version restriction on pip package for testing
* More comments
* Fixing documentation errors and add the ability to skip a test if it isn't present
* Fixing Pep8 error with whitespace (tab) in the row
* Add missing pylint test for invalid path.
* Fix syntax in integration test.
* Use Write-Output in win_script test script.
* Fix pylint in explain mode.
* first dirty container instance
* added my name ;-)
* more updates
* more updates
* removed unnecessary stuff
* container instance updates
* several fixes
* undo changes in common
* removed unnecessary references, fixed delete
* added / updated parameters
* updated samples & comments
* updated docs, comments, samples and added registry credentials
* added ip address and port
* query existing container instance (but result not used yet)
* some major changes to the module
* more fixes
* added requirement for containerinstance module
* adding integration test
* fixes for pull request
* updated version
* updated version to 2.5
* updated version
* updated integration.cloud.azure.txt as requested by test framework
* removed due to merge reasons
* updated requirements-azure.txt
* undone azure-rm-common
* lf
* properly update test requirements
* first dirty container instance
* container instance updates
* several fixes
* review related updates
* review related fixes
* undo changes in common
* added / updated parameters
* query existing container instance (but result not used yet)
* updated version to 2.5
* updated version
* removed due to merge reasons
* updated requirements-azure.txt
* undone azure-rm-common
* properly update test requirements
* minor fix - sanity
* fix one issue after rebasing
* removed files accidentally added while rebasing
* removed checking for changes
* several fixes
* fixed sanity
* updates as requested by reviewers
* removed ci as it doesn't work
* reenabled ci
* renamed container instance, removed required: false
* removed default: null
* final updates according to the review
* one more fix
* first dirty container instance
* added my name ;-)
* more updates
* more updates
* removed unnecessary stuff
* container instance updates
* several fixes
* undo changes in common
* removed unnecessary references, fixed delete
* added / updated parameters
* updated samples & comments
* updated docs, comments, samples and added registry credentials
* added ip address and port
* query existing container instance (but result not used yet)
* some major changes to the module
* more fixes
* adding integration test
* fixes for pull request
* updated version
* updated version to 2.5
* updated version
* updated integration.cloud.azure.txt as requested by test framework
* removed due to merge reasons
* updated requirements-azure.txt
* undone azure-rm-common
* lf
* properly update test requirements
* review related updates
* first dirty container instance
* container instance updates
* several fixes
* review related fixes
* undo changes in common
* added / updated parameters
* query existing container instance (but result not used yet)
* updated version to 2.5
* updated version
* removed due to merge reasons
* updated requirements-azure.txt
* undone azure-rm-common
* properly update test requirements
* minor fix - sanity
* fix one issue after rebasing
* removed files accidentally added while rebasing
* removed checking for changes
* several fixes
* fixed sanity
* updates as requested by reviewers
* removed ci as it doesn't work
* reenabled ci
* renamed container instance, removed required: false
* removed default: null
* final updates according to the review
* one more fix
* changed location as default from resource group can't handle containers
* updates to container instance
* fixed mistakes during merge
* one more fix
* another mistake
* container instance fixes
* several fixes to container instance
* return value fix
* minor update
* just one api version right now
* fixed api version
* container instance does not suppurt api version
* removed unnecessary try blocks
* removed tags related things
* fixed pep8
* final fixes?
* final updates to the module
* more fixes
* Update validate-modules arg_spec introspection to be faster, by only mocking the imports we explicitly list
* The use of types.MethodType in redhat_subscription wasn't py3 compatible, use partial instead
* Remove argument_spec import hacks, make them errors, we can ignore them with ansible-test
* Enable the --arg-spec flag for validate-modules
* adding azure_rm_postgresqlserver
* removed semicolon placed by mistake
* updates to azure_rm_postgresqlserver
* updates to azure_rm_postgresqlserver
* updates to azure_rm_postgresqlserver
* updates to azure_rm_postgresqlserver
* updates to azure_rm_postgresqlserver
* updates to azure_rm_postgresqlserver
* updates to azure_rm_postgresqlserver
* updates to azure_rm_postgresqlserver
* Updated dependencies
* Add eos and fix tests to run multiple connections
* Update tests to report connection
* Add missing START messages
* Fix unspecified connection
* Python 3 updates
Exceptions don't have `.message` in Python 3
* Override `become` when using `connection=local`
* Slight restructuring to make eapi easier later on
* Move eapi toggle to prepare_eos
* Pull out connection on eapi tasks
This fix check for ESXi server instance before proceeding
with managing local user. Also, adds integration tests for
this change.
Fixes: #32465
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* add acr
* acr
* acr
* fix a minor error
* add tests and fixes as suggested
* use get_mgmt_svc_client to enable bi
* fixes as zim suggested
* code refinement
* get acr instance before update
* fix a bug
* remove Classic sku as it's going to deprecate
* pass sanity test
* fix sanity
* fixes based on comments
* fix broken namespace unregistered error
* fix a bug
* fix a bug
* fix
* add register namespace
* fixes tests
* remove pdb
* add ci azure test
* removed required: false
* renamed acr -> containerregistry
* fixed spelling mistake
* fixed idempotence
* fix for idempotence was wrong
* fixed a few issues
* different log when exception different than ResourceNotFound
* self.fail instead of log
* updated sample return value
* added login server in results
* fixed else
* fixed line too long
* cmp -> __ne__
* fixed trailing whitespace
* output.changed is false when instance updated
* fix for state change
* one more update
* update instance only when location or sku has changed
* fixed syntax error
* fixed acr test
* just removed unnecessary comment to trigger ci
* update return value shape
* flatten `state`
* change credential dictionary state
* add credentials to integration tests
* Fix azure_rm_acs due to Azure breaking API change
* resolve code review feedbacks
* resolve test failures
* better name
* ignore case for vm size
* reformat code
* resolve code review feedbacks
* Expand ansible-test --remote-terminate support:
- windows-integration
- network-integration
These commands previously accepted the option, but did not support it.
* Terminate windows and network instances when done.
* Use correct pip version in ansible-test.
* Add git fallback for validate-modules.
* Run sanity tests in a docker container.
* Use correct python version for sanity tests.
* Pin docker completion images and add default.
* Split pylint execution into multiple contexts.
* Only test .py files in use-argspec-type-path test.
* Accept identical python interpeter name or binary.
* Switch cloud tests to default container.
* Remove unused extras from pip install.
* Filter out empty pip commands.
* Don't force running of pip list.
* Support delegation for windows and network tests.
* Fix ansible-test python version usage.
* Fix ansible-test python version skipping.
* Use absolute path for log in ansible-test.
* Run vyos_command test on python 3.
* Fix windows/network instance persistence.
* Add `test/cache` dir to classification.
* Enable more python versions for network tests.
* Fix cs_router test.
* Add openssh-client to default docker container.
* Include Azure requirements in default container.
To do so, handling of pip requirements was updated to install each
set of requirements separately and then run a verification pass to
make sure there are no conflicts between requirements.
* Add missing --docker-no-pull option.
* Add documentation for the azure-requirements test.
* Show warning when using pylint on Python 2.6.
* Add pylint disable entries for Python 2.
* Fix unicode handling in ansible-test.
* Add missing documentation.
* Divide Windows integration tests into 2 groups.
* Support `none` for `--changed-all-target`.
* Run 2 separate Windows groups on Shippable.
* Only run smoketest and minimal for the group1 job.
* Move sanity into directory.
* Omit abstract classes from returned subclass list.
* Split sanity tests out into plugins.
* Fix abstract class handling for Python 3.
* Include .github in test targets. Fix BOTMETA.yml.
* Include bin in compile tests.
* Exclude links from test targets.
* Include bin in pep8 and pylint tests.
* Fix pep8 and pylint issues in bin dir.
We need to run network-integration against platform agnostic modules,
which they all are named as net_* .
There is a hardcoding in executor where if prefix is 'net' the hosts is set
to all, removing these lines to have desired behaviour.
* Ansible Config part2
- made dump_me nicer, added note this is not prod
- moved internal key removal function to vars
- carry tracebacks in errors we can now show tracebacks for plugins on vvv
- show inventory plugin tracebacks on vvv
- minor fixes to cg groups plugin
- draft config from plugin docs
- made search path warning 'saner' (top level dirs only)
- correctly display config entries and others
- removed unneeded code
- commented out some conn plugin specific from base.yml
- also deprecated sudo/su
- updated ssh conn docs
- shared get option method for connection plugins
- note about needing eval for defaults
- tailored yaml ext
- updated strategy entry
- for connection pliugins, options load on plugin load
- allow for long types in definitions
- better display in ansible-doc
- cleaned up/updated source docs and base.yml
- added many descriptions
- deprecated include toggles as include is
- draft backwards compat get_config
- fixes to ansible-config, added --only-changed
- some code reoorg
- small license headers
- show default in doc type
- pushed module utils details to 5vs
- work w/o config file
- PEPE ATE!
- moved loader to it's own file
- fixed rhn_register test
- fixed boto requirement in make tests
- I ate Pepe
- fixed dynamic eval of defaults
- better doc code
skip ipaddr filter tests when missing netaddr
removed devnull string from config
better becoem resolution
* killed extra space with extreeme prejudice
cause its an affront against all that is holy that 2 spaces touch each other!
shippable timing out on some images, but merging as it passes most
* replace boto with boto3 for the s3 module
make s3 pep8 and remove from legacy files
fix s3 unit tests
* fix indentation
* s3 module - if we can't create an MD5 sum return None and always upload file
* remove Location.DEFAULT which isn't used in boto3 and tidy up the docs
* pep8
* s3: remove default: null, empty aliases, and required: false from documentation
fix incorrectly documented defaults
* Porting s3 to boto3. Simplify some logic and remove unused imports
* Fix s3 module variables
* Fix a typo in s3 module and remove from pep8 legacy files
* s3: add pagination for listing objects.
Fix logic and use head_object instead of get_object for efficiency.
Fix typo in unit test.
* Fix pagination to maintain backwards compatibility.
Fix incorrect conditional.
Remove redundant variable assignment.
Fix s3 list_object pagination to return all pages
* Use the revised List Objects API as recommended.
* Wrap call to paginated_list in a try/except
Also remembered to allow marker/prefix/max_keys to modify what keys are listed
* Simplify argument
* Add new Fedora docker images with Python 3.
* Use consistent env var for lookup test.
* Fix testing of virtualenv with Python 3.
* Fix docker_secret tests on Fedora 26.
* Add Python 3 support to Fedora postgresql test.
* Add Python 3 support to Fedora mysql tests.
* Fix uri test server for Python 3 on Fedora.
* Fix iso_extract test for Python 3 on Fedora.
* Add Python 3 support for Fedora to openssl tests.
* Fix dnf group test for Python 3 on Fedora.
* Use force with user deletion in become test.