Revision 50c674fc

b/test/hs/Test/Ganeti/Locking/Allocation.hs
155 155
    let allLocks = listAllLocks state in
156 156
    all (`elem` allLocks) (M.keys $ listLocks a state)
157 157

  
158
-- | Verify that the list of all locks with states is contained in the list
159
-- of all locks.
160
prop_LocksAllOwnersSubsetLockslist :: Property
161
prop_LocksAllOwnersSubsetLockslist =
162
  forAll (arbitrary :: Gen (LockAllocation TestLock TestOwner)) $ \state ->
163
  printTestCase "The list of all active locks must contain all locks mentioned\
164
                \ in the locks state" $
165
  S.isSubsetOf (S.fromList . map fst $ listAllLocksOwners state)
166
      (S.fromList $ listAllLocks state)
167

  
158 168
-- | Verify that exclusive group locks are honored, i.e., verify that if someone
159 169
-- holds a lock, then no one else can hold a lock on an exclusive lock on an
160 170
-- implied lock.
......
344 354
testSuite "Locking/Allocation"
345 355
 [ 'prop_LocksDisjoint
346 356
 , 'prop_LockslistComplete
357
 , 'prop_LocksAllOwnersSubsetLockslist
347 358
 , 'prop_LockImplicationX
348 359
 , 'prop_LockImplicationS
349 360
 , 'prop_LocksStable

Also available in: Unified diff