Make the fix script update revision details.
[amitay/build-farm.git] / test_lock.sh
1 #!/bin/bash
2
3 host=`hostname`
4
5 . build_test.fns
6
7 rm -f test.lck
8
9 echo testing plain
10 lock_file test.lck || exit 1
11 unlock_file test.lck || exit 1
12
13 echo testing nesting
14 lock_file test.lck || exit 1
15 lock_file test.lck || exit 1
16 unlock_file test.lck || exit 1
17 unlock_file test.lck || exit 1
18
19 echo testing machine
20 echo foobar:1 > test.lck
21 lock_file test.lck && exit 1
22 rm -f test.lck
23
24 echo testing stale
25 echo $host:1111111 > test.lck
26 lock_file test.lck || exit 1
27 rm -f test.lck
28
29 echo OK
30 exit 0