Skip to content

wireguard: add controller-side connectivity test#2893

Merged
berendt merged 3 commits into
mainfrom
wireguard-wireproxy-test
May 26, 2026
Merged

wireguard: add controller-side connectivity test#2893
berendt merged 3 commits into
mainfrom
wireguard-wireproxy-test

Conversation

@ideaship

Copy link
Copy Markdown
Contributor

Adds a controller-side WireGuard connectivity test that runs without
root or a kernel tunnel. wireproxy brings up a SOCKS5 listener using
the downloaded client config; the test probes Keystone through it and
tears down on exit.

Changes

  • scripts/test-wireguard.sh — new script using wireproxy
  • terraform/MakefileWIREPROXY variable, test-wireguard target
  • Makefile — top-level test-wireguard target
  • playbooks/pre.yml — installs wireproxy from a pinned GitHub release (same pattern as tofu, Renovate-managed)
  • playbooks/deploy.yml — runs make test-wireguard from the controller after manager-side checks

Dependency

Requires osism/ansible-collection-services#2086 (WireGuard role: enable
ip_forward and MASQUERADE). The test will fail without that fix because
forwarded packets are dropped by Neutron anti-spoofing.

Test plan

🤖 Generated with Claude Code

ideaship added 3 commits May 22, 2026 21:02
Adds a controller-side check that verifies the WireGuard gateway is
forwarding traffic correctly after deployment.  The test uses
wireproxy (userspace WireGuard) to bring up a SOCKS5 listener without
root or a kernel tunnel, probes Keystone through it, and tears down
on exit.

The WireGuard client config downloaded by vpn-wireguard-config is
converted to wireproxy format inline: MTU and DNS lines are stripped
(wg-quick-specific), bare Address entries get a /32 prefix, and a
[Socks5] section is appended.

pre.yml installs wireproxy from a pinned GitHub release alongside
tofu, using the same unarchive pattern and a Renovate annotation for
automatic version updates.  deploy.yml runs make test-wireguard from
the controller after the manager-side checks pass.

The WIREPROXY Makefile variable defaults to wireproxy in PATH and can
be overridden for local runs (e.g. WIREPROXY=~/wireproxy).

AI-assisted: Claude Code
Signed-off-by: Roger Luethi <luethi@osism.tech>
In CI, tofu lives at ~/tofu and is not in PATH.  The test-wireguard
target triggers init (a PHONY dependency) which calls $(TERRAFORM);
without an explicit override it falls back to "tofu" and fails.
Pass TERRAFORM={{ terraform_binary }} the same way the create
infrastructure tasks do.

AI-assisted: Claude Code
Signed-off-by: Roger Luethi <luethi@osism.tech>
If wireproxy exits before the SOCKS5 port becomes ready (e.g. port
already in use, bad config), the readiness loop previously spun for
10 s before a confusing curl failure.  Check liveness of wireproxy_pid
on each iteration so the error surfaces immediately.

AI-assisted: Claude Code
Signed-off-by: Roger Luethi <luethi@osism.tech>
@ideaship ideaship requested a review from berendt May 22, 2026 19:27
@ideaship ideaship marked this pull request as ready for review May 22, 2026 19:27
@ideaship ideaship moved this from Ready to In review in Human Board May 24, 2026
@berendt berendt merged commit b96944f into main May 26, 2026
3 checks passed
@berendt berendt deleted the wireguard-wireproxy-test branch May 26, 2026 16:23
@github-project-automation github-project-automation Bot moved this from In review to Done in Human Board May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants