oktetlabs / test-environment

OKTET Labs Test Environment
Other
5 stars 9 forks source link

TS-implemented Configurator subtrees #39

Open okt-galaktionov opened 6 months ago

okt-galaktionov commented 6 months ago

There are some parts of HW/SW configuration that are too vendor-specific to be implemented in the upstream TE Test Agent. Sometimes there is simply no standard way of enabling a given feature, so multiple implementations would need to coexist and some logic would be required to decide which implementation is to be used at a given moment in time. This would put a lot of complexity and maintenance burden on TE, especially considering that some of these settings are unlikely to be useful outside of a single test suite.

Another approach would be to develop a generic mechanism in the Test Agent that would allow test suites to provide their own implementations of specific Configurator object handlers. This way the test suite would be responsible for maintaining these handlers and get some flexibility of implementation as well.

What would be the best way to implement something like this?

ol-arteman commented 6 months ago

Actually, there is only one obstacle to implementing this. Currently, Configurator subtrees are initialized by explicitly calling a set of *_init functions from the Agent's main. This need not be the case, the initialization may be performed by ELF constructors, and here are two options:

In both cases, however, care must be taken to ensure that the builtin Configurator subtrees are still properly registered. Perhaps, the right way is to eliminate those explicit init calls altogether and use the same constructor-based initialization with TE-defined Configurator subtrees as well.

okt-kostik commented 1 week ago

Actually Oleg has implemented somewhat similar

We'll try to publish something.