Schema validation involves the usual logging functions, configuration error handlers, and XML error handlers. We want validation messages to go to logs usually, but command-line tools that validate (crm_verify, crm_simulate, and cibadmin) should send messages to the format requested via --output-as (cibadmin doesn't support it yet, so it should show text output).
Ensure that there are cts-cli validity tests (existing or new) that trigger these error messages:
- pcmk__verify(): "outermost element", "manually update", and "schema validation" messages
- validate_with_relaxng(): trigger error in xmlRelaxNGParse() or xmlRelaxNGValidateDoc()
- pcmk__update_configured_schema(): "Cannot upgrade" (both paths) and "disabled" messages
- apply_transformation(): trigger error in xsltParseStylesheetFile() or xsltApplyStylesheet()
Each test input will need to be tested using cibadmin --upgrade --force (using CIB_file), cibadmin --upgrade --force -VVVV (to trigger the alternate behavior in cib_upgrade_err()), crm_simulate -Sx`, and crm_verify -x, using both --output-as=text and --output-as=xml for crm_simulate and crm_verify.
@clumens recently converted cts-cli to Python and can help with figuring out where these tests and inputs need to go