diff --git a/README.md b/README.md index 42047a289..9071d8343 100644 --- a/README.md +++ b/README.md @@ -109,15 +109,19 @@ only the phase the rule is defined for. ## E2E Testing -[`Http/e2e/`](./http/e2e) provides an utility to run e2e tests. +[`http/e2e/`](./http/e2e) provides an utility to run e2e tests. It can be used standalone against your own waf deployment: + ```shell go run github.com/corazawaf/coraza/http/e2e@main --proxy-hostport localhost:8080 --httpbin-hostport localhost:8081 ``` + or as a library by importing: + ```go "github.com/corazawaf/coraza/v3/http/e2e/pkg" ``` + As a reference for library usage, see [`testing/e2e/e2e_test.go`](.testing/e2e/e2e_test.go). Expected directives that have to be loaded and available flags can be found in [`http/e2e/main.go`](./examples/http/e2e/main.go). diff --git a/http/e2e/main.go b/http/e2e/cmd/httpe2e/main.go similarity index 97% rename from http/e2e/main.go rename to http/e2e/cmd/httpe2e/main.go index c3f84c069..7aa027291 100644 --- a/http/e2e/main.go +++ b/http/e2e/cmd/httpe2e/main.go @@ -8,7 +8,7 @@ import ( "fmt" "os" - e2e "github.com/corazawaf/coraza/v3/http/e2e/pkg" + "github.com/corazawaf/coraza/v3/http/e2e" ) // Flags: diff --git a/http/e2e/pkg/runner.go b/http/e2e/e2e.go similarity index 100% rename from http/e2e/pkg/runner.go rename to http/e2e/e2e.go diff --git a/testing/e2e/e2e_test.go b/testing/e2e/e2e_test.go index 08fbd0999..6e698cf16 100644 --- a/testing/e2e/e2e_test.go +++ b/testing/e2e/e2e_test.go @@ -15,7 +15,7 @@ import ( "github.com/corazawaf/coraza/v3" txhttp "github.com/corazawaf/coraza/v3/http" - e2e "github.com/corazawaf/coraza/v3/http/e2e/pkg" + "github.com/corazawaf/coraza/v3/http/e2e" "github.com/mccutchen/go-httpbin/v2/httpbin" )