Statistics
| Branch: | Tag: | Revision:

root / htest / Test / Ganeti / Jobs.hs @ 22381768

History | View | Annotate | Download (1.5 kB)

1 2d87bd0a Iustin Pop
{-# LANGUAGE TemplateHaskell #-}
2 2d87bd0a Iustin Pop
{-# OPTIONS_GHC -fno-warn-orphans #-}
3 2d87bd0a Iustin Pop
4 2d87bd0a Iustin Pop
{-| Unittests for ganeti-htools.
5 2d87bd0a Iustin Pop
6 2d87bd0a Iustin Pop
-}
7 2d87bd0a Iustin Pop
8 2d87bd0a Iustin Pop
{-
9 2d87bd0a Iustin Pop
10 2d87bd0a Iustin Pop
Copyright (C) 2009, 2010, 2011, 2012 Google Inc.
11 2d87bd0a Iustin Pop
12 2d87bd0a Iustin Pop
This program is free software; you can redistribute it and/or modify
13 2d87bd0a Iustin Pop
it under the terms of the GNU General Public License as published by
14 2d87bd0a Iustin Pop
the Free Software Foundation; either version 2 of the License, or
15 2d87bd0a Iustin Pop
(at your option) any later version.
16 2d87bd0a Iustin Pop
17 2d87bd0a Iustin Pop
This program is distributed in the hope that it will be useful, but
18 2d87bd0a Iustin Pop
WITHOUT ANY WARRANTY; without even the implied warranty of
19 2d87bd0a Iustin Pop
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20 2d87bd0a Iustin Pop
General Public License for more details.
21 2d87bd0a Iustin Pop
22 2d87bd0a Iustin Pop
You should have received a copy of the GNU General Public License
23 2d87bd0a Iustin Pop
along with this program; if not, write to the Free Software
24 2d87bd0a Iustin Pop
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 2d87bd0a Iustin Pop
02110-1301, USA.
26 2d87bd0a Iustin Pop
27 2d87bd0a Iustin Pop
-}
28 2d87bd0a Iustin Pop
29 2d87bd0a Iustin Pop
module Test.Ganeti.Jobs (testJobs) where
30 2d87bd0a Iustin Pop
31 2d87bd0a Iustin Pop
import Test.QuickCheck
32 2d87bd0a Iustin Pop
33 2d87bd0a Iustin Pop
import Test.Ganeti.TestHelper
34 2d87bd0a Iustin Pop
import Test.Ganeti.TestCommon
35 2d87bd0a Iustin Pop
36 2d87bd0a Iustin Pop
import qualified Ganeti.Jobs as Jobs
37 2d87bd0a Iustin Pop
38 2d87bd0a Iustin Pop
-- * Arbitrary instances
39 2d87bd0a Iustin Pop
40 7022db83 Iustin Pop
$(genArbitrary ''Jobs.OpStatus)
41 2d87bd0a Iustin Pop
42 7022db83 Iustin Pop
$(genArbitrary ''Jobs.JobStatus)
43 2d87bd0a Iustin Pop
44 2d87bd0a Iustin Pop
-- * Test cases
45 2d87bd0a Iustin Pop
46 2d87bd0a Iustin Pop
-- | Check that (queued) job\/opcode status serialization is idempotent.
47 20bc5360 Iustin Pop
prop_OpStatus_serialization :: Jobs.OpStatus -> Property
48 63b068c1 Iustin Pop
prop_OpStatus_serialization = testSerialisation
49 2d87bd0a Iustin Pop
50 20bc5360 Iustin Pop
prop_JobStatus_serialization :: Jobs.JobStatus -> Property
51 63b068c1 Iustin Pop
prop_JobStatus_serialization = testSerialisation
52 2d87bd0a Iustin Pop
53 2d87bd0a Iustin Pop
testSuite "Jobs"
54 20bc5360 Iustin Pop
            [ 'prop_OpStatus_serialization
55 20bc5360 Iustin Pop
            , 'prop_JobStatus_serialization
56 2d87bd0a Iustin Pop
            ]