Skip to content

Add CI smoke tests for the addrate/authrate/modrate/searchrate tools#658

Open
vharseko wants to merge 2 commits into
OpenIdentityPlatform:masterfrom
vharseko:features/tools
Open

Add CI smoke tests for the addrate/authrate/modrate/searchrate tools#658
vharseko wants to merge 2 commits into
OpenIdentityPlatform:masterfrom
vharseko:features/tools

Conversation

@vharseko

Copy link
Copy Markdown
Member

Summary

Adds CI smoke tests for the four LDAP load-testing tools shipped in opendj-ldap-toolkitaddrate, authrate, modrate, and searchrate. These tools are built and packaged into the server distribution on every CI run but were never executed, so a regression in their launcher scripts, classpath, argument parsing, or connection handling could ship undetected.

What changed

Both the Test on Unix and Test on Windows steps in .github/workflows/build.yml now run each tool against the freshly set-up server, right after the existing 5000-user verification while the server is still online (LDAPS on port 1636, --trustAll):

Tool Operation exercised
searchrate Subtree search by random uid=user.N
authrate Direct binds as the sample users (userPassword=password)
modrate description replace on random users
addrate Add/delete with a small inline MakeLDIF template

addrate uses an inline, collision-free template (uid=addrate.N, no external resource files) with -C fifo delete + purge-on-exit, so the sample-user count is left unchanged for the steps that follow.

Design notes

  • Connection: LDAPS 1636 + --trustAll, matching the surrounding ldapsearch checks.
  • Concurrency: -c 4 -t 1 (multi-thread-per-connection mode would require --noRebind); authrate does not accept -t.
  • Termination: each run is bounded by -m 2000 so the tools exit deterministically.
  • Assertions: pass/fail by exit code. The Unix step relies on set -eo pipefail; the Windows step runs in PowerShell, so each command has an explicit $LASTEXITCODE check.

Testing

  • Validated the exact invocations against the packaged binaries: all four tools parse their arguments and addrate parses its template successfully (each reaches the connection stage).
  • Workflow YAML parses; the bash heredoc and PowerShell here-string template terminators were verified to land correctly after YAML de-indentation.
  • Full end-to-end execution is covered by CI (matrix: ubuntu / macos / windows × JDK 11, 17, 21, 25, 26).

The four LDAP load-testing tools shipped in opendj-ldap-toolkit are built
and packaged on every CI run but were never executed, so a regression in
their launcher scripts, classpath, or argument parsing could ship undetected.

Run each tool against the freshly set-up server (LDAPS 1636, --trustAll) in
the "Test on Unix" and "Test on Windows" steps, right after the existing
5000-user verification while the server is still online:

- searchrate: subtree search by random uid=user.N
- authrate:   direct binds as the sample users (userPassword=password)
- modrate:    description replace on random users
- addrate:    add/delete with a small inline MakeLDIF template
              (collision-free uid=addrate.N, FIFO delete + purge on exit
              so the sample-user count is preserved)

Concurrency is via -c connections with -t 1 (multi-thread mode would require
--noRebind); authrate takes no -t. Pass/fail is by exit code: Unix relies on
set -eo pipefail, Windows adds explicit $LASTEXITCODE checks since the step
runs in PowerShell.
…output in CI

The searchrate/authrate/modrate/addrate .bat launchers delegated to
_client-script.bat via "call ... %*". CALL performs an extra percent-expansion
pass that strips the lone '%' from a Java format token, so on Windows "%d" was
turned into "d" before reaching the JVM. As a result the rate tools received
"uid=user.d" instead of a generated number: every bind/modify failed, searches
matched nothing, and modrate ran unbounded until the runner exhausted its
ephemeral ports ("Connect Error: Address already in use"). Chain to
_client-script.bat without CALL so "%*" is expanded only once and "%d" reaches
the tool intact. Only the four rate tools are affected (they are the only ones
passing Java format strings via -g); the shared launcher is untouched.

CI rate-tool smoke tests (.github/workflows/build.yml):
- drop -S so all four tools print the bordered table instead of CSV;
- use a plain "%d" on both Unix and Windows (the launcher fix removes the need
  for the fragile "%%d" escaping);
- remove the spaces from the modrate modification string so the trailing
  argument survives batch re-parsing;
- print an echo / Write-Host label before each tool so the log clearly
  delimits each block.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants