Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mover-rclone/active.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ fi
START_TIME=$SECONDS
case "${DIRECTION}" in
source)
find "${MOUNT_PATH}" -path "${MOUNT_PATH}/lost+found" -prune -o -print | getfacl -P - > /tmp/permissions.facl
find "${MOUNT_PATH}" -path "${MOUNT_PATH}/lost+found" -prune -o -not -type l -print | getfacl -P - > /tmp/permissions.facl
rclone sync "${RCLONE_FLAGS_SYNC[@]}" --exclude "lost+found/**" "${MOUNT_PATH}" "${RCLONE_CONFIG_SECTION}:${RCLONE_DEST_PATH}" --log-level DEBUG
rclone copy "${RCLONE_FLAGS_COPY[@]}" --include permissions.facl /tmp "${RCLONE_CONFIG_SECTION}:${RCLONE_DEST_PATH}" --log-level DEBUG
;;
Expand Down
12 changes: 12 additions & 0 deletions test-e2e/roles/compare_pvc_data/templates/job.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ spec:

echo "... all file contents matched"

{% if not skip_symlink_check | default(false) %}
echo "Validating symlinks: PVC1 -> PVC2"
find /mnt -type l | { grep -v lost+found || true; } | sort | while IFS= read -r f; do
f2=$(echo "$f" | sed 's|^/mnt/|/mnt2/|')
Expand All @@ -64,13 +65,24 @@ spec:
done

echo "... all symlinks matched"
{% else %}
echo "Skipping symlink validation (skip_symlink_check=true)"
{% endif %}

echo "File attributes:"
{% if skip_symlink_check | default(false) %}
find /mnt -not -type l -exec stat -c "{{ properties_to_verify }}" {} \; | \
{% else %}
find /mnt -exec stat -c "{{ properties_to_verify }}" {} \; | \
{% endif %}
grep -v lost+found | \
sort | tee /tmp/attributes-mnt
sed -ri 's|/mnt|/mnt2|' /tmp/attributes-mnt
{% if skip_symlink_check | default(false) %}
find /mnt2 -not -type l -exec stat -c "{{ properties_to_verify }}" {} \; | \
{% else %}
find /mnt2 -exec stat -c "{{ properties_to_verify }}" {} \; | \
{% endif %}
grep -v lost+found | \
sort > /tmp/attributes-mnt2

Expand Down
8 changes: 7 additions & 1 deletion test-e2e/test_rclone_normal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,18 @@
requests:
storage: 1Gi

- name: Write data into the source PVC
- name: Write data and symlinks into the source PVC
include_role:
name: write_to_pvc
vars:
data: 'data'
path: '/datafile'
pvc_name: 'data-source'
symlinks:
- path: '/mysql.sock'
target: '/var/run/mysqld/mysqld.sock'
- path: '/link-relative'
target: 'datafile'

- name: Sync data from source volume (w/ mSC)
kubernetes.core.k8s:
Expand Down Expand Up @@ -242,3 +247,4 @@
pvc1_name: data-source
pvc2_name: data-dest
timeout: 900
skip_symlink_check: true
8 changes: 7 additions & 1 deletion test-e2e/test_rclone_priv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,18 @@
requests:
storage: 1Gi

- name: Write data into the source PVC
- name: Write data and symlinks into the source PVC
include_role:
name: write_to_pvc
vars:
data: 'data'
path: '/datafile'
pvc_name: 'data-source'
symlinks:
- path: '/mysql.sock'
target: '/var/run/mysqld/mysqld.sock'
- path: '/link-relative'
target: 'datafile'

- name: Sync data from source volume
kubernetes.core.k8s:
Expand Down Expand Up @@ -184,3 +189,4 @@
pvc1_name: data-source
pvc2_name: data-dest
timeout: 900
skip_symlink_check: true
Loading