From 4e68df3b933d8aca376f988f1ebf16087ea8e9fa Mon Sep 17 00:00:00 2001 From: Juan Pablo Tosso Date: Wed, 18 Jan 2023 22:04:55 -0300 Subject: [PATCH] rename caddyfile --- coraza_test.go | 12 ++++++------ test/Caddyfile | 19 ------------------- 2 files changed, 6 insertions(+), 25 deletions(-) delete mode 100644 test/Caddyfile diff --git a/coraza_test.go b/coraza_test.go index 19cbad7..5bd37bb 100644 --- a/coraza_test.go +++ b/coraza_test.go @@ -32,7 +32,7 @@ import ( const baseURL = "http://127.0.0.1:8080" func TestPlugin(t *testing.T) { - tester, err := newTester("test/caddyfile", t) + tester, err := newTester("test.init.config", t) if err != nil { t.Fatal(err) } @@ -46,7 +46,7 @@ func TestPlugin(t *testing.T) { func TestPluginReload(t *testing.T) { tester := caddytest.NewTester(t) - configFile := "test/caddyfile" + configFile := "test.init.config" configContent, err := ioutil.ReadFile(configFile) if err != nil { t.Fatalf("Failed to load configuration file %s: %s", configFile, err) @@ -62,7 +62,7 @@ func TestPluginReload(t *testing.T) { } func TestSimpleRule(t *testing.T) { - tester, err := newTester("test/caddyfile", t) + tester, err := newTester("test.init.config", t) if err != nil { t.Fatal(err) } @@ -83,7 +83,7 @@ func TestSimpleRule(t *testing.T) { } func TestPhase3Disruption(t *testing.T) { - tester, err := newTester("test/caddyfile", t) + tester, err := newTester("test.init.config", t) if err != nil { t.Fatal(err) } @@ -94,7 +94,7 @@ func TestPhase3Disruption(t *testing.T) { } func TestPostUrlEncoded(t *testing.T) { - tester, err := newTester("test/caddyfile", t) + tester, err := newTester("test.init.config", t) if err != nil { t.Fatal(err) } @@ -107,7 +107,7 @@ func TestPostUrlEncoded(t *testing.T) { } func TestPostMultipart(t *testing.T) { - tester, err := newTester("test/caddyfile", t) + tester, err := newTester("test.init.config", t) if err != nil { t.Fatal(err) } diff --git a/test/Caddyfile b/test/Caddyfile deleted file mode 100644 index 0902576..0000000 --- a/test/Caddyfile +++ /dev/null @@ -1,19 +0,0 @@ -{ - debug - auto_https off - order coraza_waf first -} - -:8080 { - coraza_waf { - directives ` - SecAction "id:149,pass,log, msg:'Some test msg',logdata:'logdata'" - SecRule REQUEST_URI "test5" "id:2, deny, log, phase:1,status:403" - SecRule REQUEST_URI "test6" "id:4, deny, log, phase:3,status:403" - ` - include test/sample1.conf - include test/sample2.conf - } - header * x-request-id "{http.transaction_id}" - respond "test123" -} \ No newline at end of file