# HG changeset patch # User Paul Boddie # Date 1463180214 -7200 # Node ID 237e48421b7b1309d49d11cc2c14c4ddc81482d5 # Parent f13a53554da3256eb78b16ce1d5dfcd7909ecac5 Fixed cancellation of originally-unending events that were truncated. Added some explanations of the behaviour of some tests. diff -r f13a53554da3 -r 237e48421b7b tests/test_resource_invitation_constraints_quota.sh --- a/tests/test_resource_invitation_constraints_quota.sh Sat May 14 00:55:51 2016 +0200 +++ b/tests/test_resource_invitation_constraints_quota.sh Sat May 14 00:56:54 2016 +0200 @@ -8,6 +8,25 @@ QUOTA=cars OTHER_QUOTA=rooms +# Test quota enforcement where no limits apply, with resources first attempting +# to schedule reservations before checking a quota applying to both resources. + +# The result should be a scheduling attempt with the first resource succeeding, +# but another with the second resource being declined due to a lack of quota. +# An adjustment to the quota then permits the successful reservation of the +# second resource. The first reservation is then cancelled. + +# Quota-wide free/busy validation is then enabled, and the reservation of the +# second resource is replayed to allow the journal to maintain the free/busy +# details of the organiser. Now, when an attempt is made to reserve the first +# resource at the same time once again, this fails because the journal now knows +# that the organiser is occupied during the period in question. Moving the +# reservation of the first resource leads to a successful booking. + +# Meanwhile, raising the quota once again and attempting to reserve both +# resources using a separate event leads to only one resource being booked due +# to a lack of quota. + mkdir -p "$PREFS/$USER1" echo 'Europe/Oslo' > "$PREFS/$USER1/TZID" echo 'share' > "$PREFS/$USER1/freebusy_sharing" diff -r f13a53554da3 -r 237e48421b7b tests/test_resource_invitation_constraints_quota_delegation.sh --- a/tests/test_resource_invitation_constraints_quota_delegation.sh Sat May 14 00:55:51 2016 +0200 +++ b/tests/test_resource_invitation_constraints_quota_delegation.sh Sat May 14 00:56:54 2016 +0200 @@ -13,6 +13,14 @@ QUOTA=cars OTHER_QUOTA=rooms +# Test delegation using the default "available" policy, preferring the recipient +# over other available delegates. The schedule_in_freebusy function is also used +# to insist that the resources can schedule any reservation. + +# The result should be the reservation of USER1, then an attempt to reserve +# USER1 again should be delegated to USER2, with USER2 being available in the +# requested period. This delegation should then succeed. + mkdir -p "$PREFS/$USER1" echo 'Europe/Oslo' > "$PREFS/$USER1/TZID" echo 'share' > "$PREFS/$USER1/freebusy_sharing" diff -r f13a53554da3 -r 237e48421b7b tests/test_resource_invitation_constraints_quota_delegation_policy.sh --- a/tests/test_resource_invitation_constraints_quota_delegation_policy.sh Sat May 14 00:55:51 2016 +0200 +++ b/tests/test_resource_invitation_constraints_quota_delegation_policy.sh Sat May 14 00:56:54 2016 +0200 @@ -13,6 +13,15 @@ QUOTA=cars OTHER_QUOTA=rooms +# Test delegation using the "most-available" policy and without using the +# explicit schedule_in_freebusy function since multiple concurrent reservations +# are to occur without any limits. + +# The result should be the reservation of USER1, then the reservation of both +# USER1 and USER2, followed by an attempt to reserve USER1 that results in the +# delegation to USER2 because USER2 is less committed (more available) during +# the period concerned. + mkdir -p "$PREFS/$USER1" echo 'Europe/Oslo' > "$PREFS/$USER1/TZID" echo 'share' > "$PREFS/$USER1/freebusy_sharing" diff -r f13a53554da3 -r 237e48421b7b tests/test_resource_invitation_constraints_quota_recurring_limits.sh --- a/tests/test_resource_invitation_constraints_quota_recurring_limits.sh Sat May 14 00:55:51 2016 +0200 +++ b/tests/test_resource_invitation_constraints_quota_recurring_limits.sh Sat May 14 00:56:54 2016 +0200 @@ -10,6 +10,18 @@ SENDERADDRESS2="vincent.vole@example.com" QUOTA=cars +# Test quota enforcement on two resources, first checking whether the resources +# can schedule an incoming reservation, then checking whether the reservation +# would exceed the organiser's quota applying collectively to both resources. + +# The result should be the first scheduling attempt being declined because it +# attempts to reserve an indefinite amount of time, with the second attempt +# succeeding but only for one resource because the quota is used up reserving +# one of the two resources requested. This reservation is then cancelled. + +# Another attempt is made by a user with a larger quota, and this succeeds in +# reserving both resources. + mkdir -p "$PREFS/$USER1" echo 'Europe/Oslo' > "$PREFS/$USER1/TZID" echo 'share' > "$PREFS/$USER1/freebusy_sharing" @@ -147,7 +159,8 @@ # Cancel the event. -"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-cars-recurring.txt" 2>> $ERROR + sed 's/FREQ=DAILY/FREQ=DAILY;COUNT=5/;' "$TEMPLATES/event-cancel-cars-recurring.txt" \ +| "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR "$LIST_SCRIPT" $LIST_ARGS "$SENDER1" "freebusy" \ > out2s.tmp @@ -159,7 +172,8 @@ # Present the request to the resource. - "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-cars-recurring.txt" 2>> $ERROR \ + sed 's/FREQ=DAILY/FREQ=DAILY;COUNT=5/;' "$TEMPLATES/event-cancel-cars-recurring.txt" \ +| "$RESOURCE_SCRIPT" $ARGS 2>> $ERROR \ | tee out3r.tmp \ | "$SHOWMAIL" \ > out3.tmp