补齐Nginx辅助服务安全初始化与部署模板

This commit is contained in:
xuans committed 2026-09-20 02:29:36 +08:00
1 parent aa5d669db1
commit d8b4850916
13 files changed
+593 -4

No files matched your search

@@ -1,6 +1,7 @@
package main
import (
"context"
"fmt"
"net"
"os"
@@ -11,6 +12,18 @@ import (
"testing"
)
func TestExecuteRejectsInvalidInitializationArguments(t *testing.T) {
for _, args := range [][]string{
{"--initialize"}, {"--initialize", "--certificate", "/no-certificate"},
{"--initialize", "--private-key", "/no-key"}, {"--certificate", "/no-certificate"},
{"--private-key", "/no-key"}, {"--policy", ""}, {"unexpected"},
} {
if err := execute(context.Background(), args); err == nil {
t.Fatalf("无效初始化参数被接受:%v", args)
}
}
}
func TestInheritedListener(t *testing.T) {
if mode := os.Getenv("SCERT_LISTENER_TEST_CHILD"); mode != "" {
os.Setenv("LISTEN_PID", strconv.Itoa(os.Getpid()))