DCD-802: become product user when unarchiving shared home. Implement

test that shared home is owned by correct user
This commit is contained in:
Ben Partridge
2019-11-13 17:31:06 +11:00
parent e85b906019
commit b1643eccee
3 changed files with 9 additions and 5 deletions

View File

@@ -6,6 +6,5 @@
atl_product_user: 'jira'
atl_backup_home_restore_canary_path: '/tmp/canary.tmp'
tasks:
- name: Install distro-specific restore support packages
include_tasks: "../../tasks/{{ ansible_distribution|lower }}.yml"
roles:
- restore_backups

View File

@@ -18,3 +18,9 @@ def test_postgresql_amazon_linux_extras_exes(host, exe):
def test_postgresql_version(host):
pg_dump_version_output = host.check_output('pg_dump --version')
assert '(PostgreSQL) 9.6' in pg_dump_version_output
def test_shared_home_owner(host):
for root, dirs, files in os.walk('/media/atl/jira/shared'):
for fileName in files + dirs:
assert host.file(fileName).user == 'jira'
assert host.file(fileName).group == 'jira'

View File

@@ -124,8 +124,7 @@
unarchive:
src: "{{ atl_backup_home_dest }}"
dest: "{{ atl_product_home_shared }}"
owner: "{{ atl_product_user }}"
group: "{{ atl_product_user }}"
become: "{{ atl_product_user }}"
- name: Create restore-canary if necessary
copy: