Revision a5c198eb test/hs/Test/Ganeti/Objects.hs
b/test/hs/Test/Ganeti/Objects.hs | ||
---|---|---|
62 | 62 |
import Ganeti.Objects as Objects |
63 | 63 |
import Ganeti.JSON |
64 | 64 |
import Ganeti.Types |
65 |
import Ganeti.Utils (bitStringToB64String) |
|
65 | 66 |
|
66 | 67 |
-- * Arbitrary instances |
67 | 68 |
|
... | ... | |
238 | 239 |
genValidNetwork :: Gen Objects.Network |
239 | 240 |
genValidNetwork = do |
240 | 241 |
-- generate netmask for the IPv4 network |
241 |
netmask <- fromIntegral <$> choose (24::Int, 30)
|
|
242 |
netmask <- fromIntegral <$> choose (24::Int, 29)
|
|
242 | 243 |
name <- genName >>= mkNonEmpty |
243 | 244 |
mac_prefix <- genMaybe genName |
244 | 245 |
net <- arbitrary |
245 | 246 |
net6 <- genMaybe genIp6Net |
246 | 247 |
gateway <- genMaybe arbitrary |
247 | 248 |
gateway6 <- genMaybe genIp6Addr |
248 |
res <- liftM Just (genBitString $ netmask2NumHosts netmask) |
|
249 |
ext_res <- liftM Just (genBitString $ netmask2NumHosts netmask) |
|
249 |
res <- liftM (Just . bitStringToB64String) |
|
250 |
(genBitString $ netmask2NumHosts netmask) |
|
251 |
ext_res <- liftM (Just . bitStringToB64String) |
|
252 |
(genBitString $ netmask2NumHosts netmask) |
|
250 | 253 |
uuid <- arbitrary |
251 | 254 |
ctime <- arbitrary |
252 | 255 |
mtime <- arbitrary |
Also available in: Unified diff