Revision 20bc5360 htest/Test/Ganeti/Luxi.hs
b/htest/Test/Ganeti/Luxi.hs | ||
---|---|---|
86 | 86 |
Luxi.ReqSetWatcherPause -> Luxi.SetWatcherPause <$> arbitrary |
87 | 87 |
|
88 | 88 |
-- | Simple check that encoding/decoding of LuxiOp works. |
89 |
prop_Luxi_CallEncoding :: Luxi.LuxiOp -> Property
|
|
90 |
prop_Luxi_CallEncoding op =
|
|
89 |
prop_CallEncoding :: Luxi.LuxiOp -> Property |
|
90 |
prop_CallEncoding op = |
|
91 | 91 |
(Luxi.validateCall (Luxi.buildCall op) >>= Luxi.decodeCall) ==? Ok op |
92 | 92 |
|
93 | 93 |
-- | Helper to a get a temporary file name. |
... | ... | |
115 | 115 |
-- | Monadic check that, given a server socket, we can connect via a |
116 | 116 |
-- client to it, and that we can send a list of arbitrary messages and |
117 | 117 |
-- get back what we sent. |
118 |
prop_Luxi_ClientServer :: [[DNSChar]] -> Property
|
|
119 |
prop_Luxi_ClientServer dnschars = monadicIO $ do
|
|
118 |
prop_ClientServer :: [[DNSChar]] -> Property |
|
119 |
prop_ClientServer dnschars = monadicIO $ do |
|
120 | 120 |
let msgs = map (map dnsGetChar) dnschars |
121 | 121 |
fpath <- run $ getTempFileName |
122 | 122 |
-- we need to create the server first, otherwise (if we do it in the |
... | ... | |
137 | 137 |
stop $ replies ==? msgs |
138 | 138 |
|
139 | 139 |
testSuite "Luxi" |
140 |
[ 'prop_Luxi_CallEncoding
|
|
141 |
, 'prop_Luxi_ClientServer
|
|
140 |
[ 'prop_CallEncoding |
|
141 |
, 'prop_ClientServer |
|
142 | 142 |
] |
Also available in: Unified diff