Compare commits

...

9 Commits

Author SHA1 Message Date
spiritlhl
653cd75a97 fix: 修复内存测试在无root环境下测试的权限问题,添加无权限的内存测试方法mbw 2025-06-30 13:32:20 +00:00
github-actions[bot]
ea36e88c9f chore: update ECS_VERSION to 0.1.43 in goecs.sh 2025-06-29 08:49:03 +00:00
spiritlhl
c81ebb3c7a fix: 异步函数传值需要指针传递,值传递可能会出现同步问题 2025-06-29 08:45:15 +00:00
github-actions[bot]
7896b3ead5 chore: update ECS_VERSION to 0.1.42 in goecs.sh 2025-06-29 08:33:10 +00:00
spiritlhl
eb98a7b857 fix: 更加严格的启动条件,同时避免死锁等待 2025-06-29 08:29:24 +00:00
github-actions[bot]
d4d86229de chore: update ECS_VERSION to 0.1.41 in goecs.sh 2025-06-29 07:59:30 +00:00
spiritlhl
651a183382 fix: 修复版本号 2025-06-29 15:55:56 +08:00
spiritlhl
afc313a2a8 fix: 同步流媒体检测的判断逻辑 2025-06-29 15:44:16 +08:00
github-actions[bot]
39ac8d198d chore: update ECS_VERSION to 0.1.40 in goecs.sh 2025-06-29 07:36:33 +00:00
4 changed files with 22 additions and 25 deletions

3
go.mod
View File

@@ -14,7 +14,7 @@ require (
github.com/oneclickvirt/defaultset v0.0.2-20240624082446
github.com/oneclickvirt/disktest v0.0.8-20250425015826
github.com/oneclickvirt/gostun v0.0.3-20250329105202
github.com/oneclickvirt/memorytest v0.0.5-20250406063420
github.com/oneclickvirt/memorytest v0.0.6-20250630132206
github.com/oneclickvirt/nt3 v0.0.5-20250416131047
github.com/oneclickvirt/pingtest v0.0.7-20250413051539
github.com/oneclickvirt/portchecker v0.0.3-20250329125750
@@ -63,6 +63,7 @@ require (
github.com/nxtrace/NTrace-core v1.4.0 // indirect
github.com/oneclickvirt/dd v0.0.1-20250406062523 // indirect
github.com/oneclickvirt/fio v0.0.1-20250406060851 // indirect
github.com/oneclickvirt/mbw v0.0.1-20250630131952 // indirect
github.com/onsi/ginkgo/v2 v2.22.1 // indirect
github.com/oschwald/maxminddb-golang v1.13.1 // indirect
github.com/pelletier/go-toml/v2 v2.2.4 // indirect

6
go.sum
View File

@@ -117,8 +117,10 @@ github.com/oneclickvirt/fio v0.0.1-20250406060851 h1:b7xHKpPmU4q0NmvigRCEr3tQuAV
github.com/oneclickvirt/fio v0.0.1-20250406060851/go.mod h1:NIq+XYTey68KNERGIy/oRDlzpwLzBVoHOCiqX8didsE=
github.com/oneclickvirt/gostun v0.0.3-20250329105202 h1:aJ6E91Lp94lq8iWRcCaxpXTjqOOaWvufr5oras6cFtM=
github.com/oneclickvirt/gostun v0.0.3-20250329105202/go.mod h1:f7DPEXAxbmwXSW33dbxtb0/KzqvOBWhTs2Or5xBerQA=
github.com/oneclickvirt/memorytest v0.0.5-20250406063420 h1:eHqpqFIx8Ss062uyNf7Ruv7FC4AdZbElR7u9vX2Oj3g=
github.com/oneclickvirt/memorytest v0.0.5-20250406063420/go.mod h1:HTd0sSxRjT4BcV8kcCh4fF2Nia0xgZNaVjhefsnypic=
github.com/oneclickvirt/mbw v0.0.1-20250630131952 h1:phszmnesjWVQ3urZlRWwzOlY3M4D44SpTaZy8iKNjT4=
github.com/oneclickvirt/mbw v0.0.1-20250630131952/go.mod h1:0Vq6NRpyLmGUdfHfL3uDcFsuZhi7KlG+OCs5ky2757Y=
github.com/oneclickvirt/memorytest v0.0.6-20250630132206 h1:e/iVzmFR3vDRGemeYP3bYgIIQUa/6fcV46NhJEddFmQ=
github.com/oneclickvirt/memorytest v0.0.6-20250630132206/go.mod h1:93xWD338G705rnnPV2KQ0glIL2ob11BoqMiraPe2dGo=
github.com/oneclickvirt/nt3 v0.0.5-20250416131047 h1:KL0xowq19cW+FMBGMJxdqpRNoeyR+eEmb+jYSubmlTk=
github.com/oneclickvirt/nt3 v0.0.5-20250416131047/go.mod h1:CVsDJEaIdyyZHn3WKbhU8Wn6GOfmBNvJlC/dDLRqcSQ=
github.com/oneclickvirt/pingtest v0.0.7-20250413051539 h1:mYOsEmMtwKr40hwM2NimVLpnbR2cjwuOh1c/9fQr2Dw=

View File

@@ -39,7 +39,7 @@ import (
)
var (
ecsVersion = "v0.1.40"
ecsVersion = "v0.1.44"
menuMode bool
onlyChinaTest bool
input, choice string
@@ -470,7 +470,7 @@ func runChineseTests(preCheck utils.NetCheckResult, wg1, wg2, wg3 *sync.WaitGrou
*emailInfo = email.EmailCheck()
}()
}
if utTestStatus && !onlyChinaTest && preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" {
if utTestStatus && preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" && !onlyChinaTest {
wg1.Add(1)
go func() {
defer wg1.Done()
@@ -478,12 +478,12 @@ func runChineseTests(preCheck utils.NetCheckResult, wg1, wg2, wg3 *sync.WaitGrou
}()
}
if preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" {
output = runStreamingTests(wg1, *mediaInfo, output, tempOutput, outputMutex)
output = runStreamingTests(wg1, mediaInfo, output, tempOutput, outputMutex)
output = runSecurityTests(*securityInfo, output, tempOutput, outputMutex)
output = runEmailTests(wg2, *emailInfo, output, tempOutput, outputMutex)
output = runEmailTests(wg2, emailInfo, output, tempOutput, outputMutex)
}
if runtime.GOOS != "windows" && preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" {
output = runNetworkTests(wg3, *ptInfo, output, tempOutput, outputMutex)
output = runNetworkTests(wg3, ptInfo, output, tempOutput, outputMutex)
}
if preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" {
output = runSpeedTests(output, tempOutput, outputMutex)
@@ -511,9 +511,9 @@ func runEnglishTests(preCheck utils.NetCheckResult, wg1, wg2 *sync.WaitGroup, ba
*emailInfo = email.EmailCheck()
}()
}
output = runStreamingTests(wg1, *mediaInfo, output, tempOutput, outputMutex)
output = runStreamingTests(wg1, mediaInfo, output, tempOutput, outputMutex) // 传递指针
output = runSecurityTests(*securityInfo, output, tempOutput, outputMutex)
output = runEmailTests(wg2, *emailInfo, output, tempOutput, outputMutex)
output = runEmailTests(wg2, emailInfo, output, tempOutput, outputMutex)
output = runEnglishSpeedTests(output, tempOutput, outputMutex)
}
return appendTimeInfo(output, tempOutput, startTime, outputMutex)
@@ -606,7 +606,7 @@ func runDiskTest(output, tempOutput string, outputMutex *sync.Mutex) string {
}, tempOutput, output)
}
func runStreamingTests(wg1 *sync.WaitGroup, mediaInfo string, output, tempOutput string, outputMutex *sync.Mutex) string {
func runStreamingTests(wg1 *sync.WaitGroup, mediaInfo *string, output, tempOutput string, outputMutex *sync.Mutex) string {
return utils.PrintAndCapture(func() {
if language == "zh" {
if commTestStatus && !onlyChinaTest {
@@ -621,9 +621,7 @@ func runStreamingTests(wg1 *sync.WaitGroup, mediaInfo string, output, tempOutput
} else {
utils.PrintCenteredTitle("Cross-Border-Streaming-Media-Unlock", width)
}
fmt.Printf("%s", mediaInfo)
} else {
wg1.Wait()
fmt.Printf("%s", *mediaInfo)
}
}, tempOutput, output)
}
@@ -641,7 +639,7 @@ func runSecurityTests(securityInfo, output, tempOutput string, outputMutex *sync
}, tempOutput, output)
}
func runEmailTests(wg2 *sync.WaitGroup, emailInfo string, output, tempOutput string, outputMutex *sync.Mutex) string {
func runEmailTests(wg2 *sync.WaitGroup, emailInfo *string, output, tempOutput string, outputMutex *sync.Mutex) string {
return utils.PrintAndCapture(func() {
if emailTestStatus {
wg2.Wait()
@@ -650,14 +648,12 @@ func runEmailTests(wg2 *sync.WaitGroup, emailInfo string, output, tempOutput str
} else {
utils.PrintCenteredTitle("Email-Port-Check", width)
}
fmt.Println(emailInfo)
} else {
wg2.Wait()
fmt.Println(*emailInfo)
}
}, tempOutput, output)
}
func runNetworkTests(wg3 *sync.WaitGroup, ptInfo string, output, tempOutput string, outputMutex *sync.Mutex) string {
func runNetworkTests(wg3 *sync.WaitGroup, ptInfo *string, output, tempOutput string, outputMutex *sync.Mutex) string {
output = utils.PrintAndCapture(func() {
if backtraceStatus && !onlyChinaTest {
utils.PrintCenteredTitle("三网回程线路检测", width)
@@ -678,9 +674,7 @@ func runNetworkTests(wg3 *sync.WaitGroup, ptInfo string, output, tempOutput stri
if onlyChinaTest || pingTestStatus {
wg3.Wait()
utils.PrintCenteredTitle("三网ICMP的PING值检测", width)
fmt.Println(ptInfo)
} else {
wg3.Wait()
fmt.Println(*ptInfo)
}
}, tempOutput, output)
}

View File

@@ -143,7 +143,7 @@ goecs_check() {
os=$(uname -s 2>/dev/null || echo "Unknown")
arch=$(uname -m 2>/dev/null || echo "Unknown")
check_china
ECS_VERSION="0.1.39"
ECS_VERSION="0.1.43"
for api in \
"https://api.github.com/repos/oneclickvirt/ecs/releases/latest" \
"https://githubapi.spiritlhl.workers.dev/repos/oneclickvirt/ecs/releases/latest" \
@@ -155,8 +155,8 @@ goecs_check() {
sleep 1
done
if [ -z "$ECS_VERSION" ]; then
_yellow "Unable to get version info, using default version 0.1.39"
ECS_VERSION="0.1.39"
_yellow "Unable to get version info, using default version 0.1.43"
ECS_VERSION="0.1.43"
fi
version_output=""
for cmd_path in "goecs" "./goecs" "/usr/bin/goecs" "/usr/local/bin/goecs"; do