HomeClusterLabs Projects

Test: libcrmcommon: avoid test vs production discrepancy in schema unit testing

Description

Test: libcrmcommon: avoid test vs production discrepancy in schema unit testing

We have special logic in schemas.c for unit tests to get around the fact that
the test for pcmk__find_x_0_schema_index() previously didn't call
crm_schema_init() and thus didn't have the "pacemaker-next" and "none" schemas.

However it's a bad idea to have differences between unit tests and production,
and an even worse idea to change functional behavior for a single test that
would fail if called by the unit test for any other function.

Restructure the pcmk__find_x_0_schema_index() test so it calls
crm_schema_init(). This requires moving RNG files around, so create a unique
schema directory for this unit test, to avoid conflicting with other tests run
in parallel.

Details

Provenance
kgaillotAuthored on Apr 16 2024, 4:51 PM
Parents
rP2106847d1697: Test: libcrmcommon: add schema unit tests for pacemaker-next and none schemas
Branches
Unknown
Tags
Unknown