1.1 --- a/tests/test_resource_invitation_constraints_quota.sh Mon Feb 08 16:52:02 2016 +0100
1.2 +++ b/tests/test_resource_invitation_constraints_quota.sh Mon Feb 08 17:40:20 2016 +0100
1.3 @@ -303,3 +303,52 @@
1.4 && [ `grep "event22@example.com" "$JOURNALFILE" | wc -l` = '1' ] \
1.5 && echo "Success" \
1.6 || echo "Failed"
1.7 +
1.8 +# Increase the quota.
1.9 +
1.10 +echo '* PT3H' > "$JOURNAL/$QUOTA/limits"
1.11 +
1.12 +# Attempt to schedule an event involving both resources.
1.13 +
1.14 +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-cars.txt" 2>> $ERROR
1.15 +
1.16 + grep -q "^20141127T150000Z${TAB}20141127T160000Z" "$FBSENDERFILE" \
1.17 +&& echo "Success" \
1.18 +|| echo "Failed"
1.19 +
1.20 +# Present the request to both resources.
1.21 +
1.22 + "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-cars.txt" 2>> $ERROR \
1.23 +| tee out8r.tmp \
1.24 +| "$SHOWMAIL" \
1.25 +> out8.tmp
1.26 +
1.27 +# Since the email module used by showmail.py cannot stop after reading a single
1.28 +# message, the second message is obtained.
1.29 +
1.30 + grep -n '^From ' out8r.tmp \
1.31 +| tail -n 1 \
1.32 +| cut -d ':' -f 1 \
1.33 +| xargs -I{} tail -n +'{}' out8r.tmp \
1.34 +| "$SHOWMAIL" \
1.35 +>> out8.tmp
1.36 +
1.37 + grep -q 'METHOD:REPLY' out8.tmp \
1.38 +&& grep -q 'ATTENDEE.*;PARTSTAT=ACCEPTED' out8.tmp \
1.39 +&& grep -q 'ATTENDEE.*;PARTSTAT=DECLINED' out8.tmp \
1.40 +&& echo "Success" \
1.41 +|| echo "Failed"
1.42 +
1.43 + ( grep -q "^20141127T150000Z${TAB}20141127T160000Z" "$FBFILE1" \
1.44 + && ! grep -q "^20141127T150000Z${TAB}20141127T160000Z" "$FBFILE2" ) \
1.45 +|| ( ! grep -q "^20141127T150000Z${TAB}20141127T160000Z" "$FBFILE1" \
1.46 + && grep -q "^20141127T150000Z${TAB}20141127T160000Z" "$FBFILE2" ) \
1.47 +&& echo "Success" \
1.48 +|| echo "Failed"
1.49 +
1.50 +# Check the quota (event is confirmed, but only for one resource).
1.51 +
1.52 + [ -e "$JOURNALFILE" ] \
1.53 +&& grep -q "event23@example.com" "$JOURNALFILE" \
1.54 +&& echo "Success" \
1.55 +|| echo "Failed"