diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch) | |
tree | 67208f7c145782a7e90b123b982ca78d88cc2c87 /karm/test/remote_storage.sh | |
download | tdepim-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/remote_storage.sh')
-rwxr-xr-x | karm/test/remote_storage.sh | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/karm/test/remote_storage.sh b/karm/test/remote_storage.sh new file mode 100755 index 000000000..a4335b6c1 --- /dev/null +++ b/karm/test/remote_storage.sh @@ -0,0 +1,58 @@ +#!/bin/sh + +# Karm can read and write to an FTP server for storage file. + +exec >>check.log 2>&1 + +PORT=8000 +TESTFILE="http://localhost:$PORT/testkarm.ics" +TESTFILE_LOCAL="testkarm.ics" +TESTTODO="testtodo" + +# Start with clean environment +# If runscripts sees output on stderr, it thinks script failed. +DCOPID=`dcop | grep karm 2>/dev/null` +if [ -n $DCOPID ]; then dcop $DCOPID KarmDCOPIface quit; fi; +if [ -e $TESTFILE_LOCAL ]; then rm $TESTFILE_LOCAL; fi + +# if the file does not exist, kresources pops up a modal dialog box +# telling us that a file does not exist. + +touch $TESTFILE_LOCAL + +python __httpd.py $PORT & + +sleep 2 + +HTTPD_PID=`ps -C "python __httpd.py" -o pid=` + +karm $TESTFILE & + +sleep 2 + +DCOPID=`dcop | grep karm` + +# karm does not write file until data is saved. + +echo "DEBUG: dcop $DCOPID KarmDCOPIface addtodo \"$TESTTODO\"" +dcop $DCOPID KarmDCOPIface addtodo "$TESTTODO" + +sleep 1 + +RVAL=1 +if [ -e $TESTFILE_LOCAL ]; then RVAL=0; fi + +# clean up +if [ -n $DCOPID ]; then dcop $DCOPID KarmDCOPIface quit; fi; +if [ -e $TESTFILE_LOCAL ]; then rm $TESTFILE_LOCAL; fi +if [ -n $HTTPD_PID ]; then kill $HTTPD_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 |