ganeti

Test.Ganeti.Locking.Waiting

Description

Tests for lock waiting structure.

Synopsis

# Documentation

data UpdateRequest a b c Source #

Constructors

 Update b [LockRequest a] UpdateWaiting c b [LockRequest a] RemovePending b IntersectRequest b [a] OpportunisticUnion b [(a, OwnerState)]

asWaitingTrans :: (Lock a, Ord b, Ord c) => LockWaiting a b c -> UpdateRequest a b c -> LockWaiting a b c Source #

Transform an UpdateRequest into the corresponding state transformer.

foldUpdates :: (Lock a, Ord b, Ord c) => [UpdateRequest a b c] -> LockWaiting a b c Source #

Fold a sequence of requests to transform a waiting strucutre onto the empty waiting. As we consider all exported transformations, any waiting structure can be obtained this way.

prop_NoActionWithPendingRequests :: Property Source #

Verify that an owner with a pending request cannot make any changes to the lock structure.

forAllBlocked :: Testable prop => (LockWaiting TestLock TestOwner Integer -> TestOwner -> Integer -> [LockRequest TestLock] -> prop) -> Property Source #

Quantifier for blocked requests. Quantifies over the generic situation that there is a state, an owner, and a request that is blocked for that owner. To obtain such a situation, we use the fact that there must be a different owner having at least one lock.

prop_WaitingRequestsGetPending :: Property Source #

Verify that an owner has a pending request after a waiting request not fullfilled immediately.

prop_PendingGetFulfilledEventually :: Property Source #

Verify that pending requests get fullfilled once all blockers release their resources.

prop_PendingGetNotifiedEventually :: Property Source #

Verify that the owner of a pending request gets notified once all blockers release their resources.

prop_Progress :: Property Source #

Verify that some progress is made after the direct blockers give up their locks. Note that we cannot guarantee that the original requester gets its request granted, as someone else might have a more important priority.

prop_ProgressSound :: Property Source #

Verify that the notifications send out are sound, i.e., upon notification the requests actually are fulfilled. To be sure to have at least one notification we, again, use the scenario that a request is blocked and then all the blockers release their resources.

prop_PendingJustified :: Property Source #

Verify that all pending requests are valid and cannot be fulfilled in the underlying lock allocation.

prop_UpdateIdempotent :: Property Source #

Verify that updateLocks is idempotent, except that in the repetition, no waiters are notified.

prop_extReprPreserved :: Property Source #

Verify that extRepr . fromExtRepr = id for all valid extensional representations.

prop_SimulateUpdateLocks :: Property Source #

Verify that any state is indistinguishable from its canonical version (i.e., the one obtained from the extensional representation) with respect to updateLocks.

prop_SimulateUpdateLocksWaiting :: Property Source #

Verify that any state is indistinguishable from its canonical version (i.e., the one obtained from the extensional representation) with respect to updateLocksWaiting.

prop_SafeUpdateWaitingCorrect :: Property Source #

Verify that if a requestor has no pending requests, safeUpdateWaiting conincides with updateLocksWaiting.

prop_SafeUpdateWaitingIdempotent :: Property Source #

Verify that safeUpdateLocksWaiting is idempotent, that in the repetition no notifications are done.

Verify that for LockWaiting we have readJSON . showJSON is extensionally equivalent to Ok.

prop_OpportunisticMonotone :: Property Source #

Verify that opportunistic union only increases the locks held.