File: twofileupdate.sh

package info (click to toggle)
strigi 0.7.2-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 6,808 kB
  • ctags: 7,071
  • sloc: cpp: 44,468; ansic: 9,764; perl: 515; java: 367; python: 345; xml: 316; yacc: 176; sh: 153; makefile: 38
file content (42 lines) | stat: -rwxr-xr-x 947 bytes parent folder | download | duplicates (9)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
#! /bin/bash

# this test checks if the strigicmd utility properly detect creation and
# deletion of a file

function fail() {
    echo Test failed
    exit 1
}

#VG="valgrind --db-attach=yes "

rm -r x y
mkdir x
touch x/y
touch x/z
echo == src/strigicmd/strigicmd create -t clucene -d y x ==
if ! $VG src/strigicmd/strigicmd create -t clucene -d y x; then
    fail
fi
echo == src/strigicmd/strigicmd listFiles -t clucene -d y ==
if ! $VG src/strigicmd/strigicmd listFiles -t clucene -d y; then
    fail
fi
sleep 1
touch x/y
touch x/z
echo == src/strigicmd/strigicmd update -t clucene -d y x ==
exit
if ! $VG src/strigicmd/strigicmd update -t clucene -d y x; then
    fail
fi
echo == src/strigicmd/strigicmd listFiles -t clucene -d y ==
if ! $VG src/strigicmd/strigicmd listFiles -t clucene -d y; then
    fail
fi
OUT=`$VG src/strigicmd/strigicmd listFiles -t clucene -d y`
if [[ $OUT == 'x/z' ]]; then
    echo Test succesfull
    exit 0
fi
fail