tarback/tests/test-002-docker.sh

31 lines
1.3 KiB
Bash
Executable file

#!/bin/sh
set -eu
. ./tests/common.sh
# archive whole directory
workdir="$(create_directories 127)"
filename="$(basename "$(find "$workdir/source" -type f)")"
docker_volume="$(create_docker_volume "$workdir" "$filename")"
./tarback.sh -P docker create "$docker_volume" "$workdir/dest/source.tar.xz"
docker volume rm "$docker_volume" 2>/dev/null 1>&2
docker_volume="$(create_docker_volume)"
./tarback.sh -P 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")"
TARBACK_SPLIT='split -b 10 -' ./tarback.sh -P docker create "$docker_volume" "$workdir/dest/source.tar.xz"
docker volume rm "$docker_volume" 2>/dev/null 1>&2
docker_volume="$(create_docker_volume)"
TARBACK_SPLIT='split -b 10 -' ./tarback.sh -P 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"