Revision e3b02e1f
b/Makefile.am | ||
---|---|---|
842 | 842 |
test/hs/Test/Ganeti/Kvmd.hs \ |
843 | 843 |
test/hs/Test/Ganeti/Luxi.hs \ |
844 | 844 |
test/hs/Test/Ganeti/Locking/Allocation.hs \ |
845 |
test/hs/Test/Ganeti/Locking/Locks.hs \ |
|
845 | 846 |
test/hs/Test/Ganeti/Network.hs \ |
846 | 847 |
test/hs/Test/Ganeti/Objects.hs \ |
847 | 848 |
test/hs/Test/Ganeti/OpCodes.hs \ |
b/test/hs/Test/Ganeti/Locking/Locks.hs | ||
---|---|---|
1 |
{-# LANGUAGE TemplateHaskell #-} |
|
2 |
{-# OPTIONS_GHC -fno-warn-orphans #-} |
|
3 |
|
|
4 |
{-| Tests for the lock data structure |
|
5 |
|
|
6 |
-} |
|
7 |
|
|
8 |
{- |
|
9 |
|
|
10 |
Copyright (C) 2014 Google Inc. |
|
11 |
|
|
12 |
This program is free software; you can redistribute it and/or modify |
|
13 |
it under the terms of the GNU General Public License as published by |
|
14 |
the Free Software Foundation; either version 2 of the License, or |
|
15 |
(at your option) any later version. |
|
16 |
|
|
17 |
This program is distributed in the hope that it will be useful, but |
|
18 |
WITHOUT ANY WARRANTY; without even the implied warranty of |
|
19 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
20 |
General Public License for more details. |
|
21 |
|
|
22 |
You should have received a copy of the GNU General Public License |
|
23 |
along with this program; if not, write to the Free Software |
|
24 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
25 |
02110-1301, USA. |
|
26 |
|
|
27 |
-} |
|
28 |
|
|
29 |
module Test.Ganeti.Locking.Locks (testLocking_Locks) where |
|
30 |
|
|
31 |
import Test.QuickCheck |
|
32 |
import Text.JSON |
|
33 |
|
|
34 |
import Test.Ganeti.TestHelper |
|
35 |
import Test.Ganeti.TestCommon |
|
36 |
|
|
37 |
import Ganeti.Locking.Locks |
|
38 |
|
|
39 |
instance Arbitrary GanetiLocks where |
|
40 |
arbitrary = elements [BGL] |
|
41 |
|
|
42 |
-- | Verify that readJSON . showJSON = Ok |
|
43 |
prop_ReadShow :: Property |
|
44 |
prop_ReadShow = forAll (arbitrary :: Gen GanetiLocks) $ \a -> |
|
45 |
readJSON (showJSON a) ==? Ok a |
|
46 |
|
|
47 |
|
|
48 |
testSuite "Locking/Locks" |
|
49 |
[ 'prop_ReadShow |
|
50 |
] |
b/test/hs/htest.hs | ||
---|---|---|
57 | 57 |
import Test.Ganeti.JQueue |
58 | 58 |
import Test.Ganeti.Kvmd |
59 | 59 |
import Test.Ganeti.Locking.Allocation |
60 |
import Test.Ganeti.Locking.Locks |
|
60 | 61 |
import Test.Ganeti.Luxi |
61 | 62 |
import Test.Ganeti.Network |
62 | 63 |
import Test.Ganeti.Objects |
... | ... | |
123 | 124 |
, testJQueue |
124 | 125 |
, testKvmd |
125 | 126 |
, testLocking_Allocation |
127 |
, testLocking_Locks |
|
126 | 128 |
, testLuxi |
127 | 129 |
, testNetwork |
128 | 130 |
, testObjects |
Also available in: Unified diff