mirror of
https://github.com/gazer-x/komari.git
synced 2026-06-22 00:05:52 +08:00
22 lines
399 B
Go
22 lines
399 B
Go
package cloudflared_test
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/komari-monitor/komari/internal/cloudflared"
|
|
)
|
|
|
|
func TestRunCloudflared(t *testing.T) {
|
|
os.Setenv("KOMARI_CLOUDFLARED_TOKEN", "test-token")
|
|
|
|
err := cloudflared.RunCloudflared()
|
|
if err != nil {
|
|
t.Fatalf("RunCloudflared failed: %v", err)
|
|
}
|
|
|
|
// 等待一段时间,确保子进程已启动
|
|
time.Sleep(2 * time.Second)
|
|
}
|