Skip to content

testsuite: authenticate spectest T1/T2 with libafpclient#3176

Open
rdmark wants to merge 5 commits into
mainfrom
rdmark-spectest-libafpclient
Open

testsuite: authenticate spectest T1/T2 with libafpclient#3176
rdmark wants to merge 5 commits into
mainfrom
rdmark-spectest-libafpclient

Conversation

@rdmark

@rdmark rdmark commented Jul 11, 2026

Copy link
Copy Markdown
Member

Replace afp_spectest’s single legacy-DSI connection model with explicit per-testset tier, backend, and precondition metadata. T1 and T2 now authenticate through libafpclient, while tests that depend on socket ownership, partial packets, malformed framing, or unusual session lifecycle remain on the legacy DSI backend as T3.

Add a libafpclient transport adapter behind the existing CONN/DSI test interface. The adapter establishes sessions with a selected UAM, dispatches the existing hand-built AFP payloads through libafpclient, queues replies for the legacy receive helpers, supports split DSI writes and large Read/ReadExt replies, and mirrors result codes and payloads into the buffers inspected by existing tests. Add a native libafpclient smoke path covering volume lookup, create/open, read/write, cleanup, and logout.

Teach the spectest registry to expose tier, backend, preconditions, and the reason for retaining legacy DSI in afp_spectest -l. Run contiguous backend groups with separate primary and secondary connections, allow -A to select libafpclient UAMs by short alias or protocol name, and keep T3 authentication fixed to Cleartxt Passwrd so encrypted-UAM runs can still transition to raw protocol coverage.

Split the partial-response deadlock cases out of FPRead into T3FPRead, rename the malformed-request and sleep/session suites to T3Error and T3FPzzz, and retain FPDisconnectOldSession as raw DSI. Remove obsolete FPGetUserInfo probes from no-access fixture setup so AFP 3.4 does not turn AFPERR_NOOP into a bogus directory ID.

Factor generic libafpclient initialization, discovery, connection, and teardown out of the login UAM tests and keep a logintest-specific wrapper around that shared support. Rename the cleartext selector to clrtxt and update the UAM documentation.

Update Meson dependencies, container entrypoints, documentation, and CI for the new backend model. Container test runners now build quoted argument vectors, accept AFP_SUBTEST and AFP_TESTSUITE_UAM, support very-verbose transport logging, fold readonly coverage into spectest, and distribute representative encrypted UAMs across the spectest jobs.

@rdmark
rdmark requested a review from andylemin as a code owner July 11, 2026 22:09
@augmentcode

augmentcode Bot commented Jul 11, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Refactors the AFP specification test runner to authenticate normal spectest tiers via Netatalk Client’s libafpclient, while preserving the legacy raw-DSI backend for wire/protocol-edge-case suites.

Changes:

  • Introduce explicit tier/backend/precondition metadata per spectest testset and extend afp_spectest -l output to show this classification.
  • Add a libafpclient transport adapter behind the existing CONN/DSI test interface, including reply queuing and handling of split DSI writes / large Read(ReadExt) replies.
  • Split raw framing, partial-response, malformed-request, and sleep/session-lifecycle suites into T3_* testsets and update names/messages accordingly.
  • Add a libafpclient smoke test path and a new -A UAM selector (with short aliases like clrtxt, dhx2, srp), while keeping T3 authentication fixed to cleartext for legacy DSI coverage.
  • Update Meson dependencies plus container entrypoints and CI to pass UAM/subtest selectors and enable very-verbose transport logging.

Notes: Readonly coverage is now run as a spectest subtest in CI; documentation/manpages are updated to describe the new backend model and UAM selection.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 4 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread test/testsuite/spectest.c Outdated
Comment thread test/testsuite/afpclient_libafpclient.c
Comment thread distrib/docker/entrypoint_netatalk.sh Outdated
Comment thread doc/manpages/man1/afp_uamtest.1.md Outdated
@rdmark
rdmark force-pushed the rdmark-spectest-libafpclient branch 2 times, most recently from 0111ca0 to 4eb1550 Compare July 11, 2026 22:24
Replace afp_spectest’s single legacy-DSI connection model with explicit per-testset tier, backend, and precondition metadata. T1 and T2 now authenticate through libafpclient, while tests that depend on socket ownership, partial packets, malformed framing, or unusual session lifecycle remain on the legacy DSI backend as T3.

Add a libafpclient transport adapter behind the existing CONN/DSI test interface. The adapter establishes sessions with a selected UAM, dispatches the existing hand-built AFP payloads through libafpclient, queues replies for the legacy receive helpers, supports split DSI writes and large Read/ReadExt replies, and mirrors result codes and payloads into the buffers inspected by existing tests. Add a native libafpclient smoke path covering volume lookup, create/open, read/write, cleanup, and logout.

Teach the spectest registry to expose tier, backend, preconditions, and the reason for retaining legacy DSI in afp_spectest -l. Run contiguous backend groups with separate primary and secondary connections, allow -A to select libafpclient UAMs by short alias or protocol name, and keep T3 authentication fixed to Cleartxt Passwrd so encrypted-UAM runs can still transition to raw protocol coverage.

Split the partial-response deadlock cases out of FPRead into T3FPRead, rename the malformed-request and sleep/session suites to T3Error and T3FPzzz, and retain FPDisconnectOldSession as raw DSI. Remove obsolete FPGetUserInfo probes from no-access fixture setup so AFP 3.4 does not turn AFPERR_NOOP into a bogus directory ID.

Factor generic libafpclient initialization, discovery, connection, and teardown out of the login UAM tests and keep a logintest-specific wrapper around that shared support. Rename the cleartext selector to clrtxt and update the UAM documentation.

Update Meson dependencies, container entrypoints, documentation, and CI for the new backend model. Container test runners now build quoted argument vectors, accept AFP_SUBTEST and AFP_TESTSUITE_UAM, support very-verbose transport logging, fold readonly coverage into spectest, and distribute representative encrypted UAMs across the spectest jobs.
@rdmark
rdmark force-pushed the rdmark-spectest-libafpclient branch from 4eb1550 to 3b4e855 Compare July 11, 2026 22:27
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

📊 Performance Dashboard

Commit: c8bb1c236a38c8906492b4184c66ff58aa45d975

🔥 Spectest (AFP 3.4) - FlameGraph

**Netatalk Code-time: ** · Runtime: · Stacks:

🔥 Click the preview to open the interactive flamegraph (zoom + search).

Flamegraph preview

🔝 Top 10 leaf functions
Function Samples

📈 Speedtest (AFP 3.4) - PerfGraph

Speedtest throughput

🔝 Peak throughput per operation
Operation Peak mean (MB/s)
Read 6241
Write 1410
Copy 2450
ServerCopy 3351

⏱️ Lantest (AFP 3.4) - LatencyGraph

Lantest latency

Avg total runtime: 8161 ms · Avg time per AFP op: 0.139 ms

🐢 All operations (avg runtime, in test order)
Test Avg (ms)
Writing one large file 42
Reading one large file 15
Creating 2000 files 2105
Writing 1024 bytes to 2000 files 261
Lock then unlock 2000 open forks 133
Stat, open, read 512 bytes, close 2000 files 610
Enumerate dir with 2000 files 4
Deleting 2000 files 1902
Byte-range lock/unlock 2000 ranges in one fork 143
Create directory tree with 1000 dirs 1009
Directory cache hits (20 dirs x 100 files) 82
Mixed cache operations (create/stat/enum/delete) on 1000 files 1541
Deep path traversal (20 levels x 100 walks) 81
Cache validation (2000 files x 3 lookups) 233

@andylemin

andylemin commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

@rdmark Wow, interesting to see the impact the netatalk-client library has on performance. I would suggest merging #3177 first and rebasing this so we can see better where the performance hits are coming from the most?

This also suggests we need a way to tell afp_speedtest, afp_lantest to use the legacy/direct or new library connect methods?

We will probably need a flamegraph for the client library too..

@rdmark

rdmark commented Jul 12, 2026

Copy link
Copy Markdown
Member Author

@andylemin interesting observation -- picking the transport backend dynamically is trivial to accomplish, will make it happen when I get to that stage

I'm leaning towards pulling this back to Draft for a while and prepare a new netatalk-client release with a handful of fixes that should make this cleaner and more portable

@andylemin

andylemin commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

I think its a great baseline to be able to compare between the two client methods, the performance dashboard's deltas are quite noticeable - 4 are 200-300% slower, whilst others are not that bad (maybe 50% worse). It shows nicely where the issues are. And the variance is very telling on the slowest ones..

This has been a really great way to test the client at scale rapidly! 🙂

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.

2 participants