NetworkManager/tools
Thomas Haller dd2da759de clients/tests: seed generated numbers for test-networkmanager-service.py
At several places, "test-networkmanager-service.py" uses generated numbers
with a defined seed. For example, generated connection's UUID is
generated in a predictable, but randomized way (if you forgive the
inprecise use of the word "random" in context of using a deterministic
seed).

Aside the connection's UUID, this becomes more interesting in the next commit
where the stub server generates a list of IP and DHCP settings in a predictable
randomized way.

For "clients/tests" we spawn the test service multiple times, but also
create similar environments by calling init_001(). This is done for
convenience, where out of lazyness all the tests share one setup. But it's
still a good idea that these tests generate slightly different setups,
wherever applicable. this increases the possible setups which get tested.
For example, the number of static IPv4 addresses (the following commit) is
interested to explicitly test for zero or a non-zero number of
addresses. If all tests happen to use the same seed, the tests are expected
to also generate the same number of addresses, and we miss an opportunity to
hit interesting test cases.

There is still no guarantee that all interesting cases are hit, the chances are just
better. The approach of generating the setup randomly, does not preclude that
the stub-server allows to explicitly configure the setup. However, due to the
sheer number of combinations that might be interesting to test, it's much simpler
to rely on some randomization and have the justifid hope we catch interesting cases.
Also in terms of runtime of the test, the cli unit tests should complete within
few seconds. Testing every combination would result in huge tests and long runtimes.

Also, the patch refactors generating random numbers in
"test-networkmanager-service.py". For example, it introduces
Util.RandomSeed(), which can be used to generate a sequence of different
random numbers. It works by having an internal state and a counter which is
combined to chain the seed and generate different numbers on each call.
2018-06-11 11:20:31 +02:00
..
check-exports.sh tools/check-exports.sh: use ${NM} when available 2015-09-24 16:28:15 +02:00
create-exports-NetworkManager.sh settings: drop unmaintained ifnet settings plugin of Gentoo 2017-12-21 10:50:33 +01:00
debug-helper.py python: make dbus, gi examples, and debug-helper.py python3 ready 2017-12-04 11:21:40 +01:00
enums-to-docbook.pl docs: fix handling enums without explicit numeric value in "tools/enums-to-docbook.pl" 2017-01-04 09:33:50 +01:00
run-nm-test.sh build: set LD_LIBRARY_PATH and GI_TYPELIB_PATH variables in run-nm-test.sh 2018-05-11 16:51:20 +02:00
test-build.sh tools: add test script to build various configurations 2016-11-24 15:59:27 +01:00
test-networkmanager-service.py clients/tests: seed generated numbers for test-networkmanager-service.py 2018-06-11 11:20:31 +02:00
test-sudo-wrapper.sh nmtst: add nmtst_reexec_sudo() function 2014-06-05 18:12:57 +02:00