Skip to content

Bring cts-lab audits back to life - #4164

Open
clumens wants to merge 25 commits into
ClusterLabs:mainfrom
clumens:cts-lab-audits
Open

Bring cts-lab audits back to life#4164
clumens wants to merge 25 commits into
ClusterLabs:mainfrom
clumens:cts-lab-audits

Conversation

@clumens

@clumens clumens commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

No description provided.

clumens added 25 commits August 13, 2026 13:27
These have been disabled due to nebulous long-ago refactorings since
2017, which is a doubly long time ago.  Let's re-enable them and see
what happens.
This uses `crm_node -e` to figure out what epoch a node joined the
cluster.  However, this option was removed by 55ab749 in 2017 and the
whole epoch concept doesn't even apply to a non-heartbeat cluster.  So,
this check can be removed.
I can't find any reference to this argument as far back as the latest
state of the 1.1 branch, which is where I stopped looking.
This may affect other attributes besides score.  This was introduced by
66f20f7.
These audits check if a resource is running in more than one place which
is always going to be the case in the split brain test.
This code was ssh'ing into each host, running cibadmin -Q, writing that
to a file, and then scp'ing that file back to a host.  There was also
some juggling around to handle the first host in the list differently.
It also didn't clean up the files it wrote.

This is all a little more complicated than it needs to be.  Instead, we
can just capture stdout from the ssh command and write that to a file on
the executor, diff things there, and clean up.
Sometimes, the CIBAudit test fails because different nodes have
cib-last-written timestamps that are different.  However, nothing else
in the CIB is different.  So, just remove the timestamp to remove the
possibility of any differences there.
I don't think they should be run more than once, certainly not things
like the PrimitiveAudit which runs at least once before any of the tests
run, and then runs during the tests as well.  But that's a bigger
problem to solve.

The problem here is that every time PrimitiveAudit (or its subclasses)
run, they append to various lists without first resetting them.  Over
time, this means that the same checks get run over and over again.  This
really drags down the tests.  So, just reset the lists.
The clean variable is unnecessary and makes this block kind of weird to
read, so just remove it.
* Move the have_systemd test into _find_core_with_coredumpctl so we have
  one less case to consider in the caller.

* Get rid of the unnecessary intermediate found variable.
This is just the same trick where we invert the test and continue,
allowing everything else to be unindented.
We don't need to loop through the nodes twice.
* Nothing uses the _trim2int function.

* Move the strip call into _trim_string to simplify callers.

* Simplify callers by making everything a single call instead of two.
This has been an empty list since a refactoring commit in 2005
(73281ce).
If the split fails with an exception, it's possible one or both members
of the tuple won't exist, in which case the logging message will also
raise an exception.  I don't think logging the tuple members is useful,
so just remove it.
We were querying each node in a partition to see if it had quorum, but
not doing anything with that information.  So, let's start testing it.
@clumens
clumens requested a review from nrwahl2 August 17, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant