HomeClusterLabs Projects

Fix: cts-cli: Make output independent of test selection and order

Description

Fix: cts-cli: Make output independent of test selection and order

Currently, some two test functions enable PCMK_stderr and export certain
values for PCMK_trace_functions. Since these environment variables
affect all tests run after they're set, the cts-cli output depends on
(a) which tests are run and (b) the order in which they're run.

Here, we export PCMK_stderr=1 during initialization so that we log
to stderr for all tests. We also save the initial value before setting
PCMK_trace_functions, and then we restore the initial value when we're
finished with a test group that changed it. Currently the initial value
is always the empty string, but that could change.

Finally, we set trace function values for the upgrade test as well. It's
been inheriting the validity test group's trace functions, but that's
once again an ordering dependency that we want to eliminate.

We lose a bit of ACL tracing during one test: "Upgrade to latest CIB
schema." It seems that tracing never should have been present, as it was
only intended for the test_acl_loop() function. It's trivial to restore
it if we ever want to.

Closes T548

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Sep 4 2022, 9:17 PM
Parents
rP5c0034b7694b: Fix: cts-cli: Ensure only stdout gets validated against schema
Branches
Unknown
Tags
Unknown
Tasks
Restricted Maniphest Task