test(gateway): register with public keys the gateway can accept - #1090
Merged
Conversation
Collaborator
Author
|
All ten now pass, run individually against a release build of None of them turned out to have a second, unrelated reason to fail — the key length was the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Ten of the twenty-eight cases in
gateway/test-run/test_suite.shcannot pass. Every one ofthem registers a CVM with a hand-written placeholder public key, and every one of those keys
is the wrong length:
A WireGuard public key is 32 bytes, so 44 base64 characters. The thirteen placeholders in the
suite are 38 to 43:
bootnode12345678901234567890123456789=threenode12345678901234567890123456789=stresstest%02d12345678901234567890123456=partition%02d123456789012345678901234567=backup123456789012345678901234567890123=persist%02d123456789012345678901234567890=upnode…,uptest…prpctest…,waltest%02d…,downtest…,downnode…persisttest1234567890123456789012345678901=They were fine until registration started validating the key length
(
WG_PUBLIC_KEY_B64_LENingateway/src/kv/import.rs, added with the recovery-API reviewfollow-ups). The suite is not in CI — CI runs
test_proxy.sh— so nothing said so.The cases this silences are the ones that cover persistence and replication most directly:
test_wal_integrity,test_periodic_persistence,test_client_registration_persistence,test_stress_writes,test_network_partition,test_three_node_cluster,test_three_node_bootnode,test_prpc_register, and both node-status registration cases.test_periodic_persistencenever reaches its persistence assertion at all.Fix
Each placeholder becomes a call to
test_public_key, the generator the suite already has andthat the other five call sites already use. It emits a real 32-byte key, so the gateway
accepts it, and it is deterministic, so a failure is still reproducible. Seeds are distinct
per registration — two instances sharing a public key are refused as a conflict, which would
just be the same class of bug again.
The generator's doc comment now says why a placeholder is not a shortcut, so the next one
does not get written.
Verification
Before, on
next: 18 passed, 10 failed — the ten above.After, each previously-failing case run individually:
with the rest still running at the time of writing; I will update this if any of them turn
out to be failing for a second, unrelated reason.
shellcheck -S errorclean,bash -nclean. No production code is touched.