1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-06-12 02:51:31 +09:00

nixos/tests/test-driver: better control test env symbols

Previous to this commit, the entire test driver environment was shared
with the actual python test environment.

This is a hefty api surface. This commit selectively exposes only those
symbols to the test environment that are actually meant to be used by
tests.
This commit is contained in:
David Arnold 2021-06-06 13:50:02 -05:00 committed by David Arnold
parent 5edf5b60c3
commit db614e11d6
No known key found for this signature in database
GPG key ID: AB15A6AF1101390D
2 changed files with 45 additions and 16 deletions

View file

@ -42,7 +42,9 @@ rec {
python <<EOF
from pydoc import importfile
with open('driver-symbols', 'w') as fp:
fp.write(','.join(dir(importfile('${testDriverScript}'))))
t = importfile('${testDriverScript}')
test_symbols = t._test_symbols()
fp.write(','.join(test_symbols.keys()))
EOF
'';