summaryrefslogtreecommitdiffstats
path: root/karm/test/webdav.sh
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch)
tree67208f7c145782a7e90b123b982ca78d88cc2c87 /karm/test/webdav.sh
downloadtdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz
tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'karm/test/webdav.sh')
-rwxr-xr-xkarm/test/webdav.sh58
1 files changed, 58 insertions, 0 deletions
diff --git a/karm/test/webdav.sh b/karm/test/webdav.sh
new file mode 100755
index 000000000..8d51db92c
--- /dev/null
+++ b/karm/test/webdav.sh
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+# Add a todo to an iCal file stored on a webdav server.
+
+exec >>check.log 2>&1
+
+source __lib.sh
+
+# check for required perl stuff
+perl -e "use Net::DAV::Server;" > /dev/null 2>&1
+if ! [ $? = 0 ]; then
+ echo "PASS"
+ exit 0
+fi
+
+# Start webdav server
+perl __webdav.pl &
+sleep 2
+WEBDAV_PID=`ps -C "perl __webdav.pl" -o pid=`
+
+# Start karm
+TESTFILE="http://localhost:4242/testkarm.ics"
+TESTFILE_LOCAL="/tmp/testkarm.ics"
+TESTTODO="testtodo"
+SKIP_TESTFILE_DELETE=true
+# Need this or karm complains there is no file
+rm -f $TESTFILE_LOCAL
+touch $TESTFILE_LOCAL
+set_up
+#wait till download is ready
+sleep 3
+
+# add a todo
+dcop $DCOPID KarmDCOPIface addTask "$TESTTODO"
+sleep 1
+dcop $DCOPID KarmDCOPIface save
+
+sleep 1
+
+if grep $TESTTODO $TESTFILE_LOCAL
+ then RVAL=0
+ else RVAL=1
+fi
+
+# clean up
+tear_down
+#if [ -e $TESTFILE_LOCAL ]; then rm $TESTFILE_LOCAL; fi
+if [ -n $WEBDAV_PID ]; then kill $WEBDAV_PID; fi
+
+# return 0 on success, 1 on failure
+if [ $RVAL -eq 0 ]
+then
+ echo "PASS $0"
+ exit 0
+else
+ echo "FAIL $0"
+ exit 1
+fi