access-engine/cmd/flex-auth/main_test.go
tegwick 0ced2995ee
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 2s
Build and Publish Container Image / build-and-push (push) Successful in 1m27s
FLEX-WP-0036: binary renamed to access-engine; flex-auth is a stub naming the rename (FLEX-DEC-2026-020)
- cmd/flex-auth -> cmd/access-engine; usage and serving lines say access-engine
- cmd/flex-auth: prints the rename and exits 2, with a test
- image: entrypoint /usr/local/bin/access-engine, flex-auth stub alongside;
  live pins pass only args, so their next roll is unaffected
- Makefile, CI, verify-posture, tenancy.yaml, live docs updated; workplans,
  decisions and ADRs left as written
- runtime names (module, audience, k8s, image package, /opt paths) unchanged

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Assistant: claude-code
Assistant-Model: opus
Assistant-Process: 735967@bnt-lap001
Assistant-Session: 5971967f-77f8-4ced-9e02-c6ef67040ffc
2026-10-10 13:26:19 +02:00

26 lines
691 B
Go

package main
import (
"os"
"os/exec"
"strings"
"testing"
)
// The retired binary must fail and name its replacement, whatever it is asked.
func TestRetiredBinaryNamesReplacement(t *testing.T) {
if os.Getenv("FLEX_AUTH_STUB_CHILD") == "1" {
main()
return
}
cmd := exec.Command(os.Args[0], "-test.run=TestRetiredBinaryNamesReplacement", "serve", "--addr", "x")
cmd.Env = append(os.Environ(), "FLEX_AUTH_STUB_CHILD=1")
out, err := cmd.CombinedOutput()
exit, ok := err.(*exec.ExitError)
if !ok || exit.ExitCode() != 2 {
t.Fatalf("want exit 2, got %v", err)
}
if !strings.Contains(string(out), "renamed to access-engine") {
t.Fatalf("missing rename message: %s", out)
}
}