-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Redirect to a mirror which has the file to which the symlink is pointing
- Loading branch information
1 parent
5153dc3
commit 1e46c14
Showing
9 changed files
with
141 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!lib/test-in-container-environ.sh | ||
set -exo pipefail | ||
|
||
mc=$(environ mc $(pwd)) | ||
|
||
MIRRORCACHE_SCHEDULE_RETRY_INTERVAL=1 | ||
$mc/gen_env MIRRORCACHE_SCHEDULE_RETRY_INTERVAL=$MIRRORCACHE_SCHEDULE_RETRY_INTERVAL \ | ||
MIRRORCACHE_HASHES_COLLECT=1 \ | ||
MIRRORCACHE_ZSYNC_COLLECT=dat \ | ||
MIRRORCACHE_HASHES_PIECES_MIN_SIZE=5 | ||
|
||
$mc/start | ||
$mc/status | ||
|
||
ap8=$(environ ap8) | ||
ap7=$(environ ap7) | ||
|
||
for x in $mc $ap7 $ap8; do | ||
mkdir -p $x/dt/folder1 | ||
echo 1111111111 > $x/dt/folder1/file1.1.dat | ||
echo 1111111111 > $x/dt/folder1/file2.1.dat | ||
( cd $x/dt/folder1/ && ln -s file2.1.dat x-Media.dat ) | ||
done | ||
|
||
$ap7/start | ||
rm $ap7/dt/folder1/file2.1.dat # this mirror is missing the file for whatever reasons | ||
rm $ap7/dt/folder1/x-Media.dat | ||
touch $ap7/dt/folder1/x-Media.dat # but still has the symlink | ||
$ap8/start | ||
|
||
$mc/sql "insert into server(hostname,urldir,enabled,country,region) select '$($ap7/print_address)','','t','us','na'" | ||
$mc/sql "insert into server(hostname,urldir,enabled,country,region) select '$($ap8/print_address)','','t','de','eu'" | ||
|
||
# force scan | ||
$mc/backstage/job -e folder_sync -a '["/folder1"]' | ||
$mc/backstage/job -e mirror_scan -a '["/folder1"]' | ||
$mc/backstage/shoot | ||
|
||
$mc/curl -IL /download/folder1/x-Media.dat | ||
rc=0 | ||
$mc/curl -IL /download/folder1/x-Media.dat | grep $($ap7/print_address) || rc=$? | ||
test $rc -gt 0 | ||
|
||
$mc/curl -IL /download/folder1/x-Media.dat | grep $($ap8/print_address) | ||
|
||
echo success |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.