From 0e6f8ab976211e703be204cf2d341ebea1fb29b0 Mon Sep 17 00:00:00 2001 From: Scott Mcdermott Date: Wed, 12 May 2021 00:34:48 -0700 Subject: [PATCH] Modify synchronize tests for '-u root' arg when become_user not supplied --- .../plugins/action/fixtures/synchronize/basic_become/meta.yaml | 3 ++- .../action/fixtures/synchronize/basic_become_cli/meta.yaml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/unit/plugins/action/fixtures/synchronize/basic_become/meta.yaml b/tests/unit/plugins/action/fixtures/synchronize/basic_become/meta.yaml index 1ba3b4a..8435735 100644 --- a/tests/unit/plugins/action/fixtures/synchronize/basic_become/meta.yaml +++ b/tests/unit/plugins/action/fixtures/synchronize/basic_become/meta.yaml @@ -25,7 +25,8 @@ asserts: - "self.execute_called" - "self.final_module_args['_local_rsync_path'] == 'rsync'" # this is a crucial aspect of this scenario ... - - "self.final_module_args['rsync_path'] == 'sudo rsync'" + # note: become_user None -> root + - "self.final_module_args['rsync_path'] == 'sudo -u root rsync'" - "self.final_module_args['src'] == '/tmp/deleteme'" - "self.final_module_args['dest'] == 'root@el6host:/tmp/deleteme'" - "self.task.become == True" diff --git a/tests/unit/plugins/action/fixtures/synchronize/basic_become_cli/meta.yaml b/tests/unit/plugins/action/fixtures/synchronize/basic_become_cli/meta.yaml index 5e55801..294bfde 100644 --- a/tests/unit/plugins/action/fixtures/synchronize/basic_become_cli/meta.yaml +++ b/tests/unit/plugins/action/fixtures/synchronize/basic_become_cli/meta.yaml @@ -25,7 +25,8 @@ asserts: - "self.execute_called" - "self.final_module_args['_local_rsync_path'] == 'rsync'" # this is a crucial aspect of this scenario ... - - "self.final_module_args['rsync_path'] == 'sudo rsync'" + # note: become_user None -> root + - "self.final_module_args['rsync_path'] == 'sudo -u root rsync'" - "self.final_module_args['src'] == '/tmp/deleteme'" - "self.final_module_args['dest'] == 'root@el6host:/tmp/deleteme'" - "self.task.become == None"