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
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
'';