« Previous | Next » 

Revision 37696594

ID376965945edfee13f0ab4924a15ef699738144f1

Added by Dimitris Aragiorgis about 11 years ago

Update py_compat_networks test

Use renamed methods of network module and fix genValidNetwork.

In network module during _Validate we check whether gateway/network
pairs (both v4 and v6) are valid. Having a gateway without a network
is considered invalid.

Currently genValidNetwork generates random values for gateway/network
pairs which can also be Nothing. Since a gateway without a network
as long as a gateway outside the network are not valid we let gateways
(both v4 and v6) to Nothing. This is a quick-and-dirty solution to pass
py_compat_networks test.

Additionally, in _Validate we check that reservations and external
reservations are mutually exclusive (their binary AND is a zeroed bitstring).
To this end we cannot just create arbitrary bitstrings with ones and
zeroes. Introduce genZeroedBitString for the external reservations.

TODO: Make helper gen funtions to generate IPs inside a given network
(the result of getMaybe genIpNet). Introduce a helper function that
returns the binary NOT of a BitString.

Signed-off-by: Dimitris Aragiorgis <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences