Über Open CoDE Software Wiki Diskussionen GitLab

Skip to content

initial testing framework

Rainer Molitor requested to merge test-automation-python into dev

Closes #8 (closed)

This MR adds a Testframework which works as follows: It adds a python linting for the python files in the repository to catch some bad writing behaviors. It adds a test.py script, which does the following

it runs through policy-spec and for each policy it imports it to a running ACS instance after importing, it creates the test-ressources which are defined in the richtlinien project on a managed cluster of this ACS. Afterwards it checks if the "good" tests DO NOT create a Violation and the "bad" tests do create a Violation. It also does some validity checks on the metadata of the policies.

In the end the results are printed as a json and a table.

The test.py currently has some hardcoded exceptions for 4 policies. for 3 of them there is currently no check in richtlinien project (policy-entwicklung#57). the last one needed to be implemented with two different policies in stackrox. We need to find a way for this how to validate which tests this triggers and whichs not. or if we can deploy both of them simultaniously.

But this testing is better than none even if it does not provide 100% testcoverage.

Edited by Steffen Lützenkirchen

Merge request reports

Loading