Commit graph

5364 commits

Author SHA1 Message Date
Sam Doran
9df9ed4cd3
Reinstall i18n files for PostgreSQL tests (#66734)
I am removing these from the test image to reduce its size a bit.
2020-01-24 12:16:40 -05:00
Michael Pechner
85b5f89ed6 ecs_tag and integration tests for new feature request (#66603)
* Added integrations test for ecs_tag
Testing invalid cluster test for the expected message.
Add idempotency test is  for adding tests to service and task_definition.
2020-01-24 10:09:36 -07:00
dexpl
1152774f92 git - add an 'archive_prefix' option (#66067)
Add integration tests for new option
2020-01-24 09:42:47 -05:00
Pilou
bbbdc1c25c throttle: fix linear based strategies (#65422)
* throttle tests: fix detection of parallel execution

The test wasn't able to detect if too many workers were running.

On my laptop:
- without this change, the 'throttle' target takes ~20 seconds
- with this change, the 'throttle' target takes ~70 seconds
- 1 second isn't long enough to encounter the issue

* Fix throttle test when strategy is 'free' based

'free' strategy allows multiple tasks to be executed in parallel: use
one 'throttledir' per task.

Use 'linear' strategy with a dedicated play for cleanup/setup tasks

* throttle: reset worker idx before queuing a new task

* TestStrategyBase: define task.throttle

otherwise '1' will be used instead of the default value due to the
following expression being equal to '1':

    int(templar.template(task_mock.throttle))

Co-authored-by: James Cammarata <jimi@sngx.net>
2020-01-24 08:18:08 -06:00
Prasad Katti
b16525b841 [aws] integration tests for ec2_vol (#66193) 2020-01-23 15:34:06 -07:00
Albert Siersema
4a0c875447 Working Cisco IOS macro editing (fixes #55211) (#55220)
* Working Cisco IOS macro editing (fixes #55211)

* Working Cisco IOS macro editing [fixed pylints] (fixes #55211)

* Added integration tests for edit_macro

* Added conditional integration tests for ios_config macro

* Cosmetic fix: when near block for added conditional integration tests for ios_config macro

* Move teardown to always for block
2020-01-23 21:19:15 +05:30
Andrew Klychkov
72fbed2c61 postgresql_user: add comment parameter (#66711)
* postgresql_user: add comment parameter

* add changelog

* fix CI
2020-01-23 14:34:50 +00:00
Abhijeet Kasurde
fc6476bd72
VMware: Handle multiple tags with different category (#66465)
vmware_tag_info used to return dict of tag information which caused
data loss when there are multiple tags with same name and different category ids.
This fix will add additional fact "tag_info" which will deprecated existing fact
"tag_facts".
The "tag_info" is a list which handles multiple tags with same name.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-01-23 10:15:57 +05:30
Rhys Campbell
05e034f899 Arbiter change and test additions (#59883) 2020-01-22 19:30:52 +00:00
Andrew Klychkov
fabb2eb555 mysql_db: add skip_lock_tables option (#66688)
* mysql_db: add skip_lock_tables option

* add changelog fragment
2020-01-22 20:19:49 +01:00
Martin Krizek
ec371eb227 Set HostVars._variable_manager's attrs (#65508)
When HostVars are part of the data that goes through (de)serialization
when being passed from a worker process to the main process, its
variable manager reference loses some of its attributes due to the
implementation of __getstate__ and __setstate__ (perf utilization).
Since HostVars already has those attributes, use __setstate__ to assign
them.

Fixes #65365
2020-01-22 05:57:09 -05:00
Sumit Jaiswal
0c4f167b82
fix 66530 (#66654) 2020-01-22 13:35:51 +05:30
Mike Wiebe
5c158755fc Fix fact gathering for sensor-groups (#66439) 2020-01-22 10:49:12 +05:30
Matt Clay
8f02022353 Remove unstable from aws_acm integration test.
The quota for the CI account has been increased, so tests are once again passing.
2020-01-21 17:22:09 -08:00
Jill R
d8c2f4738e CI is hitting 'maximum number of 2200 certificates' again, marking aws_acm unstable (#66665) 2020-01-21 15:03:03 -05:00
Adam Miller
22fe22f796 yum - fix bug where enablerepo is not honored when disablerepo all (#66557)
Fixes #66549

The inefficiency improvement
https://github.com/ansible/ansible/pull/63713 introduced a bug where
`enablerepo` was not being honored if combined with
`disablerepo="*"`. This fixes that issue.

Signed-off-by: Adam Miller <admiller@redhat.com>
2020-01-20 14:26:36 -05:00
sky-joker
1befb52321 VMware: add properties option to vmware_datastore_info module (#62940)
* add_properties_option_to_vmware_datastore_info
* fix document indent error
* add changelog file for vmware_datastore_info
2020-01-20 13:47:13 +05:30
Chris Van Heuveln
7fabb28d22 nxos_gir timeout fixes (#66043)
* nxos_gir timeout fixes

* additional setup/teardown cleanups for sanity test

* Add timeout extension comment to module header

* lint

* rework logic to use action plugin
2020-01-20 12:45:49 +05:30
Gonéri Le Bouder
986be77337 vmware_host_powermgmt_policy/test: just one esxi (#66515)
Since the run the test playbook in a vcenter+1esxi scenario, there is no
need of second host.

The commit also simplify the logic of the test.
2020-01-20 11:31:25 +05:30
Gonéri Le Bouder
2d0ccdc98c vmware_host_acceptance/test: fix the functional test (#66576)
Ensure the functional test is actually run. It works fine on a real
environment.
2020-01-20 11:21:53 +05:30
Paul Belanger
f46af19702
Revert "eos_config: Added fix for bug #54400 - support for !! in config mode (#63694)" (#66591)
This actually breaks iosxr_config, revert for now to make tests passing
again.

This reverts commit 7ddf7474d3.
2020-01-18 14:22:26 -05:00
Sam Doran
5db00a05b6
Disable mongodb_user test (#66595) 2020-01-18 07:43:49 -05:00
Sam Doran
f15050b09e
Change package name in docker_setup integration test (#66572)
* Change package name

* Retry to hopefully get a good mirror
2020-01-17 23:41:42 -05:00
Gonéri Le Bouder
a3dfabfdba vmware_host_ipv6/test: reset status before new check
Ensure a disable IPv6 before we try to re-enable it. This to get a
consistent result.
2020-01-17 16:57:23 -05:00
Gonéri Le Bouder
5280042901 vmware_host_dns: consistent rslt when name changes
This commit address a problem in static mode, if the hostname change,
`host.name` value with change too. And as a result:

    results['dns_config_result'][host.name]

will be initialized.
We now record the initial hostname first, and uses it as the key for the
results.

This commit also ensures hostname and search domain change are detected if
`instance.dnsConfig.dhcp` is true.

Finally, if we target a cluster, the `changed` result will depend on the
number of nodes.
2020-01-17 16:57:12 -05:00
Gonéri Le Bouder
b183d36c53 vmware_export_ovf/test needs an ESXi
Ensure the `vmware_export_ovf` test-suite runs with at least one ESXi.
2020-01-17 16:56:47 -05:00
Gonéri Le Bouder
437b8b3807 vmware_export_ovf/test: don't use a rescue block in test
By using a `rescue` block, we can potentially hide a really problem in the
block and return a success. This is a bit problematic for a functional
test.
2020-01-17 16:56:47 -05:00
Gonéri Le Bouder
ae6317004e vmware_guest_network/test: create the dvswitch
Ensure the DVSwitch and the portgroup are created by
`prepare_vmware_tests`.
2020-01-17 16:56:13 -05:00
Mario Lenz
864a3fd59d VMware: Add advanced settings to vmware_cluster_drs (#66233)
* VMware: Add advanced settings to vmware_cluster_drs

* Add DRS advcanced settings example
2020-01-17 16:23:19 -05:00
Sam Doran
9b7198d25e
file - change _diff_peek type in argument_spec (#60428)
* Add integration tests
* Handle error in _get_diff_data()
* Change to warning rather than error
* Also change failure to warning in assemble action plugin
2020-01-17 16:02:28 -05:00
GomathiselviS
7ddf7474d3 eos_config: Added fix for bug #54400 - support for !! in config mode (#63694)
* Corrected lint errors

* Added fix for bug # 54400

* Resolving conflicts
2020-01-17 15:22:38 -05:00
Florian Apolloner
a7e4479d01 Fix DNF idempotency. (#66209) 2020-01-17 11:22:06 -05:00
Anusha Hegde
9fd66556a6 VMware: new module to clone VM/template Cross-vCenter (#66156)
* Adding documentation and integration test for the new module
* Correcting typo
* removed unused if else block
* changing error messages
* Addressed review comments
* resolving sanity error
* fixed typo in vmware.py
* Added support for datastore cluster
* adding state parameter instead of power on fixed few more review comments
* Documentation update
* Updating argument
2020-01-17 13:08:42 +05:30
haiyuan_zhang
bc37ea96d5 Vmss scale in policy (#66512)
* azure_rm_virtualmachinescaleset: add scale_in_policy and terminate_event_notification

* azure_rm_virtualmachinescalesetinstance: add vmss instance protection policy support
2020-01-16 09:24:39 +08:00
Gonéri Le Bouder
b9b2ddc580 prepare_vmware_tests: no waiting loop during DS probing
For a refresh of the datastore list on the vcenter, this before we
check the present of the newly attached datastores.

A lot of tests depend on the presence of the DS, and this little
change allow us to save =~ 45s everytime.
2020-01-15 12:39:56 -05:00
Gonéri Le Bouder
f956581846 vmware_host_auto_start: enable the tests
- remove the unsupported alias
- refactoring
- move the hosts outside of the cluster to avoid any conflict with DRS
- import the `prepare_vmware_tests` role
- does not work with govcsim
2020-01-15 12:39:31 -05:00
Paul Belanger
af3603f9ee Revert "Allow httpapi for resource modules (#62843)" (#66483)
While this does properly pass our testing for ansible/ansible devel
branch, it is currently breaking our collection testing for 2.10.

Specifically, this would mean ansible.netcommon would need to directly
import arista.eos or cisco.nxos collections, causing a circular dependency.

This reverts commit e266e5f8b6.
2020-01-15 12:25:38 -05:00
Gonéri Le Bouder
3103fd62dd vmware_vmotion/test: ensure we can run tests
Some adjustments to be able to run the test-suite properly:

- Starts with the ESXi out of the cluster to be able to deploy the
  VM on a proper host consistently
- Ensure the resource pool exists
- The resource pool is called `DC0_C0_RP1`, not `Resources`
- Avoid an exception if we try to move a non existing VM.

Put the test in the zuul/vmware/vcenter_2esxi group.
2020-01-15 11:50:04 -05:00
Abhijeet Kasurde
afb71c14bd
VMware: Use existing DVPG network in vmware_guest_network (#65994)
* Handle all cases of networks

Fixes: #65968

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-01-15 21:56:19 +05:30
Gonéri Le Bouder
222b6dec8a vmware_guest_serial_port: avoid autoselect_datastore (#66481)
Avoid `autoselect_datastore` until #58541 gets fixed.
2020-01-15 09:44:46 +05:30
Nathaniel Case
e266e5f8b6
Allow httpapi for resource modules (#62843)
* Redo tests to be transport agnostic

cli -> eos config

Redirect connection for httpapi
2020-01-14 14:26:10 -05:00
Sam Doran
ad341ea4bb Fix unarchive integration test failure due to rpm error (#66420)
* Fix unarchive integration test failure
* Do not cleanup pip packages
2020-01-13 16:23:31 -08:00
Matt Clay
51e5b714e0
Add test constraint for setuptools. (#66426)
* Add test constraint for setuptools.

* Update pip test to work on centos6 container.
2020-01-13 13:09:33 -08:00
Gonéri Le Bouder
223e1675f4 vmware_local_role_info/test: avoid json_query
Refactoring to avoid the use of `json_query`. As a bonus point, we now
also ensure `NoAccess` role has no provilege.
2020-01-13 09:42:14 -05:00
Felix Fontein
a79ca57d22
Fix aws_ssm connection plugin. (#66393) 2020-01-12 23:59:25 +01:00
Felix Fontein
663f9cda25
Disable failing tests. (#66391) 2020-01-12 23:25:11 +01:00
Felix Fontein
c380b18dcf
openssl_* modules: allow direct input for some files (#66384)
* Allow to not read content from file.

* Allow to feed content directly into _info modules.

* Allow to feed non-primary content into openssl_certificate, openssl_csr and openssl_publickey.

* Rename changelog.
2020-01-12 19:12:33 +01:00
Andrew Klychkov
515c4a7e2c Bugfix of 65367: postgresql_query doesn't support non-ASCII characters in SQL files with Python3 (#66331)
* Bugfix of 65367: postgresql_query doesn't support non-ASCII characters in SQL files with Python3

* add changelog

* fix

* change changelog fragment, add example
2020-01-11 15:19:55 +01:00
psharkey
f8fb391548 new connection plugin aws_ssm (#49652)
* new connection plugin aws_ssm

Return code may be at the end of the last command output line.

Marking regex.

Ensure command status code is on it's owm line - last 3 lines are not part of command stdout.

* Adding timeout parameter - aws_ssm_timeout

Default 10 second timeout (https://docs.ansible.com/ansible/2.4/intro_configuration.html#timeout) is marginal.
This avoids changing this default and allowing the SSM timeout to be controlled via inventory.
This change wraps commands so commands which may never return do timeout.

* Added integration tests

Added AWS SSM Executor, target and config functions

Fixed more code for integration tests

Improved execution

Added S3 bucket name

Fixed pylint

Reverted lib changes

Reverted few more changes

Improved support for integration test execution

added ansible role for aws_ssm_integration_test setup and teardown and modifiled runme.sh

Reset to 17fa565 commit

inventory file location changed

change inventory file location

deleted meta and handlers folder as it is not required

deleted main.yml inside vars, removed extra space from tasks/main.yml, Added appropriate tags for ec2 and delete test folder as it is not required

deleted main.yml inside vars, removed extra space from tasks/main.yml, Added appropriate tags for ec2 and delete test folder as it is not required

modified task/main.yml

added region variable and fixed pattern for using variable

modified policy for IAM role

moved to first line of scrip set -eux

Updated Session Manager plugin installation

edited custme policy

Included tags for Session Manager plugin installation

Added README.md

Upddated README and added support for ssm-plugin for Amazon-Linux

Added Windows Integration test support

Improved user data for Linux

Added random value generation for the role and policy,delete vars_to_delete.yml

upadte README in vars

fixed typo

update policy

Updated IAM policy file

update playbook

Updated playbook to include ssm-agent userdata

modified jing2 template

modified jing2 template

modified jing2 template and fixed role deletion

fixed role name issue while deleting and task name

Updated playbook to include wait_connection for ec2

Corrected Synatx changes and updated ssm-plugin debian file

Changed region variable to us-east-1

Removed vars file and updated  to /tmp dir

fixed typo

Improved setup

Fixed boto3 dependency

Fixed missing tag

Added boto as dependency as well

Improved execution workflow

Trying other way of defining tags

Fixed undefined var

Changed AMI ID to Amazon Linux

Improved Tags

Ok, created different directory for WIndows test execution

Fixed IAM Role Name for Windows

Fixed inventory not found

Improved integration test execution

Fixed Windows Inventory path

Fixed wrong Windows AMI ID

Fixes issue for windows test execution

* Don't attempt to terminate sessions without a session id.

* Added Unit test cases file for AWS SSM Connection plugin

updated test file with close

updated unit test file with start_session

updated test files

* Eliminate AWS CLI dependency for terminal session.

* Removing unused code, cleanup logic.

Reduce mark length - 52^26 should be plenty
Be explicit about subprocess.Popen options
Simplify if/else for mark end
_stdin_readline is not used now

* updated test file

Added exec command and fixed close session unit tests

updated test files

Improved ansible ssm test command

updated file for lint checks

updated for pylint checks

New Unit_testcases for pre-signed URL file

removing additonal spaces and white spaces

remaning error changes

fixed changes

fixed spaces issues

python 2.7 version and whitespaces

python 2.7 version and whitespaces

python 2.7 skip if

space issue with 16:1

Unit test cases for windows and linux

Unit test cases for windows and linux with issues fixed issues

Unit test cases for windows and linux with issues fixed issues1

* Added support for S3 Pre-signed URLs

* Updated documentation and comments

* Documentation and curl dependency removal for controller machine

Fixing lint errors and removing requirements.

* Adding support for Windows remote EC2 instances.

* Added Encoding fixes

* Updating author section and adding obvious requirement for the SSM agent.

* Refactor stdout post processing
Attempt to get real return code on error (test using ansible -m raw -a 'cmd /c exit 99'.
Fixes problem at terminal width (ansible windows -i ./hosts.yml -m setup).

* Refactor back to a single module.

* Fixed fetch file for windows

* ssm usage examples for linux and windows

* Update aws_ssm.py

Service state corrected.

* Strip line continuation when at terminal width - otherwise replace.
Strip ANSI control sequences only for Windows.

Test playbook:

---
- name: test
  hosts: windows
  gather_facts: False
  vars:
    small: 'abc'
  tasks:
  - name:
    set_fact:
      large: "{{ lookup('password', '/dev/null length=2000 chars=ascii_letters,digits,hexdigits,punctuation') }}"
  - name: small fixed
    raw: echo '{{ small }}'
    register: small_result
    changed_when: False
  - name: check
    assert:
      that:
        - "(item | length) == (small | length)"
        - "item == small"
      msg: "'{{ item | length }} must equal '{{ small | length }}' and '{{ item }}' must match '{{ small }}'"
    with_items:
      - "{{ small_result.stdout_lines[0] }}"
  - name: large random
    raw: echo '{{ large }}'
    register: large_result
    changed_when: False
  - name: check
    assert:
      that:
        - "(item | length) == (large | length)"
        - "item == large"
      msg: "'{{ item | length }} must equal '{{ large | length }}' and '{{ item }}' must match '{{ large }}'"
    with_items:
      - "{{ large_result.stdout_lines[0] }}"
  - name: gather facts
    setup:

* Correct module parameter names.

* Updated Windows Executable variable.

Updated Windows Executable variable to "ansible_shell_type".

Fixing Examples with raw declaration

Updated the plugin timeout variable.

* Fix to work with dynamic inventory plug-in

* IntegrationTest template updates

* Removing unsupported flag for integration tests.
Fixing unit test.

* Adding shippable group.

* SSM Usage examples with dynamic inventory plugin

* Fixing yamllint errors.

* Fixed Integration tests

* Fixed Integration tests

* Updates for python3.

Removing python3 restriction.

* Remove python3 restriction.
Change block from retry to always

* Fixed Integration tests with Python 3

* Fixed shellcheck

* Fix for Windows which could pick up end mark prematurely
Move debug to _wrap_command and use a single return point

Single-quotes not needed around linux marks
Fix typo in comment

End mark to new command.

* Unit test cases now works on Python2 and Python3

* Skip tests on Python 2.6

* Fix for wait_for_connection module for windows.

* Updated changes as per review comments

* Fixing broken pipe error seen with session-manager-plugin version 1.1.17.0.
Eliminating sleep as this looks to be fixed in session-manager-plugin version 1.1.17.0.

* Adding back delays for Windows with session-manager-plugin 1.1.17.0.

* Updating Windows AMI ID for integration Test

* Upgrading windows ssm agent to the latest

* Adding boilerplate code.

* Windows ami and integration test updates

* Revert "Windows ami and integration test updates"

This reverts commit cd6ca3579b7cda584bd9c065f9c0835bddb23627.

* Updating windows ami for Integration tests

* Integration test suite updates and fixes.

* Updates and fixes

* Eliminate duplicate processing for exit code on failed command.

* Add powershell wrap.

* Refactor windows post_process.

* AMI Lookup, aliases, OSC filter, test suite updates

Co-authored-by: Gaurav Ashtikar <gau1991@gmail.com>
Co-authored-by: Deepak Choudhary <40276333+deepsvc@users.noreply.github.com>
Co-authored-by: Hanumanth <46720371+hanumantharaomvl@users.noreply.github.com>
Co-authored-by: KUMAR MAYANK <mayank@flux7.com>
2020-01-11 15:22:01 +10:00
Matt Clay
f695f40133 Temporarily mark unarchive test unstable. 2020-01-10 18:31:14 -08:00