Revision 37696594

b/test/hs/Test/Ganeti/Objects.hs
170 170
  mac_prefix <- genMaybe genName
171 171
  net <- genIp4NetWithNetmask netmask
172 172
  net6 <- genMaybe genIp6Net
173
  gateway <- genMaybe genIp4AddrStr
174
  gateway6 <- genMaybe genIp6Addr
173
  -- gateway <- genMaybe genIp4AddrStr
174
  -- gateway6 <- genMaybe genIp6Addr
175
  let gateway = Nothing
176
  let gateway6 = Nothing
175 177
  res <- liftM Just (genBitString $ netmask2NumHosts netmask)
176
  ext_res <- liftM Just (genBitString $ netmask2NumHosts netmask)
178
  ext_res <- liftM Just (genZeroedBitString $ netmask2NumHosts netmask)
177 179
  let n = Network name mac_prefix net net6 gateway
178 180
          gateway6 res ext_res 0 Set.empty
179 181
  return n
......
182 184
genBitString :: Int -> Gen String
183 185
genBitString len = vectorOf len (elements "01")
184 186

  
187
-- | Generate an arbitrary string consisting of '0' and '1' of the given length.
188
genZeroedBitString :: Int -> Gen String
189
genZeroedBitString len = vectorOf len (elements "0")
190

  
185 191
-- | Generate an arbitrary string consisting of '0' and '1' of the maximum given
186 192
-- length.
187 193
genBitStringMaxLen :: Int -> Gen String
......
281 287
              \encoded = []\n\
282 288
              \for net in decoded:\n\
283 289
              \  a = network.AddressPool(net)\n\
284
              \  encoded.append((a.GetFreeCount(), a.GetReservedCount(), \\\n\
290
              \  encoded.append((a._GetFreeCount(), a._GetReservedCount(), \\\n\
285 291
              \    net.ToDict()))\n\
286 292
              \print serializer.Dump(encoded)" serialized
287 293
    >>= checkPythonResult

Also available in: Unified diff