Problems in cmd line argument parsing when importing test template modules
When importing test template modules inside of an ooniprobe nettest (that means doing from ooni.template.httpt import HTTPTest) command line argument parsing will not work as expected.
The problem lies in the fact that inside of runner.py if a certain test isTestCase
(that is it's a subclass of NetTest) we will call processTest on it. processTest
will do command line argument parsing and since that object does not have the proper usageOptions set it will fail to parse the command line arguments of the actual test.
The quick and easy workaround it to simply not import the test class directly, but just import the module (that means doing from ooni.template import httpt
).
The long term solution probably involves finding a way to distinguish a test template from a subclass of it.