mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-02-17 17:43:06 -05:00
fragattack: only import tests currently in the directory
This commit is contained in:
parent
edaf1abf56
commit
3c772c7df8
@ -1,8 +1,6 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
import glob, importlib
|
||||||
from fraginternals import *
|
from fraginternals import *
|
||||||
from tests_common import *
|
|
||||||
from tests_qca import *
|
|
||||||
from tests_attacks import *
|
|
||||||
|
|
||||||
#TODO: Check that modified drivers are used using debugfs
|
#TODO: Check that modified drivers are used using debugfs
|
||||||
#TODO: Check that atheros is using patched firmware using debugfs
|
#TODO: Check that atheros is using patched firmware using debugfs
|
||||||
@ -250,6 +248,15 @@ if __name__ == "__main__":
|
|||||||
else:
|
else:
|
||||||
options.inject_test_postauth = False
|
options.inject_test_postauth = False
|
||||||
|
|
||||||
|
# Dynamically import tests depending on their availability in the directory
|
||||||
|
for test in glob("tests_*.py"):
|
||||||
|
module = importlib.import_module(test[:-3])
|
||||||
|
globals().update(
|
||||||
|
{n: getattr(module, n) for n in module.__all__} if hasattr(module, '__all__')
|
||||||
|
else
|
||||||
|
{k: v for (k, v) in module.__dict__.items() if not k.startswith('_')
|
||||||
|
})
|
||||||
|
|
||||||
# Construct the test
|
# Construct the test
|
||||||
options.test = prepare_tests(options)
|
options.test = prepare_tests(options)
|
||||||
if options.test == None:
|
if options.test == None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user