1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#!/usr/bin/env bash
set -e
uri1="${AUTOPKGTEST_TMP}/uri1"
uri2="${AUTOPKGTEST_TMP}/uri2"
uri3="${AUTOPKGTEST_TMP}/uri3"
mkdir $uri1 $uri2 $uri3
config="${AUTOPKGTEST_TMP}/config"
echo "Creating test file"
testfile="${AUTOPKGTEST_TMP}/testfile"
echo -n "test content" > $testfile
cat $testfile
echo
echo
echo "Splitting test file"
gfsec-split -c $config $testfile "file://$uri1/secret" "file://$uri2/secret" "file://$uri3/secret"
echo
echo "Checking file is removed"
! test -e $testfile
echo
echo "Combining shares"
gfsec-use -c $config -k
grep -q 'test content' $testfile
|