summaryrefslogtreecommitdiffstats
path: root/karm/test/refresh_on_change.sh
blob: 0f0200807291ffd9a6a52d58656a875ac9000c9c (plain)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh

# I cannot get this test to work reliably!
# I suspect the culprit is FAM.
#   -- Mark

exec >>check.log 2>&1

. /__lib.sh

TESTFILE="/tmp/testkarm.ics"

set_up

TODO_NAME=$0
TODO_UID=abc-123
TODO_TIME=`date +%Y%m%dT%H%M%SZ`

sleep 1 # make sure kdirstat can recognize the change in last change date

cat >> $TESTFILE << endl
BEGIN:VCALENDAR
PRODID:-//K Desktop Environment//NONSGML KArm Test Scripts//EN
VERSION:2.0

BEGIN:VTODO
DTSTAMP:$TODO_TIME
ORGANIZER;CN=Anonymous:MAILTO:nobody@nowhere
CREATED:$TODO_TIME
UID:$TODO_UID
SEQUENCE:0
LAST-MODIFIED:$TODO_TIME
SUMMARY:$TODO_NAME
CLASS:PUBLIC
PRIORITY:5
PERCENT-COMPLETE:0
END:VTODO

END:VCALENDAR
endl

# wait so FAM and KDirWatcher tell karm and karm refreshes view
sleep 2

RVAL=`dcop $DCOPID KarmDCOPIface taskIdFromName $TODO_NAME`
#echo "RVAL = $RVAL"

tear_down

# check that todo was found
if [ "$RVAL" = "$TODO_UID" ]; then 
  echo "PASS $0"
  exit 0;
else 
  echo "FAIL $0: got /$RVAL/, expected /$TODO_UID/"
  exit 1;
fi