mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-14 08:53:07 -06:00
DCD-802: Fix file mode preservation in restore and add test for file
mode
This commit is contained in:
@@ -46,16 +46,19 @@
|
|||||||
file:
|
file:
|
||||||
path: "{{ test_archive_source }}"
|
path: "{{ test_archive_source }}"
|
||||||
state: directory
|
state: directory
|
||||||
|
mode: 0755
|
||||||
- name: "{{ test_pre_step_prefix }} Create a file in the shared home"
|
- name: "{{ test_pre_step_prefix }} Create a file in the shared home"
|
||||||
lineinfile:
|
lineinfile:
|
||||||
create: yes
|
create: yes
|
||||||
line: 'Hello, world!'
|
line: 'Hello, world!'
|
||||||
path: "{{ test_archive_source }}/{{ test_archive_file }}"
|
path: "{{ test_archive_source }}/{{ test_archive_file }}"
|
||||||
|
mode: 0640
|
||||||
- name: "{{ test_pre_step_prefix }} Create the version file in the shared home"
|
- name: "{{ test_pre_step_prefix }} Create the version file in the shared home"
|
||||||
lineinfile:
|
lineinfile:
|
||||||
create: yes
|
create: yes
|
||||||
line: '8.5'
|
line: '8.5'
|
||||||
path: "{{ test_product_version_file }}"
|
path: "{{ test_product_version_file }}"
|
||||||
|
mode: 0640
|
||||||
- name: "{{ test_pre_step_prefix }} Archive the shared home"
|
- name: "{{ test_pre_step_prefix }} Archive the shared home"
|
||||||
archive:
|
archive:
|
||||||
path:
|
path:
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
import pytest
|
import pytest
|
||||||
|
from stat import *
|
||||||
|
|
||||||
import testinfra.utils.ansible_runner
|
import testinfra.utils.ansible_runner
|
||||||
|
|
||||||
@@ -29,6 +30,10 @@ def test_shared_home_owner(host, file):
|
|||||||
assert host.file(file).user == 'jira'
|
assert host.file(file).user == 'jira'
|
||||||
assert host.file(file).group == 'jira'
|
assert host.file(file).group == 'jira'
|
||||||
|
|
||||||
|
def test_file_modes(host):
|
||||||
|
assert host.file('/media/atl/jira/shared/hello').mode == 0o755
|
||||||
|
assert host.file('/media/atl/jira/shared/hello/hello.txt').mode == 0o640
|
||||||
|
|
||||||
def test_version_file_owned_by_root(host):
|
def test_version_file_owned_by_root(host):
|
||||||
assert host.file('/media/atl/jira/shared/jira-software.version').exists
|
assert host.file('/media/atl/jira/shared/jira-software.version').exists
|
||||||
assert host.file('/media/atl/jira/shared/jira-software.version').user == 'root'
|
assert host.file('/media/atl/jira/shared/jira-software.version').user == 'root'
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
src: "{{ atl_backup_home_dest }}"
|
src: "{{ atl_backup_home_dest }}"
|
||||||
remote_src: yes
|
remote_src: yes
|
||||||
dest: "{{ atl_product_home_shared }}"
|
dest: "{{ atl_product_home_shared }}"
|
||||||
mode: preserve
|
|
||||||
|
|
||||||
- name: Set shared home owner and group to application user
|
- name: Set shared home owner and group to application user
|
||||||
file:
|
file:
|
||||||
|
|||||||
Reference in New Issue
Block a user