#!/bin/sh

. ./init_test

echo "*** Test skipping medium (long)"

runA -f $H/A
runB -a $H/B

echo "1" > $H/A/a
runA
runB

# Create a big file that can't be cached or bufferized by "gzip" or "cat"
echo | awk 'END { for(i=0;i<400000;i++) print cos(i*1.001) ; }' > $H/A/a
runA

# This script remove the medium content
echo "rm $M/*.AA* ; exit 0" >remove_medium
chmod 755 remove_medium

# Run on A but the file "a" can't be read
# Nevertheles IT SHOULD BE wrote on the medium
# because the up to date version is here.
runA --exec_after_merge `pwd`/remove_medium
rm remove_medium

runB

same $H/A a $H/B a || Exit 1



Exit 0

