mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
nixos/test/test-driver: Class-ify the test driver
This commit encapsulates the involved domain into classes and defines explicit and typed arguments where untyped dicts where used. It preserves backwards compatibility through legacy wrappers.
This commit is contained in:
parent
3069ba0dd1
commit
b0fc9da879
3 changed files with 531 additions and 311 deletions
|
@ -43,7 +43,8 @@ rec {
|
|||
from pydoc import importfile
|
||||
with open('driver-symbols', 'w') as fp:
|
||||
t = importfile('${testDriverScript}')
|
||||
test_symbols = t._test_symbols()
|
||||
d = t.Driver([],[],"")
|
||||
test_symbols = d.test_symbols()
|
||||
fp.write(','.join(test_symbols.keys()))
|
||||
EOF
|
||||
'';
|
||||
|
@ -188,14 +189,6 @@ rec {
|
|||
--set startScripts "''${vmStartScripts[*]}" \
|
||||
--set testScript "$out/test-script" \
|
||||
--set vlans '${toString vlans}'
|
||||
|
||||
${lib.optionalString (testScript == "") ''
|
||||
ln -s ${testDriver}/bin/nixos-test-driver $out/bin/nixos-run-vms
|
||||
wrapProgram $out/bin/nixos-run-vms \
|
||||
--set startScripts "''${vmStartScripts[*]}" \
|
||||
--set testScript "${pkgs.writeText "start-all" "start_all(); join_all();"}" \
|
||||
--set vlans '${toString vlans}'
|
||||
''}
|
||||
'');
|
||||
|
||||
# Make a full-blown test
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue