tools/cubec: fix CLI so ./check stress works; separate client flags from command

cubec forwarded its OWN leading options (--socket/--tenant/...) verbatim
into the command payload sent to the daemon, so 'cubec --socket SOCK
"prog ..."' made the server reject '--socket' as an unknown command.
stress.sh therefore produced 'error: unknown command: --socket' on every
sample and measured nothing.

Split cubec arg parsing into client-option vs command-payload so flags are
consumed locally and only the command reaches the daemon. The canonical
'./check stress' stage now drives a real daemon and samples stats.
This commit is contained in:
CUBELinux-2
2026-08-11 18:33:28 -04:00
parent ec84fbc725
commit 4ab938fde8
2 changed files with 67 additions and 19 deletions
+3
View File
@@ -47,6 +47,9 @@ PAIRS=0
SAMPLE_EVERY=25 # sample stats every 25 pairs (~ once a second at load)
while [ "$(date +%s)" -lt "$END" ]; do
X=$((PAIRS % 256))
# Flags MUST precede the command: `cubec` parses --socket/--tenant as leading
# options, so `"$CLI" --socket SOCK "prog ..."` would turn the trailing
# --socket into an unknown subcommand. Pass flags first.
"$CLI" --socket "$SOCK" "prog /c077/z001/y001/x$X const $((PAIRS % 97)) halt" >/dev/null 2>&1
"$CLI" --socket "$SOCK" "run /c077/z001/y001/x$X" >/dev/null 2>&1
PAIRS=$((PAIRS + 1))