# HG changeset patch # User Paul Boddie # Date 1442167369 -7200 # Node ID af6ef9479837cf348bcd66060ce87d970efca136 # Parent 3c67c1c63c5d5ead39ad4d9f1e8f9185c80b65c9 Updated testing of free/busy offers and competing event rejection. diff -r 3c67c1c63c5d -r af6ef9479837 tests/templates/event-request-sauna-bad.txt --- a/tests/templates/event-request-sauna-bad.txt Sun Sep 13 20:01:15 2015 +0200 +++ b/tests/templates/event-request-sauna-bad.txt Sun Sep 13 20:02:49 2015 +0200 @@ -25,7 +25,7 @@ ATTENDEE;RSVP=TRUE:mailto:resource-room-sauna@example.com DTSTAMP:20141125T004600Z DTSTART;TZID=Europe/Oslo:20141126T161000 -DTEND;TZID=Europe/Oslo:20141126T170000 +DTEND;TZID=Europe/Oslo:20141126T164500 SUMMARY:Meeting at 4:10pm UID:event13@example.com END:VEVENT diff -r 3c67c1c63c5d -r af6ef9479837 tests/templates/event-request-sauna-good.txt --- a/tests/templates/event-request-sauna-good.txt Sun Sep 13 20:01:15 2015 +0200 +++ b/tests/templates/event-request-sauna-good.txt Sun Sep 13 20:02:49 2015 +0200 @@ -25,7 +25,7 @@ ATTENDEE;RSVP=TRUE:mailto:resource-room-sauna@example.com DTSTAMP:20141125T004600Z DTSTART;TZID=Europe/Oslo:20141126T160000 -DTEND;TZID=Europe/Oslo:20141126T161500 +DTEND;TZID=Europe/Oslo:20141126T164500 SUMMARY:Meeting at 4pm UID:event13@example.com END:VEVENT diff -r 3c67c1c63c5d -r af6ef9479837 tests/templates/event-request-sauna-rival.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/templates/event-request-sauna-rival.txt Sun Sep 13 20:02:49 2015 +0200 @@ -0,0 +1,34 @@ +Content-Type: multipart/alternative; boundary="===============0047278175==" +MIME-Version: 1.0 +From: vincent.vole@example.com +To: resource-room-sauna@example.com +Subject: Invitation! + +--===============0047278175== +Content-Type: text/plain; charset="us-ascii" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit + +This message contains an event. +--===============0047278175== +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Content-Type: text/calendar; charset="us-ascii"; method="REQUEST" + +BEGIN:VCALENDAR +PRODID:-//imip-agent/test//EN +METHOD:REQUEST +VERSION:2.0 +BEGIN:VEVENT +ORGANIZER:mailto:vincent.vole@example.com +ATTENDEE;ROLE=CHAIR:mailto:vincent.vole@example.com +ATTENDEE;RSVP=TRUE:mailto:resource-room-sauna@example.com +DTSTAMP:20141125T004600Z +DTSTART;TZID=Europe/Oslo:20141126T163000 +DTEND;TZID=Europe/Oslo:20141126T164500 +SUMMARY:Meeting at 4:30pm +UID:event18@example.com +END:VEVENT +END:VCALENDAR + +--===============0047278175==-- diff -r 3c67c1c63c5d -r af6ef9479837 tests/test_resource_invitation_constraints.sh --- a/tests/test_resource_invitation_constraints.sh Sun Sep 13 20:01:15 2015 +0200 +++ b/tests/test_resource_invitation_constraints.sh Sun Sep 13 20:02:49 2015 +0200 @@ -39,19 +39,30 @@ "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-sauna-bad.txt" 2>> $ERROR \ | "$SHOWMAIL" \ -> out2.tmp +> out1.tmp - grep -q 'METHOD:COUNTER' out2.tmp \ -&& grep -q 'DTSTART;TZID=Europe/Oslo.*:20141126T161500' out2.tmp \ + grep -q 'METHOD:COUNTER' out1.tmp \ +&& grep -q 'DTSTART;TZID=Europe/Oslo.*:20141126T161500' out1.tmp \ && echo "Success" \ || echo "Failed" ! [ -e "$FBFILE" ] \ -|| ! grep -q "^20141126T151500Z${TAB}20141126T170000Z" "$FBFILE" \ +|| ! grep -q "^20141126T151500Z${TAB}20141126T154500Z" "$FBFILE" \ +&& echo "Success" \ +|| echo "Failed" + + grep -q "^20141126T151500Z${TAB}20141126T154500Z" "$FBOFFERFILE" \ && echo "Success" \ || echo "Failed" - grep -q "^20141126T151500Z${TAB}20141126T170000Z" "$FBOFFERFILE" \ +# Attempt to schedule an event in the proposed period. + + "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-sauna-rival.txt" 2>> $ERROR \ +| "$SHOWMAIL" \ +> out2.tmp + + grep -q 'METHOD:REPLY' out2.tmp \ +&& grep -q 'ATTENDEE;PARTSTAT=DECLINED' out2.tmp \ && echo "Success" \ || echo "Failed" @@ -60,8 +71,9 @@ > out3.tmp grep -q 'METHOD:REPLY' out3.tmp \ -&& ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T151000Z/20141126T160000Z' out3.tmp \ -&& ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T151500Z/20141126T160000Z' out3.tmp \ +&& ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T151000Z/20141126T154500Z' out3.tmp \ +&& ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T151500Z/20141126T154500Z' out3.tmp \ +&& ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T153000Z/20141126T154500Z' out3.tmp \ && echo "Success" \ || echo "Failed" @@ -74,12 +86,13 @@ && echo "Success" \ || echo "Failed" - grep -q "^20141126T150000Z${TAB}20141126T151500Z" "$FBFILE" \ + grep -q "^20141126T150000Z${TAB}20141126T154500Z" "$FBFILE" \ && echo "Success" \ || echo "Failed" - ! grep -q "^20141126T150000Z${TAB}20141126T151500Z" "$FBOFFERFILE" \ -&& ! grep -q "^20141126T151500Z${TAB}20141126T170000Z" "$FBOFFERFILE" \ + ! grep -q "^20141126T150000Z${TAB}20141126T154500Z" "$FBOFFERFILE" \ +&& ! grep -q "^20141126T151500Z${TAB}20141126T154500Z" "$FBOFFERFILE" \ +&& ! grep -q "^20141126T153000Z${TAB}20141126T154500Z" "$FBOFFERFILE" \ && echo "Success" \ || echo "Failed" @@ -88,6 +101,8 @@ > out6.tmp grep -q 'METHOD:REPLY' out6.tmp \ -&& grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T151500Z' out6.tmp \ +&& grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T154500Z' out6.tmp \ +&& ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T151500Z/20141126T154500Z' out6.tmp \ +&& ! grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T153000Z/20141126T154500Z' out6.tmp \ && echo "Success" \ || echo "Failed"