Add a framework, fixtures and test for common synchronize scenarios. (#15983)

* Add a framework, fixtures and test for common synchronize scenarios.

Addresses #15905
This commit is contained in:
jctanner
2016-05-31 22:35:59 -04:00
parent 10a07fcc26
commit c52cea8db3
33 changed files with 3991 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
fixtures:
taskvars_in: task_vars_in.json
taskvars_out: task_vars_out.json
task_args:
src: /tmp/deleteme
dest: /tmp/deleteme
_task:
delegate_to: u1404
_play_context:
shell: None
remote_addr: u1404
remote_user: root
connection:
transport: 'ssh'
hostvars:
'127.0.0.1': {}
'::1': {}
'localhost': {}
asserts:
- "hasattr(SAM._connection, 'ismock')"
- "SAM._connection.transport == 'ssh'"
- "self._play_context.shell == None"
- "self.execute_called"
- "self.task.args['_local_rsync_path'] == 'rsync'"
- "self.task.args['src'] == '/tmp/deleteme'"
- "self.task.args['dest'] == 'el6host:/tmp/deleteme'"

View File

@@ -0,0 +1,5 @@
{
"dest": "el6host:/tmp/deleteme",
"src": "/tmp/deleteme",
"_local_rsync_path": "rsync"
}

View File

@@ -0,0 +1,379 @@
{
"ansible_pipelining": false,
"ansible_docker_extra_args": "",
"ansible_scp_extra_args": "",
"ansible_user": "root",
"ansible_play_hosts": [
"el6host"
],
"ansible_connection": "smart",
"ansible_ssh_common_args": "",
"environment": [],
"inventory_hostname": "el6host",
"vars": {
"ansible_check_mode": false,
"inventory_hostname": "el6host",
"inventory_file": "inventory",
"ansible_delegated_vars": {
"u1404": {
"inventory_hostname": "u1404",
"inventory_file": "inventory",
"vars": {
"inventory_file": "inventory",
"role_names": [],
"ansible_play_hosts": [
"el6host"
],
"groups": {
"ungrouped": [
"el6host",
"u1404"
],
"all": [
"el6host",
"u1404"
]
},
"ansible_check_mode": false,
"inventory_hostname": "u1404",
"inventory_hostname_short": "u1404",
"playbook_dir": "/home/jtanner/workspace/issues/AP-15905",
"omit": "__omit_place_holder__2433ce0463ffd13b68850ce9cdd98a1cde088e22",
"inventory_dir": "/home/jtanner/workspace/issues/AP-15905",
"environment": [],
"ansible_ssh_user": "root",
"group_names": [
"ungrouped"
],
"play_hosts": [
"el6host"
],
"ansible_version": {
"major": 2,
"full": "2.2.0",
"string": "2.2.0",
"minor": 2,
"revision": 0
}
},
"inventory_hostname_short": "u1404",
"playbook_dir": "/home/jtanner/workspace/issues/AP-15905",
"group_names": [
"ungrouped"
],
"inventory_dir": "/home/jtanner/workspace/issues/AP-15905",
"omit": "__omit_place_holder__2433ce0463ffd13b68850ce9cdd98a1cde088e22",
"ansible_host": "u1404",
"environment": [],
"ansible_play_hosts": [
"el6host"
],
"groups": {
"ungrouped": [
"el6host",
"u1404"
],
"all": [
"el6host",
"u1404"
]
},
"ansible_check_mode": false,
"play_hosts": [
"el6host"
],
"role_names": [],
"ansible_port": null,
"ansible_version": {
"major": 2,
"full": "2.2.0",
"string": "2.2.0",
"minor": 2,
"revision": 0
},
"ansible_ssh_user": "root"
}
},
"inventory_hostname_short": "el6host",
"playbook_dir": "/home/jtanner/workspace/issues/AP-15905",
"role_names": [],
"inventory_dir": "/home/jtanner/workspace/issues/AP-15905",
"environment": [],
"play_hosts": [
"el6host"
],
"ansible_play_hosts": [
"el6host"
],
"hostvars": {
"el6host": {
"inventory_file": "inventory",
"group_names": [
"ungrouped"
],
"groups": {
"ungrouped": [
"el6host",
"u1404"
],
"all": [
"el6host",
"u1404"
]
},
"inventory_hostname": "el6host",
"inventory_hostname_short": "el6host",
"playbook_dir": "/home/jtanner/workspace/issues/AP-15905",
"omit": "__omit_place_holder__2433ce0463ffd13b68850ce9cdd98a1cde088e22",
"inventory_dir": "/home/jtanner/workspace/issues/AP-15905",
"ansible_ssh_user": "root",
"ansible_check_mode": false,
"ansible_version": {
"major": 2,
"full": "2.2.0",
"string": "2.2.0",
"minor": 2,
"revision": 0
}
},
"u1404": {
"inventory_file": "inventory",
"group_names": [
"ungrouped"
],
"groups": {
"ungrouped": [
"el6host",
"u1404"
],
"all": [
"el6host",
"u1404"
]
},
"inventory_hostname": "u1404",
"inventory_hostname_short": "u1404",
"playbook_dir": "/home/jtanner/workspace/issues/AP-15905",
"omit": "__omit_place_holder__2433ce0463ffd13b68850ce9cdd98a1cde088e22",
"inventory_dir": "/home/jtanner/workspace/issues/AP-15905",
"ansible_ssh_user": "root",
"ansible_check_mode": false,
"ansible_version": {
"major": 2,
"full": "2.2.0",
"string": "2.2.0",
"minor": 2,
"revision": 0
}
}
},
"groups": {
"ungrouped": [
"el6host",
"u1404"
],
"all": [
"el6host",
"u1404"
]
},
"group_names": [
"ungrouped"
],
"omit": "__omit_place_holder__2433ce0463ffd13b68850ce9cdd98a1cde088e22",
"ansible_version": {
"major": 2,
"full": "2.2.0",
"string": "2.2.0",
"minor": 2,
"revision": 0
},
"ansible_ssh_user": "root"
},
"ansible_accelerate_port": 5099,
"roledir": null,
"ansible_ssh_extra_args": "",
"ansible_ssh_host": "u1404",
"ansible_current_hosts": [
"el6host"
],
"hostvars": {
"el6host": {
"inventory_file": "inventory",
"group_names": [
"ungrouped"
],
"groups": {
"ungrouped": [
"el6host",
"u1404"
],
"all": [
"el6host",
"u1404"
]
},
"inventory_hostname": "el6host",
"inventory_hostname_short": "el6host",
"playbook_dir": "/home/jtanner/workspace/issues/AP-15905",
"omit": "__omit_place_holder__2433ce0463ffd13b68850ce9cdd98a1cde088e22",
"inventory_dir": "/home/jtanner/workspace/issues/AP-15905",
"ansible_ssh_user": "root",
"ansible_check_mode": false,
"ansible_version": {
"major": 2,
"full": "2.2.0",
"string": "2.2.0",
"minor": 2,
"revision": 0
}
},
"u1404": {
"inventory_file": "inventory",
"group_names": [
"ungrouped"
],
"groups": {
"ungrouped": [
"el6host",
"u1404"
],
"all": [
"el6host",
"u1404"
]
},
"inventory_hostname": "u1404",
"inventory_hostname_short": "u1404",
"playbook_dir": "/home/jtanner/workspace/issues/AP-15905",
"omit": "__omit_place_holder__2433ce0463ffd13b68850ce9cdd98a1cde088e22",
"inventory_dir": "/home/jtanner/workspace/issues/AP-15905",
"ansible_ssh_user": "root",
"ansible_check_mode": false,
"ansible_version": {
"major": 2,
"full": "2.2.0",
"string": "2.2.0",
"minor": 2,
"revision": 0
}
}
},
"group_names": [
"ungrouped"
],
"ansible_version": {
"major": 2,
"full": "2.2.0",
"string": "2.2.0",
"minor": 2,
"revision": 0
},
"ansible_ssh_pipelining": false,
"inventory_file": "inventory",
"ansible_delegated_vars": {
"u1404": {
"inventory_hostname": "u1404",
"inventory_file": "inventory",
"vars": {
"ansible_check_mode": false,
"inventory_hostname": "u1404",
"inventory_file": "inventory",
"inventory_hostname_short": "u1404",
"playbook_dir": "/home/jtanner/workspace/issues/AP-15905",
"omit": "__omit_place_holder__2433ce0463ffd13b68850ce9cdd98a1cde088e22",
"inventory_dir": "/home/jtanner/workspace/issues/AP-15905",
"environment": [],
"ansible_ssh_user": "root",
"ansible_play_hosts": [
"el6host"
],
"groups": {
"ungrouped": [
"el6host",
"u1404"
],
"all": [
"el6host",
"u1404"
]
},
"group_names": [
"ungrouped"
],
"play_hosts": [
"el6host"
],
"ansible_version": {
"major": 2,
"full": "2.2.0",
"string": "2.2.0",
"minor": 2,
"revision": 0
},
"role_names": []
},
"inventory_hostname_short": "u1404",
"playbook_dir": "/home/jtanner/workspace/issues/AP-15905",
"group_names": [
"ungrouped"
],
"inventory_dir": "/home/jtanner/workspace/issues/AP-15905",
"omit": "__omit_place_holder__2433ce0463ffd13b68850ce9cdd98a1cde088e22",
"ansible_host": "u1404",
"environment": [],
"ansible_play_hosts": [
"el6host"
],
"groups": {
"ungrouped": [
"el6host",
"u1404"
],
"all": [
"el6host",
"u1404"
]
},
"ansible_check_mode": false,
"play_hosts": [
"el6host"
],
"role_names": [],
"ansible_port": null,
"ansible_version": {
"major": 2,
"full": "2.2.0",
"string": "2.2.0",
"minor": 2,
"revision": 0
},
"ansible_ssh_user": "root"
}
},
"ansible_module_compression": "ZIP_DEFLATED",
"ansible_failed_hosts": [],
"ansible_check_mode": false,
"groups": {
"ungrouped": [
"el6host",
"u1404"
],
"all": [
"el6host",
"u1404"
]
},
"ansible_host": "u1404",
"ansible_shell_executable": "/bin/sh",
"inventory_hostname_short": "el6host",
"omit": "__omit_place_holder__2433ce0463ffd13b68850ce9cdd98a1cde088e22",
"inventory_dir": "/home/jtanner/workspace/issues/AP-15905",
"playbook_dir": "/home/jtanner/workspace/issues/AP-15905",
"ansible_ssh_user": "root",
"role_names": [],
"play_hosts": [
"el6host"
],
"ansible_sftp_extra_args": ""
}

View File

@@ -0,0 +1,387 @@
{
"ansible_pipelining": false,
"ansible_docker_extra_args": "",
"ansible_scp_extra_args": "",
"ansible_user": "root",
"ansible_play_hosts": [
"el6host"
],
"ansible_connection": "smart",
"ansible_ssh_common_args": "",
"environment": [],
"inventory_hostname": "el6host",
"vars": {
"ansible_check_mode": false,
"inventory_hostname": "el6host",
"inventory_file": "inventory",
"ansible_delegated_vars": {
"u1404": {
"inventory_hostname": "u1404",
"inventory_file": "inventory",
"vars": {
"inventory_file": "inventory",
"role_names": [],
"ansible_play_hosts": [
"el6host"
],
"groups": {
"ungrouped": [
"el6host",
"u1404"
],
"all": [
"el6host",
"u1404"
]
},
"ansible_check_mode": false,
"inventory_hostname": "u1404",
"inventory_hostname_short": "u1404",
"playbook_dir": "/home/jtanner/workspace/issues/AP-15905",
"omit": "__omit_place_holder__2433ce0463ffd13b68850ce9cdd98a1cde088e22",
"inventory_dir": "/home/jtanner/workspace/issues/AP-15905",
"environment": [],
"ansible_ssh_user": "root",
"group_names": [
"ungrouped"
],
"play_hosts": [
"el6host"
],
"ansible_version": {
"major": 2,
"full": "2.2.0",
"string": "2.2.0",
"minor": 2,
"revision": 0
}
},
"inventory_hostname_short": "u1404",
"playbook_dir": "/home/jtanner/workspace/issues/AP-15905",
"group_names": [
"ungrouped"
],
"inventory_dir": "/home/jtanner/workspace/issues/AP-15905",
"omit": "__omit_place_holder__2433ce0463ffd13b68850ce9cdd98a1cde088e22",
"ansible_host": "u1404",
"environment": [],
"ansible_play_hosts": [
"el6host"
],
"groups": {
"ungrouped": [
"el6host",
"u1404"
],
"all": [
"el6host",
"u1404"
]
},
"ansible_check_mode": false,
"play_hosts": [
"el6host"
],
"role_names": [],
"ansible_port": null,
"ansible_version": {
"major": 2,
"full": "2.2.0",
"string": "2.2.0",
"minor": 2,
"revision": 0
},
"ansible_ssh_user": "root"
}
},
"inventory_hostname_short": "el6host",
"playbook_dir": "/home/jtanner/workspace/issues/AP-15905",
"role_names": [],
"inventory_dir": "/home/jtanner/workspace/issues/AP-15905",
"environment": [],
"play_hosts": [
"el6host"
],
"ansible_play_hosts": [
"el6host"
],
"hostvars": {
"el6host": {
"inventory_file": "inventory",
"group_names": [
"ungrouped"
],
"groups": {
"ungrouped": [
"el6host",
"u1404",
"::1"
],
"all": [
"el6host",
"u1404",
"::1"
]
},
"inventory_hostname": "el6host",
"inventory_hostname_short": "el6host",
"playbook_dir": "/home/jtanner/workspace/issues/AP-15905",
"omit": "__omit_place_holder__2433ce0463ffd13b68850ce9cdd98a1cde088e22",
"inventory_dir": "/home/jtanner/workspace/issues/AP-15905",
"ansible_ssh_user": "root",
"ansible_check_mode": false,
"ansible_version": {
"major": 2,
"full": "2.2.0",
"string": "2.2.0",
"minor": 2,
"revision": 0
}
},
"u1404": {
"inventory_file": "inventory",
"group_names": [
"ungrouped"
],
"groups": {
"ungrouped": [
"el6host",
"u1404",
"::1"
],
"all": [
"el6host",
"u1404",
"::1"
]
},
"inventory_hostname": "u1404",
"inventory_hostname_short": "u1404",
"playbook_dir": "/home/jtanner/workspace/issues/AP-15905",
"omit": "__omit_place_holder__2433ce0463ffd13b68850ce9cdd98a1cde088e22",
"inventory_dir": "/home/jtanner/workspace/issues/AP-15905",
"ansible_ssh_user": "root",
"ansible_check_mode": false,
"ansible_version": {
"major": 2,
"full": "2.2.0",
"string": "2.2.0",
"minor": 2,
"revision": 0
}
}
},
"groups": {
"ungrouped": [
"el6host",
"u1404"
],
"all": [
"el6host",
"u1404"
]
},
"group_names": [
"ungrouped"
],
"omit": "__omit_place_holder__2433ce0463ffd13b68850ce9cdd98a1cde088e22",
"ansible_version": {
"major": 2,
"full": "2.2.0",
"string": "2.2.0",
"minor": 2,
"revision": 0
},
"ansible_ssh_user": "root"
},
"ansible_accelerate_port": 5099,
"roledir": null,
"ansible_ssh_extra_args": "",
"ansible_ssh_host": "u1404",
"ansible_current_hosts": [
"el6host"
],
"hostvars": {
"el6host": {
"inventory_file": "inventory",
"group_names": [
"ungrouped"
],
"groups": {
"ungrouped": [
"el6host",
"u1404",
"::1"
],
"all": [
"el6host",
"u1404",
"::1"
]
},
"inventory_hostname": "el6host",
"inventory_hostname_short": "el6host",
"playbook_dir": "/home/jtanner/workspace/issues/AP-15905",
"omit": "__omit_place_holder__2433ce0463ffd13b68850ce9cdd98a1cde088e22",
"inventory_dir": "/home/jtanner/workspace/issues/AP-15905",
"ansible_ssh_user": "root",
"ansible_check_mode": false,
"ansible_version": {
"major": 2,
"full": "2.2.0",
"string": "2.2.0",
"minor": 2,
"revision": 0
}
},
"u1404": {
"inventory_file": "inventory",
"group_names": [
"ungrouped"
],
"groups": {
"ungrouped": [
"el6host",
"u1404",
"::1"
],
"all": [
"el6host",
"u1404",
"::1"
]
},
"inventory_hostname": "u1404",
"inventory_hostname_short": "u1404",
"playbook_dir": "/home/jtanner/workspace/issues/AP-15905",
"omit": "__omit_place_holder__2433ce0463ffd13b68850ce9cdd98a1cde088e22",
"inventory_dir": "/home/jtanner/workspace/issues/AP-15905",
"ansible_ssh_user": "root",
"ansible_check_mode": false,
"ansible_version": {
"major": 2,
"full": "2.2.0",
"string": "2.2.0",
"minor": 2,
"revision": 0
}
}
},
"group_names": [
"ungrouped"
],
"ansible_version": {
"major": 2,
"full": "2.2.0",
"string": "2.2.0",
"minor": 2,
"revision": 0
},
"ansible_ssh_pipelining": false,
"inventory_file": "inventory",
"ansible_delegated_vars": {
"u1404": {
"inventory_hostname": "u1404",
"inventory_file": "inventory",
"vars": {
"ansible_check_mode": false,
"inventory_hostname": "u1404",
"inventory_file": "inventory",
"inventory_hostname_short": "u1404",
"playbook_dir": "/home/jtanner/workspace/issues/AP-15905",
"omit": "__omit_place_holder__2433ce0463ffd13b68850ce9cdd98a1cde088e22",
"inventory_dir": "/home/jtanner/workspace/issues/AP-15905",
"environment": [],
"ansible_ssh_user": "root",
"ansible_play_hosts": [
"el6host"
],
"groups": {
"ungrouped": [
"el6host",
"u1404"
],
"all": [
"el6host",
"u1404"
]
},
"group_names": [
"ungrouped"
],
"play_hosts": [
"el6host"
],
"ansible_version": {
"major": 2,
"full": "2.2.0",
"string": "2.2.0",
"minor": 2,
"revision": 0
},
"role_names": []
},
"inventory_hostname_short": "u1404",
"playbook_dir": "/home/jtanner/workspace/issues/AP-15905",
"group_names": [
"ungrouped"
],
"inventory_dir": "/home/jtanner/workspace/issues/AP-15905",
"omit": "__omit_place_holder__2433ce0463ffd13b68850ce9cdd98a1cde088e22",
"ansible_host": "u1404",
"environment": [],
"ansible_play_hosts": [
"el6host"
],
"groups": {
"ungrouped": [
"el6host",
"u1404"
],
"all": [
"el6host",
"u1404"
]
},
"ansible_check_mode": false,
"play_hosts": [
"el6host"
],
"role_names": [],
"ansible_port": null,
"ansible_version": {
"major": 2,
"full": "2.2.0",
"string": "2.2.0",
"minor": 2,
"revision": 0
},
"ansible_ssh_user": "root"
}
},
"ansible_module_compression": "ZIP_DEFLATED",
"ansible_failed_hosts": [],
"ansible_check_mode": false,
"groups": {
"ungrouped": [
"el6host",
"u1404"
],
"all": [
"el6host",
"u1404"
]
},
"ansible_host": "u1404",
"ansible_shell_executable": "/bin/sh",
"inventory_hostname_short": "el6host",
"omit": "__omit_place_holder__2433ce0463ffd13b68850ce9cdd98a1cde088e22",
"inventory_dir": "/home/jtanner/workspace/issues/AP-15905",
"playbook_dir": "/home/jtanner/workspace/issues/AP-15905",
"ansible_ssh_user": "root",
"role_names": [],
"play_hosts": [
"el6host"
],
"ansible_sftp_extra_args": ""
}