1 #!/bin/sh 2 3 . "`dirname \"$0\"`/common.sh" 4 5 SENDER="mailto:paul.boddie@example.com" 6 ROOM="mailto:resource-room-confroom@example.com" 7 CAR="mailto:resource-car-porsche911@example.com" 8 9 mkdir -p "$PREFS/$ROOM" 10 echo 'Europe/Oslo' > "$PREFS/$ROOM/TZID" 11 echo 'share' > "$PREFS/$ROOM/freebusy_sharing" 12 13 mkdir -p "$PREFS/$CAR" 14 echo 'Europe/Mariehamn' > "$PREFS/$CAR/TZID" 15 echo 'share' > "$PREFS/$CAR/freebusy_sharing" 16 17 # Test the recipient's initial free/busy state. 18 19 test_initial_freebusy 'resource' 20 test_initial_freebusy_limited 'resource' 21 22 # Make a new event. 23 24 cat > "event_cmd.tmp" <<EOF 25 new 26 period 0 edit 20141126 16 00 00 Europe/Oslo 20141126 17 00 00 Europe/Oslo 27 attendance accept 28 attendee mailto:resource-room-confroom@example.com 29 attendee mailto:resource-car-porsche911@example.com 30 summary Test drive 31 finish 32 update event.tmp 33 publish event_self.tmp 34 UID event_uid.tmp 35 EOF 36 37 text_client "$SENDER" "event_cmd.tmp" 38 39 # Obtain the event UID. 40 41 read UID1 < "event_uid.tmp" 42 43 # Register the event at the sender. 44 45 outgoing_script "event_self.tmp" 46 47 # Present the event to the recipient. 48 49 resource_script "event.tmp" "out2.tmp" "out2r.tmp" 50 51 # Expect replies because each recipient handles the request. 52 53 # Inspect the room's response. 54 55 is_present 'METHOD:REPLY' "out2.tmp" && success || failed "out2.tmp" 56 is_present 'ATTENDEE;PARTSTAT=ACCEPTED' "out2.tmp" && success || failed "out2.tmp" 57 58 # Inspect the car's response. 59 60 showmail "out2r.tmp" 1 | is_present 'METHOD:REPLY' "out2.tmp" && success || failed "out2.tmp" 61 showmail "out2r.tmp" 1 | is_present 'ATTENDEE;PARTSTAT=ACCEPTED' "out2.tmp" && success || failed "out2.tmp" 62 63 # Expect free/busy periods for the recipients. 64 65 list_script "out2f1.tmp" "$ROOM" "freebusy" 66 test_freebusy '20141126T150000Z' '20141126T160000Z' "out2f1.tmp" 67 list_script "out2f2.tmp" "$CAR" "freebusy" 68 test_freebusy '20141126T150000Z' '20141126T160000Z' "out2f2.tmp" 69 70 # Present a new free/busy request to the resources. 71 # NOTE: We might open the event and use that for the request. 72 73 cat > "fb_cmd.tmp" <<EOF 74 new 75 period 0 edit 20141126 16 00 00 Europe/Oslo 20141126 19 00 00 Europe/Oslo 76 attendee mailto:resource-room-confroom@example.com 77 attendee mailto:resource-car-porsche911@example.com 78 finish 79 freebusy fb.tmp 80 EOF 81 82 text_client "$SENDER" "fb_cmd.tmp" 83 84 # Present the request to the recipients. 85 86 resource_script "fb.tmp" "out4.tmp" "out4r.tmp" 87 88 # Expect replies because each recipient handles the request. 89 90 # Inspect the room's response. 91 92 is_present 'METHOD:REPLY' "out4.tmp" && success || failed "out4.tmp" 93 is_present 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' "out4.tmp" && success || failed "out4.tmp" 94 95 # Inspect the car's response. 96 97 showmail "out4r.tmp" 1 | is_present 'METHOD:REPLY' "out4.tmp" && success || failed "out4.tmp" 98 showmail "out4r.tmp" 1 | is_present 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' "out4.tmp" && success || failed "out4.tmp" 99 100 # Cancel the attendance of the conference room. 101 102 cat > "event_cancel_cmd.tmp" <<EOF 103 attendee mailto:resource-room-confroom@example.com remove 104 finish 105 cancel event_cancel.tmp 106 EOF 107 108 text_client_specific "$SENDER" "event_cancel_cmd.tmp" "$UID1" 109 110 # Present the request to the recipient. 111 112 resource_script "event_cancel.tmp" "out5.tmp" 113 114 # Present a new free/busy request to each resource. 115 116 cat > "fb_room_cmd.tmp" <<EOF 117 new 118 period 0 edit 20141126 16 00 00 Europe/Oslo 20141126 19 00 00 Europe/Oslo 119 attendee mailto:resource-room-confroom@example.com 120 finish 121 freebusy fb_room.tmp 122 EOF 123 124 text_client "$SENDER" "fb_room_cmd.tmp" 125 126 # Present the request to the recipients. 127 128 resource_script "fb_room.tmp" "out6.tmp" 129 130 # Expect a reply but with no free/busy periods. 131 132 is_present 'METHOD:REPLY' "out6.tmp" && success || failed "out6.tmp" 133 is_absent 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' "out6.tmp" && success || failed "out6.tmp" 134 135 # Present a new free/busy request to each resource. 136 137 cat > "fb_car_cmd.tmp" <<EOF 138 new 139 period 0 edit 20141126 16 00 00 Europe/Oslo 20141126 19 00 00 Europe/Oslo 140 attendee mailto:resource-car-porsche911@example.com 141 finish 142 freebusy fb_car.tmp 143 EOF 144 145 text_client "$SENDER" "fb_car_cmd.tmp" 146 147 # Present the request to the recipients. 148 149 resource_script "fb_car.tmp" "out7.tmp" 150 151 # Expect a reply with free/busy periods. 152 153 is_present 'METHOD:REPLY' "out7.tmp" && success || failed "out7.tmp" 154 is_present 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' "out7.tmp" && success || failed "out7.tmp"