1.1 --- a/tests/test_resource_invitation_constraints_quota_delegation.sh Fri May 13 00:28:46 2016 +0200
1.2 +++ b/tests/test_resource_invitation_constraints_quota_delegation.sh Fri May 13 01:10:08 2016 +0200
1.3 @@ -4,10 +4,12 @@
1.4
1.5 USER1="mailto:resource-car-porsche911@example.com"
1.6 USER2="mailto:resource-car-fiat500@example.com"
1.7 -SENDER="mailto:paul.boddie@example.com"
1.8 +SENDER1="mailto:paul.boddie@example.com"
1.9 +SENDER2="mailto:vincent.vole@example.com"
1.10 USER1ADDRESS="resource-car-porsche911@example.com"
1.11 USER2ADDRESS="resource-car-fiat500@example.com"
1.12 -SENDERADDRESS="paul.boddie@example.com"
1.13 +SENDER1ADDRESS="paul.boddie@example.com"
1.14 +SENDER2ADDRESS="vincent.vole@example.com"
1.15 QUOTA=cars
1.16 OTHER_QUOTA=rooms
1.17
1.18 @@ -17,7 +19,6 @@
1.19 cat > "$PREFS/$USER1/scheduling_function" <<EOF
1.20 schedule_for_delegate $QUOTA
1.21 schedule_in_freebusy
1.22 -check_quota $QUOTA
1.23 EOF
1.24
1.25 mkdir -p "$PREFS/$USER2"
1.26 @@ -26,14 +27,12 @@
1.27 cat > "$PREFS/$USER2/scheduling_function" <<EOF
1.28 schedule_for_delegate $QUOTA
1.29 schedule_in_freebusy
1.30 -check_quota $QUOTA
1.31 EOF
1.32
1.33 -cat <<EOF | "$SET_QUOTA_LIMIT" "$QUOTA" $SET_QUOTA_LIMIT_ARGS
1.34 -* PT2H
1.35 -EOF
1.36 -cat <<EOF | "$SET_QUOTA_LIMIT" "$OTHER_QUOTA" $SET_QUOTA_LIMIT_ARGS
1.37 -* PT2H
1.38 +# Have a common group for all organisers when scheduling.
1.39 +
1.40 +cat <<EOF | "$SET_QUOTA_GROUPS" "$QUOTA" $SET_QUOTA_GROUPS_ARGS
1.41 +* all
1.42 EOF
1.43
1.44 # Allow cars to delegate to each other.
1.45 @@ -56,7 +55,7 @@
1.46
1.47 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-car.txt" 2>> $ERROR
1.48
1.49 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy" \
1.50 + "$LIST_SCRIPT" $LIST_ARGS "$SENDER1" "freebusy" \
1.51 | tee out0s.tmp \
1.52 | grep -q "^20141126T150000Z${TAB}20141126T160000Z" \
1.53 && echo "Success" \
1.54 @@ -82,7 +81,7 @@
1.55
1.56 # Check the quota (event is confirmed).
1.57
1.58 - "$LIST_SCRIPT" $LIST_ARGS "$QUOTA" "entries" "$SENDER" \
1.59 + "$LIST_SCRIPT" $LIST_ARGS "$QUOTA" "entries" "all" \
1.60 | tee out1e.tmp \
1.61 | grep -q "event21@example.com" \
1.62 && echo "Success" \
1.63 @@ -92,7 +91,7 @@
1.64
1.65 "$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-car-delegating.txt" 2>> $ERROR
1.66
1.67 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy" \
1.68 + "$LIST_SCRIPT" $LIST_ARGS "$SENDER2" "freebusy" \
1.69 | tee out1s.tmp \
1.70 | grep -q "^20141126T153000Z${TAB}20141126T163000Z" \
1.71 && echo "Success" \
1.72 @@ -109,7 +108,7 @@
1.73 "$SHOWMAIL" 1 < out2r.tmp \
1.74 > out2p1.tmp
1.75
1.76 -if grep -q "To: $SENDERADDRESS" out2p0.tmp ; then
1.77 +if grep -q "To: $SENDER2ADDRESS" out2p0.tmp ; then
1.78 ORGFN=out2p0.tmp ; DELFN=out2p1.tmp
1.79 else
1.80 ORGFN=out2p1.tmp ; DELFN=out2p0.tmp
1.81 @@ -126,7 +125,7 @@
1.82
1.83 # The other will be a reply to the organiser.
1.84
1.85 - grep -q "To: $SENDERADDRESS" "$ORGFN" \
1.86 + grep -q "To: $SENDER2ADDRESS" "$ORGFN" \
1.87 && grep -q 'METHOD:REPLY' "$ORGFN" \
1.88 && grep -q 'ATTENDEE.*;PARTSTAT=DELEGATED.*:'"$USER1" "$ORGFN" \
1.89 && grep -q 'ATTENDEE.*:'"$USER2" "$ORGFN" \
1.90 @@ -151,7 +150,7 @@
1.91
1.92 # Check the quota (event is not confirmed).
1.93
1.94 - "$LIST_SCRIPT" $LIST_ARGS "$QUOTA" "entries" "$SENDER" \
1.95 + "$LIST_SCRIPT" $LIST_ARGS "$QUOTA" "entries" "all" \
1.96 > out2e.tmp
1.97
1.98 grep -q "event21@example.com" "out2e.tmp" \
1.99 @@ -169,14 +168,14 @@
1.100 # Check the free/busy status of the attendees at the organiser.
1.101 # Currently, neither are attending.
1.102
1.103 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER1" \
1.104 + "$LIST_SCRIPT" $LIST_ARGS "$SENDER2" "freebusy_other" "$USER1" \
1.105 > out3s0.tmp \
1.106
1.107 ! grep -q "^20141126T153000Z${TAB}20141126T163000Z" out3s0.tmp \
1.108 && echo "Success" \
1.109 || echo "Failed"
1.110
1.111 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER2" \
1.112 + "$LIST_SCRIPT" $LIST_ARGS "$SENDER2" "freebusy_other" "$USER2" \
1.113 > out3s1.tmp \
1.114
1.115 ! grep -q "^20141126T153000Z${TAB}20141126T163000Z" out3s1.tmp \
1.116 @@ -194,7 +193,7 @@
1.117 "$SHOWMAIL" 1 < out4r.tmp \
1.118 > out4p1.tmp
1.119
1.120 -if grep -q "To: $SENDERADDRESS" out4p0.tmp ; then
1.121 +if grep -q "To: $SENDER2ADDRESS" out4p0.tmp ; then
1.122 ORGFN=out4p0.tmp ; DELFN=out4p1.tmp
1.123 else
1.124 ORGFN=out4p1.tmp ; DELFN=out4p0.tmp
1.125 @@ -202,7 +201,7 @@
1.126
1.127 # One of the responses will be a reply sent to the organiser.
1.128
1.129 - grep -q "To: $SENDERADDRESS" "$ORGFN" \
1.130 + grep -q "To: $SENDER2ADDRESS" "$ORGFN" \
1.131 && grep -q 'METHOD:REPLY' "$ORGFN" \
1.132 && grep -q 'ATTENDEE.*;PARTSTAT=DELEGATED.*:'"$USER1" "$ORGFN" \
1.133 && grep -q 'ATTENDEE.*;PARTSTAT=ACCEPTED.*:'"$USER2" "$ORGFN" \
1.134 @@ -244,14 +243,14 @@
1.135 # Check the free/busy status of the attendees at the organiser.
1.136 # Now, the delegate is attending.
1.137
1.138 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER1" \
1.139 + "$LIST_SCRIPT" $LIST_ARGS "$SENDER2" "freebusy_other" "$USER1" \
1.140 > out5s0.tmp \
1.141
1.142 ! grep -q "^20141126T153000Z${TAB}20141126T163000Z" out5s0.tmp \
1.143 && echo "Success" \
1.144 || echo "Failed"
1.145
1.146 - "$LIST_SCRIPT" $LIST_ARGS "$SENDER" "freebusy_other" "$USER2" \
1.147 + "$LIST_SCRIPT" $LIST_ARGS "$SENDER2" "freebusy_other" "$USER2" \
1.148 > out5s1.tmp \
1.149
1.150 grep -q "^20141126T153000Z${TAB}20141126T163000Z" out5s1.tmp \