tarback/tests/test-003-ssh-docker.sh

34 lines
1.3 KiB
Bash
Raw Permalink Normal View History

#!/bin/sh
set -eu
. ./tests/common.sh
export TARBACK_REMOTE='ssh localhost'
# archive whole directory
workdir="$(create_directories 127)"
filename="$(basename "$(find "$workdir/source" -type f)")"
docker_volume="$(create_docker_volume "$workdir" "$filename")"
2023-06-08 17:49:26 +02:00
./tarback.sh -P ssh,docker create "$docker_volume" "$workdir/dest/source.tar.xz"
docker volume rm "$docker_volume" 2>/dev/null 1>&2
docker_volume="$(create_docker_volume)"
2023-06-08 17:49:26 +02:00
./tarback.sh -P ssh,docker restore "$workdir/dest/source.tar.xz" "$docker_volume"
extract_docker_volume "$docker_volume" "$workdir" "$filename"
diff "$workdir/source" "$workdir/restore"
docker volume rm "$docker_volume" 2>/dev/null 1>&2
rm -rf "$workdir"
workdir="$(create_directories 127)"
filename="$(basename "$(find "$workdir/source" -type f)")"
docker_volume="$(create_docker_volume "$workdir" "$filename")"
2023-06-08 17:49:26 +02:00
TARBACK_SPLIT='split -b 10 -' ./tarback.sh -P ssh,docker create "$docker_volume" "$workdir/dest/source.tar.xz"
docker volume rm "$docker_volume" 2>/dev/null 1>&2
docker_volume="$(create_docker_volume)"
2023-06-08 17:49:26 +02:00
TARBACK_SPLIT='split -b 10 -' ./tarback.sh -P ssh,docker restore "$workdir/dest/source.tar.xz" "$docker_volume"
extract_docker_volume "$docker_volume" "$workdir" "$filename"
diff "$workdir/source" "$workdir/restore"
docker volume rm "$docker_volume" 2>/dev/null 1>&2
rm -rf "$workdir"