VOLTTRON / volttron

VOLTTRON Distributed Control System Platform
https://volttron.readthedocs.io/
Other
452 stars 217 forks source link

Test suite does not correctly test non auth mode #3102

Open schandrika opened 10 months ago

schandrika commented 10 months ago

platformwrapper and volttron_platform_fixtures are used by all integration tests in volttron. These set up the volttron environment and instance. Both need to be fixed for testing volttron server in non auth mode. i.e. when authentication and authorization is disabled.

Issues:

  1. volttron_platform_fixture uses pytest's request.param.pop() method to get value of variables that are parameterized for a fixture. This however does not correctly return the value set for the boolean variable, auth_enabled. When auth_enabled is set to False, request.param.pop('auth_enabled', True) always returns True. This would lead all tests to always run with auth_enabled=True. pytest's request.param is a object that acts similar to python's dictionary object, however the pop method doesn't return value similar to that of a dictionary object. Fix - use request.param.get instead of request.param.pop

  2. platformwrapper generate keystore and server key even when auth is disabled.