*** empty log message ***
[arla.git] / tests / distributed1
blobd6b94a910e5571a73bedb94d5c12cff329d8b6fa
1 #!/bin/sh
3 # $Id$
5 #use arla-cli to do some basic consistency checks with multiple clients
7 CLI=${objdir}/../arlad/arla-cli
8 CONF=${objdir}/../conf/arla.conf
9 PWD=`pwd` #only works with /afs
10 CP="$CLI -c $CONF put"
13 #init
14 echo -n foo > foo
15 echo -n bar > bar
16 echo -n baz > baz
18 cat > check <<EOF
19 #!/bin/sh
20 A=\`cat bar\`
21 echo bar is \$A
22 test \$A = \$1 || exit 1
23 EOF
24 chmod +x check
27 #basic consistency checks
28 ./check bar || exit 1
30 $CP $PWD/foo $PWD/bar
32 ./check foo || exit 1
35 #with local open for read
36 tail -f bar &
37 echo $! > tail.pid
39 $CP $PWD/baz $PWD/bar
41 ./check foo || exit 1
43 kill `cat tail.pid`
45 ./check baz || exit 1
48 #with local open for write
49 cat >> bar &
50 echo $! > cat.pid
52 $CP $PWD/foo $PWD/bar
54 ./check baz || exit 1
56 kill `cat cat.pid`
58 ./check baz || exit 1