1.1 --- a/tests/test_resource_invitation_constraints_quota.sh Sat May 14 00:55:51 2016 +0200
1.2 +++ b/tests/test_resource_invitation_constraints_quota.sh Sat May 14 00:56:54 2016 +0200
1.3 @@ -8,6 +8,25 @@
1.4 QUOTA=cars
1.5 OTHER_QUOTA=rooms
1.6
1.7 +# Test quota enforcement where no limits apply, with resources first attempting
1.8 +# to schedule reservations before checking a quota applying to both resources.
1.9 +
1.10 +# The result should be a scheduling attempt with the first resource succeeding,
1.11 +# but another with the second resource being declined due to a lack of quota.
1.12 +# An adjustment to the quota then permits the successful reservation of the
1.13 +# second resource. The first reservation is then cancelled.
1.14 +
1.15 +# Quota-wide free/busy validation is then enabled, and the reservation of the
1.16 +# second resource is replayed to allow the journal to maintain the free/busy
1.17 +# details of the organiser. Now, when an attempt is made to reserve the first
1.18 +# resource at the same time once again, this fails because the journal now knows
1.19 +# that the organiser is occupied during the period in question. Moving the
1.20 +# reservation of the first resource leads to a successful booking.
1.21 +
1.22 +# Meanwhile, raising the quota once again and attempting to reserve both
1.23 +# resources using a separate event leads to only one resource being booked due
1.24 +# to a lack of quota.
1.25 +
1.26 mkdir -p "$PREFS/$USER1"
1.27 echo 'Europe/Oslo' > "$PREFS/$USER1/TZID"
1.28 echo 'share' > "$PREFS/$USER1/freebusy_sharing"
2.1 --- a/tests/test_resource_invitation_constraints_quota_delegation.sh Sat May 14 00:55:51 2016 +0200
2.2 +++ b/tests/test_resource_invitation_constraints_quota_delegation.sh Sat May 14 00:56:54 2016 +0200
2.3 @@ -13,6 +13,14 @@
2.4 QUOTA=cars
2.5 OTHER_QUOTA=rooms
2.6
2.7 +# Test delegation using the default "available" policy, preferring the recipient
2.8 +# over other available delegates. The schedule_in_freebusy function is also used
2.9 +# to insist that the resources can schedule any reservation.
2.10 +
2.11 +# The result should be the reservation of USER1, then an attempt to reserve
2.12 +# USER1 again should be delegated to USER2, with USER2 being available in the
2.13 +# requested period. This delegation should then succeed.
2.14 +
2.15 mkdir -p "$PREFS/$USER1"
2.16 echo 'Europe/Oslo' > "$PREFS/$USER1/TZID"
2.17 echo 'share' > "$PREFS/$USER1/freebusy_sharing"
3.1 --- a/tests/test_resource_invitation_constraints_quota_delegation_policy.sh Sat May 14 00:55:51 2016 +0200
3.2 +++ b/tests/test_resource_invitation_constraints_quota_delegation_policy.sh Sat May 14 00:56:54 2016 +0200
3.3 @@ -13,6 +13,15 @@
3.4 QUOTA=cars
3.5 OTHER_QUOTA=rooms
3.6
3.7 +# Test delegation using the "most-available" policy and without using the
3.8 +# explicit schedule_in_freebusy function since multiple concurrent reservations
3.9 +# are to occur without any limits.
3.10 +
3.11 +# The result should be the reservation of USER1, then the reservation of both
3.12 +# USER1 and USER2, followed by an attempt to reserve USER1 that results in the
3.13 +# delegation to USER2 because USER2 is less committed (more available) during
3.14 +# the period concerned.
3.15 +
3.16 mkdir -p "$PREFS/$USER1"
3.17 echo 'Europe/Oslo' > "$PREFS/$USER1/TZID"
3.18 echo 'share' > "$PREFS/$USER1/freebusy_sharing"
4.1 --- a/tests/test_resource_invitation_constraints_quota_recurring_limits.sh Sat May 14 00:55:51 2016 +0200
4.2 +++ b/tests/test_resource_invitation_constraints_quota_recurring_limits.sh Sat May 14 00:56:54 2016 +0200
4.3 @@ -10,6 +10,18 @@
4.4 SENDERADDRESS2="vincent.vole@example.com"
4.5 QUOTA=cars
4.6
4.7 +# Test quota enforcement on two resources, first checking whether the resources
4.8 +# can schedule an incoming reservation, then checking whether the reservation
4.9 +# would exceed the organiser's quota applying collectively to both resources.
4.10 +
4.11 +# The result should be the first scheduling attempt being declined because it
4.12 +# attempts to reserve an indefinite amount of time, with the second attempt
4.13 +# succeeding but only for one resource because the quota is used up reserving
4.14 +# one of the two resources requested. This reservation is then cancelled.
4.15 +
4.16 +# Another attempt is made by a user with a larger quota, and this succeeds in
4.17 +# reserving both resources.
4.18 +
4.19 mkdir -p "$PREFS/$USER1"
4.20 echo 'Europe/Oslo' > "$PREFS/$USER1/TZID"
4.21 echo 'share' > "$PREFS/$USER1/freebusy_sharing"
4.22 @@ -147,7 +159,8 @@
4.23
4.24 # Cancel the event.
4.25
4.26 -"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-cars-recurring.txt" 2>> $ERROR
4.27 + sed 's/FREQ=DAILY/FREQ=DAILY;COUNT=5/;' "$TEMPLATES/event-cancel-cars-recurring.txt" \
4.28 +| "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR
4.29
4.30 "$LIST_SCRIPT" $LIST_ARGS "$SENDER1" "freebusy" \
4.31 > out2s.tmp
4.32 @@ -159,7 +172,8 @@
4.33
4.34 # Present the request to the resource.
4.35
4.36 - "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-cars-recurring.txt" 2>> $ERROR \
4.37 + sed 's/FREQ=DAILY/FREQ=DAILY;COUNT=5/;' "$TEMPLATES/event-cancel-cars-recurring.txt" \
4.38 +| "$RESOURCE_SCRIPT" $ARGS 2>> $ERROR \
4.39 | tee out3r.tmp \
4.40 | "$SHOWMAIL" \
4.41 > out3.tmp