refactor(backend): rename OpenFlare directory to lowercase openflare

This commit is contained in:
ryan
2026-08-30 17:43:23 +08:00
parent 06d5fedbfc
commit c93ff6674f
543 changed files with 819 additions and 819 deletions
@@ -0,0 +1,47 @@
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
package nginx
import (
"path/filepath"
"testing"
lua "github.com/yuin/gopher-lua"
)
func TestWAFRuntime(t *testing.T) {
state := lua.NewState()
defer state.Close()
runtimePath, err := filepath.Abs("waf_runtime.lua")
if err != nil {
t.Fatal(err)
}
specPath, err := filepath.Abs("waf_runtime_spec.lua")
if err != nil {
t.Fatal(err)
}
state.SetGlobal("WAF_RUNTIME_PATH", lua.LString(runtimePath))
if err := state.DoFile(specPath); err != nil {
t.Fatalf("WAF runtime specification failed: %v", err)
}
}
func TestWAFIPGroupRefresh(t *testing.T) {
state := lua.NewState()
defer state.Close()
modulePath, err := filepath.Abs("waf_ip_groups.lua")
if err != nil {
t.Fatal(err)
}
specPath, err := filepath.Abs("waf_ip_groups_spec.lua")
if err != nil {
t.Fatal(err)
}
state.SetGlobal("WAF_IP_GROUPS_PATH", lua.LString(modulePath))
if err := state.DoFile(specPath); err != nil {
t.Fatalf("WAF IP group refresh specification failed: %v", err)
}
}