root / htest / Test / Ganeti / Ssconf.hs @ 61899e64
History | View | Annotate | Download (1.3 kB)
1 | aed2325f | Iustin Pop | {-# LANGUAGE TemplateHaskell #-} |
---|---|---|---|
2 | aed2325f | Iustin Pop | {-# OPTIONS_GHC -fno-warn-orphans #-} |
3 | aed2325f | Iustin Pop | |
4 | aed2325f | Iustin Pop | {-| Unittests for ganeti-htools. |
5 | aed2325f | Iustin Pop | |
6 | aed2325f | Iustin Pop | -} |
7 | aed2325f | Iustin Pop | |
8 | aed2325f | Iustin Pop | {- |
9 | aed2325f | Iustin Pop | |
10 | aed2325f | Iustin Pop | Copyright (C) 2009, 2010, 2011, 2012 Google Inc. |
11 | aed2325f | Iustin Pop | |
12 | aed2325f | Iustin Pop | This program is free software; you can redistribute it and/or modify |
13 | aed2325f | Iustin Pop | it under the terms of the GNU General Public License as published by |
14 | aed2325f | Iustin Pop | the Free Software Foundation; either version 2 of the License, or |
15 | aed2325f | Iustin Pop | (at your option) any later version. |
16 | aed2325f | Iustin Pop | |
17 | aed2325f | Iustin Pop | This program is distributed in the hope that it will be useful, but |
18 | aed2325f | Iustin Pop | WITHOUT ANY WARRANTY; without even the implied warranty of |
19 | aed2325f | Iustin Pop | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
20 | aed2325f | Iustin Pop | General Public License for more details. |
21 | aed2325f | Iustin Pop | |
22 | aed2325f | Iustin Pop | You should have received a copy of the GNU General Public License |
23 | aed2325f | Iustin Pop | along with this program; if not, write to the Free Software |
24 | aed2325f | Iustin Pop | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
25 | aed2325f | Iustin Pop | 02110-1301, USA. |
26 | aed2325f | Iustin Pop | |
27 | aed2325f | Iustin Pop | -} |
28 | aed2325f | Iustin Pop | |
29 | aed2325f | Iustin Pop | module Test.Ganeti.Ssconf (testSsconf) where |
30 | aed2325f | Iustin Pop | |
31 | aed2325f | Iustin Pop | import Test.QuickCheck |
32 | aed2325f | Iustin Pop | |
33 | aed2325f | Iustin Pop | import Data.List |
34 | aed2325f | Iustin Pop | |
35 | aed2325f | Iustin Pop | import Test.Ganeti.TestHelper |
36 | aed2325f | Iustin Pop | |
37 | aed2325f | Iustin Pop | import qualified Ganeti.Ssconf as Ssconf |
38 | aed2325f | Iustin Pop | |
39 | aed2325f | Iustin Pop | -- * Ssconf tests |
40 | aed2325f | Iustin Pop | |
41 | 7022db83 | Iustin Pop | $(genArbitrary ''Ssconf.SSKey) |
42 | aed2325f | Iustin Pop | |
43 | 20bc5360 | Iustin Pop | prop_filename :: Ssconf.SSKey -> Property |
44 | 20bc5360 | Iustin Pop | prop_filename key = |
45 | aed2325f | Iustin Pop | printTestCase "Key doesn't start with correct prefix" $ |
46 | 37904802 | Iustin Pop | Ssconf.sSFilePrefix `isPrefixOf` Ssconf.keyToFilename "" key |
47 | aed2325f | Iustin Pop | |
48 | aed2325f | Iustin Pop | testSuite "Ssconf" |
49 | 20bc5360 | Iustin Pop | [ 'prop_filename |
50 | aed2325f | Iustin Pop | ] |