Ihar Hrachyshka wrote:
In Neutron, we have a need to allocate random but unique addresses and
such. For that matter, we have a concept of exclusive resources:
that are relying on locks and shared file based resource allocation
storage. This is used in fullstack tests where all allocation is limited
to a single node.
Another place where we randomize addresses is in our NeutronObject tests
where we just want to generate values good enough to pass
oslo.versionedobjects fields constraints:
We have some hacks there to guarantee uniqueness where may be needed
(f.e. in case of lists of ip networks), but otherwise it’s just random
addresses. It’s good enough for unit tests because each test has its own
testing environment isolated from others.
Ok good/interesting to know, if a test fails and someone wants to
reproduce it 'at home' what's the recommended way to do that if these
are all randomized (and the source of the failure say is in one of these
randomized data 'using' tests)
Do you output the random number gen seed (this seems like it would work,
although a little PITA) so that people can use the same initially seed
(and then get the same random numbers as a result)?
OpenStack Development Mailing List (not for usage questions)