going to slowly chip away at sanity tests

Signed-off-by: Adam Miller <admiller@redhat.com>
This commit is contained in:
Adam Miller 2023-12-05 21:40:25 -06:00
parent 0f51b599fb
commit 9e570ca05e
6 changed files with 5 additions and 38 deletions

View file

@ -171,7 +171,7 @@ options:
- Add a destination to hard link against during the rsync. - Add a destination to hard link against during the rsync.
type: list type: list
default: default:
elements: str elements: path
delay_updates: delay_updates:
description: description:
- This option puts the temporary file from each updated file into a holding directory until the end of the transfer, - This option puts the temporary file from each updated file into a holding directory until the end of the transfer,
@ -388,8 +388,8 @@ def is_rsh_needed(source, dest):
def main(): def main():
module = AnsibleModule( module = AnsibleModule(
argument_spec=dict( argument_spec=dict(
src=dict(type='str', required=True), src=dict(type='path', required=True),
dest=dict(type='str', required=True), dest=dict(type='path', required=True),
dest_port=dict(type='int'), dest_port=dict(type='int'),
delete=dict(type='bool', default=False), delete=dict(type='bool', default=False),
private_key=dict(type='path'), private_key=dict(type='path'),
@ -418,7 +418,7 @@ def main():
verify_host=dict(type='bool', default=False), verify_host=dict(type='bool', default=False),
delay_updates=dict(type='bool', default=True), delay_updates=dict(type='bool', default=True),
mode=dict(type='str', default='push', choices=['pull', 'push']), mode=dict(type='str', default='push', choices=['pull', 'push']),
link_dest=dict(type='list', elements='str'), link_dest=dict(type='list', elements='path'),
), ),
supports_check_mode=True, supports_check_mode=True,
) )
@ -572,7 +572,7 @@ def main():
# hardlink is actually a change # hardlink is actually a change
cmd.append('-vv') cmd.append('-vv')
for x in link_dest: for x in link_dest:
link_path = os.path.abspath(os.path.expanduser(x)) link_path = os.path.abspath(x)
destination_path = os.path.abspath(os.path.dirname(dest)) destination_path = os.path.abspath(os.path.dirname(dest))
if destination_path.find(link_path) == 0: if destination_path.find(link_path) == 0:
module.fail_json(msg='Hardlinking into a subdirectory of the source would cause recursion. %s and %s' % (destination_path, dest)) module.fail_json(msg='Hardlinking into a subdirectory of the source would cause recursion. %s and %s' % (destination_path, dest))
@ -581,12 +581,6 @@ def main():
changed_marker = '<<CHANGED>>' changed_marker = '<<CHANGED>>'
cmd.append('--out-format=%s' % shlex_quote(changed_marker + '%i %n%L')) cmd.append('--out-format=%s' % shlex_quote(changed_marker + '%i %n%L'))
# expand the paths
if '@' not in source:
source = os.path.expanduser(source)
if '@' not in dest:
dest = os.path.expanduser(dest)
cmd.append(shlex_quote(source)) cmd.append(shlex_quote(source))
cmd.append(shlex_quote(dest)) cmd.append(shlex_quote(dest))
cmdstr = ' '.join(cmd) cmdstr = ' '.join(cmd)

View file

@ -1,7 +1,2 @@
plugins/modules/synchronize.py use-argspec-type-path
plugins/modules/synchronize.py validate-modules:doc-default-does-not-match-spec
plugins/modules/synchronize.py validate-modules:nonexistent-parameter-documented
plugins/modules/synchronize.py validate-modules:parameter-type-not-in-doc
plugins/modules/synchronize.py validate-modules:undocumented-parameter
tests/utils/shippable/check_matrix.py replace-urlopen tests/utils/shippable/check_matrix.py replace-urlopen
tests/utils/shippable/timing.py shebang tests/utils/shippable/timing.py shebang

View file

@ -1,7 +1,2 @@
plugins/modules/synchronize.py use-argspec-type-path
plugins/modules/synchronize.py validate-modules:doc-default-does-not-match-spec
plugins/modules/synchronize.py validate-modules:nonexistent-parameter-documented
plugins/modules/synchronize.py validate-modules:parameter-type-not-in-doc
plugins/modules/synchronize.py validate-modules:undocumented-parameter
tests/utils/shippable/check_matrix.py replace-urlopen tests/utils/shippable/check_matrix.py replace-urlopen
tests/utils/shippable/timing.py shebang tests/utils/shippable/timing.py shebang

View file

@ -1,6 +1 @@
plugins/modules/synchronize.py use-argspec-type-path
plugins/modules/synchronize.py validate-modules:doc-default-does-not-match-spec
plugins/modules/synchronize.py validate-modules:nonexistent-parameter-documented
plugins/modules/synchronize.py validate-modules:parameter-type-not-in-doc
plugins/modules/synchronize.py validate-modules:undocumented-parameter
tests/utils/shippable/timing.py shebang tests/utils/shippable/timing.py shebang

View file

@ -1,6 +1 @@
plugins/modules/synchronize.py use-argspec-type-path
plugins/modules/synchronize.py validate-modules:doc-default-does-not-match-spec
plugins/modules/synchronize.py validate-modules:nonexistent-parameter-documented
plugins/modules/synchronize.py validate-modules:parameter-type-not-in-doc
plugins/modules/synchronize.py validate-modules:undocumented-parameter
tests/utils/shippable/timing.py shebang tests/utils/shippable/timing.py shebang

View file

@ -1,9 +1,2 @@
plugins/modules/synchronize.py pylint:disallowed-name
plugins/modules/synchronize.py pylint:blacklisted-name
plugins/modules/synchronize.py use-argspec-type-path
plugins/modules/synchronize.py validate-modules:doc-default-does-not-match-spec
plugins/modules/synchronize.py validate-modules:nonexistent-parameter-documented
plugins/modules/synchronize.py validate-modules:parameter-type-not-in-doc
plugins/modules/synchronize.py validate-modules:undocumented-parameter
tests/utils/shippable/check_matrix.py replace-urlopen tests/utils/shippable/check_matrix.py replace-urlopen
tests/utils/shippable/timing.py shebang tests/utils/shippable/timing.py shebang