Merge pull request #269 from richm/test-backup-restore-preserve-file-attrs

tests: Ensure backup/restore preserves file attributes
This commit is contained in:
Richard Megginson 2023-11-20 07:40:11 -07:00 committed by GitHub
commit e54fca52c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -18,7 +18,7 @@
set -eu set -eu
if test -f {{ item }}; then if test -f {{ item }}; then
mkdir -p {{ __sshd_test_backup.path }}/$(dirname {{ item }}) mkdir -p {{ __sshd_test_backup.path }}/$(dirname {{ item }})
cp {{ item }} {{ __sshd_test_backup.path }}/$(dirname {{ item }}) cp -a {{ item }} {{ __sshd_test_backup.path }}/$(dirname {{ item }})
fi fi
changed_when: false changed_when: false
loop: "{{ __sshd_test_backup_files | d([]) }}" loop: "{{ __sshd_test_backup_files | d([]) }}"

View file

@ -6,7 +6,7 @@
set -o pipefail set -o pipefail
fi fi
if test -f {{ __sshd_test_backup.path }}/{{ item }}; then if test -f {{ __sshd_test_backup.path }}/{{ item }}; then
cp {{ __sshd_test_backup.path }}/{{ item }} $(dirname {{ item }}) cp -a {{ __sshd_test_backup.path }}/{{ item }} $(dirname {{ item }})
elif test -f {{ item }}; then elif test -f {{ item }}; then
rm {{ item }} rm {{ item }}
fi fi