Skip to content

Commit

Permalink
Merge pull request #269 from richm/test-backup-restore-preserve-file-…
Browse files Browse the repository at this point in the history
…attrs

tests: Ensure backup/restore preserves file attributes
  • Loading branch information
richm committed Nov 20, 2023
2 parents 350a0e5 + 24c1915 commit e54fca5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/tasks/backup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
set -eu
if test -f {{ item }}; then
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
changed_when: false
loop: "{{ __sshd_test_backup_files | d([]) }}"
Expand Down
2 changes: 1 addition & 1 deletion tests/tasks/restore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
set -o pipefail
fi
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
rm {{ item }}
fi
Expand Down

0 comments on commit e54fca5

Please sign in to comment.