mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-13 08:59:08 +02:00
Verify access decisions through real management and proxy containers, including upstream delivery and denial. Cover inherited auth, bypass/block, precedence, credential stripping, updates, restrictions, deletion, and private-service rejection. Validation: container E2E and scoped lint passed locally. The workflow builds both components from the checkout.
43 lines
915 B
Go
43 lines
915 B
Go
//go:build e2e
|
|
|
|
// Package reverseproxy contains container-based tests for public reverse-proxy
|
|
// services. A real combined management server is shared across package tests;
|
|
// each test owns and cleans up its proxy and service resources.
|
|
package reverseproxy
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"os"
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/netbirdio/netbird/e2e/harness"
|
|
)
|
|
|
|
var srv *harness.Combined
|
|
|
|
func TestMain(m *testing.M) {
|
|
os.Exit(run(m))
|
|
}
|
|
|
|
func run(m *testing.M) int {
|
|
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Minute)
|
|
defer cancel()
|
|
|
|
var err error
|
|
srv, err = harness.StartCombined(ctx)
|
|
if err != nil {
|
|
fmt.Fprintf(os.Stderr, "e2e: start combined server: %v\n", err)
|
|
return 1
|
|
}
|
|
defer func() { _ = srv.Terminate(context.Background()) }()
|
|
|
|
if _, err := srv.Bootstrap(ctx); err != nil {
|
|
fmt.Fprintf(os.Stderr, "e2e: bootstrap admin PAT: %v\n", err)
|
|
return 1
|
|
}
|
|
|
|
return m.Run()
|
|
}
|