1.1 --- a/tests/test_resource_invitation_constraints_multiple.sh Sat Jan 30 17:24:39 2016 +0100
1.2 +++ b/tests/test_resource_invitation_constraints_multiple.sh Sun Jan 31 00:45:26 2016 +0100
1.3 @@ -3,12 +3,11 @@
1.4 . "`dirname \"$0\"`/common.sh"
1.5
1.6 USER="mailto:resource-room-sauna@example.com"
1.7 -SENDER="mailto:paul.boddie@example.net"
1.8 +SENDER="mailto:paul.boddie@example.com"
1.9 +OUTSIDESENDER="mailto:paul.boddie@example.net"
1.10 FBFILE="$STORE/$USER/freebusy"
1.11 -FBOFFERFILE="$STORE/$USER/freebusy-offers"
1.12 FBSENDERFILE="$STORE/$SENDER/freebusy"
1.13 -FBSENDEROTHERFILE="$STORE/$SENDER/freebusy-other/$USER"
1.14 -FBSENDERREQUESTS="$STORE/$SENDER/requests"
1.15 +FBOUTSIDESENDERFILE="$STORE/$OUTSIDESENDER/freebusy"
1.16
1.17 mkdir -p "$PREFS/$USER"
1.18 echo 'Europe/Oslo' > "$PREFS/$USER/TZID"
1.19 @@ -33,7 +32,7 @@
1.20
1.21 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-sauna-outsider.txt" 2>> $ERROR
1.22
1.23 - grep -q "^20141126T150000Z${TAB}20141126T154500Z" "$FBSENDERFILE" \
1.24 + grep -q "^20141126T150000Z${TAB}20141126T154500Z" "$FBOUTSIDESENDERFILE" \
1.25 && echo "Success" \
1.26 || echo "Failed"
1.27
1.28 @@ -87,3 +86,137 @@
1.29 && grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T154500Z' out3.tmp \
1.30 && echo "Success" \
1.31 || echo "Failed"
1.32 +
1.33 +# Try a different scheduling function.
1.34 +
1.35 +ACL="$PWD/acl.tmp"
1.36 +
1.37 +cat > "$PREFS/$USER/scheduling_function" <<EOF
1.38 +schedule_in_freebusy
1.39 +access_control_list "$ACL"
1.40 +EOF
1.41 +
1.42 +# Try without an ACL.
1.43 +
1.44 +cat > "$ACL" <<EOF
1.45 +EOF
1.46 +
1.47 +# Attempt to schedule an event.
1.48 +
1.49 +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-sauna-acl.txt" 2>> $ERROR
1.50 +
1.51 + grep -q "^20141126T160000Z${TAB}20141126T164500Z" "$FBSENDERFILE" \
1.52 +&& echo "Success" \
1.53 +|| echo "Failed"
1.54 +
1.55 +# Present the request to the resource.
1.56 +
1.57 + "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-sauna-acl.txt" 2>> $ERROR \
1.58 +| tee out4r.tmp \
1.59 +| "$SHOWMAIL" \
1.60 +> out4.tmp
1.61 +
1.62 + grep -q 'METHOD:REPLY' out4.tmp \
1.63 +&& grep -q 'ATTENDEE.*;PARTSTAT=DECLINED' out4.tmp \
1.64 +&& echo "Success" \
1.65 +|| echo "Failed"
1.66 +
1.67 + ! [ -e "$FBFILE" ] \
1.68 +|| ! grep -q "^20141126T160000Z${TAB}20141126T164500Z" "$FBFILE" \
1.69 +&& echo "Success" \
1.70 +|| echo "Failed"
1.71 +
1.72 +# Try with an unreasonable ACL.
1.73 +
1.74 +cat > "$ACL" <<EOF
1.75 +decline
1.76 +EOF
1.77 +
1.78 +# Attempt to schedule an event.
1.79 +
1.80 +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-sauna-acl.txt" 2>> $ERROR
1.81 +
1.82 + grep -q "^20141126T160000Z${TAB}20141126T164500Z" "$FBSENDERFILE" \
1.83 +&& echo "Success" \
1.84 +|| echo "Failed"
1.85 +
1.86 +# Present the request to the resource.
1.87 +
1.88 + "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-sauna-acl.txt" 2>> $ERROR \
1.89 +| tee out5r.tmp \
1.90 +| "$SHOWMAIL" \
1.91 +> out5.tmp
1.92 +
1.93 + grep -q 'METHOD:REPLY' out5.tmp \
1.94 +&& grep -q 'ATTENDEE.*;PARTSTAT=DECLINED' out5.tmp \
1.95 +&& echo "Success" \
1.96 +|| echo "Failed"
1.97 +
1.98 + ! [ -e "$FBFILE" ] \
1.99 +|| ! grep -q "^20141126T160000Z${TAB}20141126T164500Z" "$FBFILE" \
1.100 +&& echo "Success" \
1.101 +|| echo "Failed"
1.102 +
1.103 +# Try with a reasonable ACL.
1.104 +
1.105 +cat > "$ACL" <<EOF
1.106 +accept
1.107 +decline attendee simon.skunk@example.com
1.108 +EOF
1.109 +
1.110 +# Attempt to schedule an event.
1.111 +
1.112 +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-sauna-acl.txt" 2>> $ERROR
1.113 +
1.114 + grep -q "^20141126T160000Z${TAB}20141126T164500Z" "$FBSENDERFILE" \
1.115 +&& echo "Success" \
1.116 +|| echo "Failed"
1.117 +
1.118 +# Present the request to the resource.
1.119 +
1.120 + "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-sauna-acl.txt" 2>> $ERROR \
1.121 +| tee out6r.tmp \
1.122 +| "$SHOWMAIL" \
1.123 +> out6.tmp
1.124 +
1.125 + grep -q 'METHOD:REPLY' out6.tmp \
1.126 +&& grep -q 'ATTENDEE.*;PARTSTAT=DECLINED' out6.tmp \
1.127 +&& echo "Success" \
1.128 +|| echo "Failed"
1.129 +
1.130 + ! [ -e "$FBFILE" ] \
1.131 +|| ! grep -q "^20141126T160000Z${TAB}20141126T164500Z" "$FBFILE" \
1.132 +&& echo "Success" \
1.133 +|| echo "Failed"
1.134 +
1.135 +# Modify the ACL, using the implicit preference setting to hold the list.
1.136 +
1.137 +cat > "$PREFS/$USER/scheduling_function" <<EOF
1.138 +schedule_in_freebusy
1.139 +access_control_list
1.140 +EOF
1.141 +
1.142 +cat > "$PREFS/$USER/acl" <<EOF
1.143 +accept
1.144 +decline attendee simon.skunk@example.com
1.145 +accept organiser mailto:paul.boddie@example.com
1.146 +EOF
1.147 +
1.148 +# Present the request to the resource.
1.149 +
1.150 + "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-sauna-acl.txt" 2>> $ERROR \
1.151 +| tee out7r.tmp \
1.152 +| "$SHOWMAIL" \
1.153 +> out7.tmp
1.154 +
1.155 + grep -q 'METHOD:REPLY' out7.tmp \
1.156 +&& grep -q 'ATTENDEE.*;PARTSTAT=ACCEPTED' out7.tmp \
1.157 +&& echo "Success" \
1.158 +|| echo "Failed"
1.159 +
1.160 + ! [ -e "$FBFILE" ] \
1.161 +|| grep -q "^20141126T160000Z${TAB}20141126T164500Z" "$FBFILE" \
1.162 +&& echo "Success" \
1.163 +|| echo "Failed"
1.164 +
1.165 +rm "$ACL"