imip-agent

Annotated tests/test_freebusy_publishing.sh

785:94cff57d56a9
2015-09-28 Paul Boddie Handle editing operations in the absence of a main period. imipweb-client-simplification
paul@632 1
#!/bin/sh
paul@632 2
paul@632 3
THIS_DIR=`dirname $0`
paul@632 4
paul@632 5
TEMPLATES="$THIS_DIR/templates"
paul@632 6
PERSON_SCRIPT="$THIS_DIR/../imip_person.py"
paul@632 7
SHOWMAIL="$THIS_DIR/../tools/showmail.py"
paul@632 8
STORE=/tmp/store
paul@632 9
STATIC=/tmp/static
paul@640 10
PREFS=/tmp/prefs
paul@640 11
ARGS="-S $STORE -P $STATIC -p $PREFS -d"
paul@632 12
USER="mailto:paul.boddie@example.com"
paul@632 13
SENDER="mailto:resource-room-confroom@example.com"
paul@632 14
FBFILE="$STORE/$USER/freebusy"
paul@632 15
FBOTHERFILE="$STORE/$USER/freebusy-other/$SENDER"
paul@632 16
TAB=`printf '\t'`
paul@632 17
paul@632 18
PYTHONPATH="$THIS_DIR/.."
paul@632 19
export PYTHONPATH
paul@632 20
paul@632 21
ERROR=err.tmp
paul@632 22
paul@632 23
rm -r $STORE
paul@632 24
rm -r $STATIC
paul@640 25
rm -r $PREFS
paul@632 26
rm $ERROR
paul@632 27
rm out*.tmp
paul@632 28
paul@640 29
mkdir -p "$PREFS/$USER"
paul@640 30
echo 'Europe/Oslo' > "$PREFS/$USER/TZID"
paul@640 31
echo 'share' > "$PREFS/$USER/freebusy_sharing"
paul@640 32
paul@632 33
  "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/fb-publish.txt" 2>> $ERROR \
paul@632 34
| "$SHOWMAIL" \
paul@632 35
> out0.tmp
paul@632 36
paul@632 37
   grep -q "^20140401T070000Z${TAB}20140401T080000Z" "$FBOTHERFILE" \
paul@632 38
&& grep -q "^20140401T080000Z${TAB}20140401T100000Z" "$FBOTHERFILE" \
paul@632 39
&& echo "Success" \
paul@632 40
|| echo "Failed"
paul@632 41
paul@632 42
  "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/fb-publish-again.txt" 2>> $ERROR \
paul@632 43
| "$SHOWMAIL" \
paul@632 44
> out0.tmp
paul@632 45
paul@632 46
   grep -q "^20140401T070000Z${TAB}20140401T080000Z" "$FBOTHERFILE" \
paul@632 47
&& ! grep -q "^20140401T080000Z${TAB}20140401T100000Z" "$FBOTHERFILE" \
paul@632 48
&& grep -q "^20140401T083000Z${TAB}20140401T100000Z" "$FBOTHERFILE" \
paul@632 49
&& echo "Success" \
paul@632 50
|| echo "Failed"