Compare commits

...

6 Commits

12 changed files with 88 additions and 61 deletions

View File

@@ -4,7 +4,9 @@
[![Hits](https://hits.spiritlhl.net/goecs.svg?action=hit&title=Hits&title_bg=%23555555&count_bg=%230eecf8&edge_flat=false)](https://hits.spiritlhl.net)
融合怪测评项目 - GO版本 - (除环境安装使用shell外无额外shell文件依赖)
融合怪测评项目 - GO版本
(环境安装[非必须]使用shell外无额外shell文件依赖环境安装只是为了测的更准极端情况下无环境依赖安装也可全测项目)
如有问题请 [issues](https://github.com/oneclickvirt/ecs/issues) 反馈。
@@ -24,15 +26,15 @@ Shell 版本:[https://github.com/spiritLHLS/ecs](https://github.com/spiritLHLS
### **编译与测试支持情况**
| 编译支持的架构 | 测试支持的架构 | 编译支持的系统 | 测试支持的系统 |
|---------------------------|-----------|------------------------------|-----------|
| amd64 | amd64 | Linux | Linux |
| arm | arm | Windows | Windows |
| arm64 | arm64 | FreeBSD | FreeBSD |
| 386 | 386 | | |
| mips | | MacOS | |
| mipsle | | | |
| s390x | s390x | | |
| riscv64 | | | |
|---------------------------|-----------|---------|-----------|
| amd64 | amd64 | Linux | Linux |
| arm | arm | Windows | Windows |
| arm64 | arm64 | FreeBSD | FreeBSD |
| 386 | 386 | OpenBSD | |
| mips | | MacOS | |
| mipsle | | | |
| s390x | s390x | | |
| riscv64 | | | |
> 更多架构与系统请自行测试,如有问题请开 issues。

View File

@@ -4,7 +4,9 @@
[![Hits](https://hits.spiritlhl.net/goecs.svg?action=hit&title=Hits&title_bg=%23555555&count_bg=%230eecf8&edge_flat=false)](https://hits.spiritlhl.net)
Fusion Monster Evaluation Project - GO Version - (No additional shell file dependencies other than the environment installation shell)
Fusion Monster Evaluation Project - GO Version
(No additional shell file dependencies unless necessary to install the environment using the shell, the environment is installed just to measure more accurately, in extreme cases no environment dependencies can also be fully measured project)
Please report any issues via [issues](https://github.com/oneclickvirt/ecs/issues).
@@ -28,7 +30,7 @@ Shell version: [https://github.com/spiritLHLS/ecs/blob/main/README_EN.md](https:
| amd64 | amd64 | Linux | Linux |
| arm | arm | Windows | Windows |
| arm64 | arm64 | FreeBSD | FreeBSD |
| 386 | 386 | | |
| 386 | 386 | OpenBSD | |
| mips | | MacOS | |
| mipsle | | | |
| s390x | s390x | | |

View File

@@ -4,6 +4,6 @@ import (
"github.com/oneclickvirt/backtrace/bk"
)
func BackTrace() {
backtrace.BackTrace()
func BackTrace(enableIpv6 bool) {
backtrace.BackTrace(enableIpv6)
}

View File

@@ -15,6 +15,7 @@ import (
// }
//}
// 本包仅测试,无实际使用
func TestBackTrace(t *testing.T) {
BackTrace()
BackTrace(false)
}

View File

@@ -4,6 +4,7 @@ import (
"testing"
)
// 本包仅测试无实际使用
func TestMedia(t *testing.T) {
ComMediaTest("zh")
}

View File

@@ -3,6 +3,7 @@ package ntrace
import "testing"
// https://github.com/nxtrace/NTrace-core/blob/main/fast_trace/fast_trace.go
// 本包仅测试无实际使用
func TestTraceRoute(t *testing.T) {
TraceRoute3("en", "GZ", "ipv4")
}

12
go.mod
View File

@@ -3,16 +3,16 @@ module github.com/oneclickvirt/ecs
go 1.23.4
require (
github.com/imroc/req/v3 v3.49.0
github.com/imroc/req/v3 v3.50.0
github.com/oneclickvirt/CommonMediaTests v0.0.4-20250329123841
github.com/oneclickvirt/UnlockTests v0.0.26-20250329125926
github.com/oneclickvirt/backtrace v0.0.4-20250329130043
github.com/oneclickvirt/backtrace v0.0.5-20250411152044
github.com/oneclickvirt/basics v0.0.11-20250404123515
github.com/oneclickvirt/cputest v0.0.10-20250404151448
github.com/oneclickvirt/defaultset v0.0.2-20240624082446
github.com/oneclickvirt/disktest v0.0.7-20250404150324
github.com/oneclickvirt/disktest v0.0.7-20250406062845
github.com/oneclickvirt/gostun v0.0.3-20250329105202
github.com/oneclickvirt/memorytest v0.0.5-20250404130028
github.com/oneclickvirt/memorytest v0.0.5-20250406063420
github.com/oneclickvirt/nt3 v0.0.4-20250329125813
github.com/oneclickvirt/pingtest v0.0.6-20250329130728
github.com/oneclickvirt/portchecker v0.0.3-20250329125750
@@ -61,8 +61,8 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/nxtrace/NTrace-core v1.3.7 // indirect
github.com/oneclickvirt/dd v0.0.1-20250404124549 // indirect
github.com/oneclickvirt/fio v0.0.1-20250404141714 // indirect
github.com/oneclickvirt/dd v0.0.1-20250406062523 // indirect
github.com/oneclickvirt/fio v0.0.1-20250406060851 // 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.3 // indirect

24
go.sum
View File

@@ -50,8 +50,8 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/huin/goupnp v1.2.0 h1:uOKW26NG1hsSSbXIZ1IR7XP9Gjd1U8pnLaCMgntmkmY=
github.com/huin/goupnp v1.2.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8=
github.com/imroc/req/v3 v3.49.0 h1:5Rac2qvz7Dq0E3PeBo/c2szV3hagPQIGLoHtfBmYhu4=
github.com/imroc/req/v3 v3.49.0/go.mod h1:XZf4t94DNJzcA0UOBlA68hmSrWsAyvN407ADdH4mzCA=
github.com/imroc/req/v3 v3.50.0 h1:n3BVnZiTRpvkN5T1IB79LC/THhFU9iXksNRMH4ZNVaY=
github.com/imroc/req/v3 v3.50.0/go.mod h1:tsOk8K7zI6cU4xu/VWCZVtq9Djw9IWm4MslKzme5woU=
github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus=
github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc=
github.com/jaypipes/ghw v0.12.0 h1:xU2/MDJfWmBhJnujHY9qwXQLs3DBsf0/Xa9vECY0Tho=
@@ -105,24 +105,24 @@ github.com/oneclickvirt/CommonMediaTests v0.0.4-20250329123841 h1:Zef93z9UiZQwRA
github.com/oneclickvirt/CommonMediaTests v0.0.4-20250329123841/go.mod h1:DAmFPRjFV5p9fEzUUSml5jJGn2f1NZJQCzTxITHDjc4=
github.com/oneclickvirt/UnlockTests v0.0.26-20250329125926 h1:H5//xwVjDR02bQ1hLa3G7LnwccsudPMjBVt7WCx2y/U=
github.com/oneclickvirt/UnlockTests v0.0.26-20250329125926/go.mod h1:yXWIZB6iLS88pEd9m4QJi1GENn+7I91zA72y5ONz2Oc=
github.com/oneclickvirt/backtrace v0.0.4-20250329130043 h1:d3ubN7FTY2xDKN8mmLc1RbvccpTkvfMADtMBvFCRdt0=
github.com/oneclickvirt/backtrace v0.0.4-20250329130043/go.mod h1:zvsC7xY/WZqs5KL2JB967OVnuqjNbxu9bW6wXRLo5h8=
github.com/oneclickvirt/backtrace v0.0.5-20250411152044 h1:DaS97rh58IPDRElOk3CkZhYxhh1FRxp+veh0Y8hHtwo=
github.com/oneclickvirt/backtrace v0.0.5-20250411152044/go.mod h1:5AH00bo41hH3d2/JVuCTlBkZUs3AXX4nlKVXb6piZcI=
github.com/oneclickvirt/basics v0.0.11-20250404123515 h1:2kisK9tBG/Km/HLQFA82lm/B+AWFJp3drjrtGvz8lhw=
github.com/oneclickvirt/basics v0.0.11-20250404123515/go.mod h1:yN1IEOXN6v/GJqJSA70Pooo6nXBI/6rq72vTY72wJMQ=
github.com/oneclickvirt/cputest v0.0.10-20250404151448 h1:ovGtCwFXG0qmpyNDRqcNDIiAmhrtemCjIUXTJ1fPH0o=
github.com/oneclickvirt/cputest v0.0.10-20250404151448/go.mod h1:MmaHN9+XMntI3rLycwj8Ne31fG18IfNoa8N2utDK1CY=
github.com/oneclickvirt/dd v0.0.1-20250404124549 h1:QT2QJaMoZabUijqN2a/vzC13ILeKwQR3vatFZxKszW0=
github.com/oneclickvirt/dd v0.0.1-20250404124549/go.mod h1:tImu9sPTkLWo2tf1dEN1xQzrylWKauj9hbU8PHfyAeU=
github.com/oneclickvirt/dd v0.0.1-20250406062523 h1:jegTww4fuoFEqwFozvGJEqUNI/5ew3QJ0XcKZZ/zuTs=
github.com/oneclickvirt/dd v0.0.1-20250406062523/go.mod h1:tImu9sPTkLWo2tf1dEN1xQzrylWKauj9hbU8PHfyAeU=
github.com/oneclickvirt/defaultset v0.0.2-20240624082446 h1:5Pg3mK/u/vQvSz7anu0nxzrNdELi/AcDAU1mMsmPzyc=
github.com/oneclickvirt/defaultset v0.0.2-20240624082446/go.mod h1:e9Jt4tf2sbemCtc84/XgKcHy9EZ2jkc5x2sW1NiJS+E=
github.com/oneclickvirt/disktest v0.0.7-20250404150324 h1:uNTjFzzPBTJruPa25/4VLleHDyCj7QHre6qsVJZLo20=
github.com/oneclickvirt/disktest v0.0.7-20250404150324/go.mod h1:LXhRiAYYW0poUMqvUHzgqNqhVnJPj4cxjSA8zTKszbI=
github.com/oneclickvirt/fio v0.0.1-20250404141714 h1:rnNQ46O6kE+mFKmPDiWohNMbLr8xR6hzTgAsZcah4QE=
github.com/oneclickvirt/fio v0.0.1-20250404141714/go.mod h1:NIq+XYTey68KNERGIy/oRDlzpwLzBVoHOCiqX8didsE=
github.com/oneclickvirt/disktest v0.0.7-20250406062845 h1:2UAn1TYdRs6IXAqRhsf3WSd2yuVfV481a48B3d7Yz2o=
github.com/oneclickvirt/disktest v0.0.7-20250406062845/go.mod h1:sqVu6HwbnLmbnRj4389Xn08c301IhLnWCcbaEk2WzEc=
github.com/oneclickvirt/fio v0.0.1-20250406060851 h1:b7xHKpPmU4q0NmvigRCEr3tQuAV/83ZIAGtHycLegw8=
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-20250404130028 h1:2XLr8Ow922OnxHqFbGtyGFYNJtgTAcwXIr6AwvEp6UQ=
github.com/oneclickvirt/memorytest v0.0.5-20250404130028/go.mod h1:qp5uRoSv5lcpUtUqQuFCer4xaZKz9S8UxL+pZopn540=
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/nt3 v0.0.4-20250329125813 h1:ZK5DAz8GUa6oyRE/cWmUKkE02tfgDah4TXvN181em7c=
github.com/oneclickvirt/nt3 v0.0.4-20250329125813/go.mod h1:lDpHmjWwLZd6pO8cZCwzrc5rwd8dK+TIYk+DGmRpSGg=
github.com/oneclickvirt/pingtest v0.0.6-20250329130728 h1:XYMfpIj32Wuej5G7f7/NB5/i3I9DMX/mF3ZS8N5KKp8=

View File

@@ -7,22 +7,21 @@ import (
"fmt"
"github.com/oneclickvirt/CommonMediaTests/commediatests"
unlocktestmodel "github.com/oneclickvirt/UnlockTests/model"
backtraceori "github.com/oneclickvirt/backtrace/bk"
"github.com/oneclickvirt/backtrace/bk"
backtracemodel "github.com/oneclickvirt/backtrace/model"
basicmodel "github.com/oneclickvirt/basics/model"
cputestmodel "github.com/oneclickvirt/cputest/model"
disktestmodel "github.com/oneclickvirt/disktest/disk"
"github.com/oneclickvirt/ecs/backtrace"
"github.com/oneclickvirt/ecs/commediatest"
"github.com/oneclickvirt/ecs/cputest"
"github.com/oneclickvirt/ecs/disktest"
"github.com/oneclickvirt/ecs/memorytest"
"github.com/oneclickvirt/ecs/ntrace"
"github.com/oneclickvirt/ecs/speedtest"
"github.com/oneclickvirt/ecs/unlocktest"
"github.com/oneclickvirt/ecs/utils"
gostunmodel "github.com/oneclickvirt/gostun/model"
memorytestmodel "github.com/oneclickvirt/memorytest/memory"
nt3model "github.com/oneclickvirt/nt3/model"
"github.com/oneclickvirt/nt3/nt"
ptmodel "github.com/oneclickvirt/pingtest/model"
"github.com/oneclickvirt/pingtest/pt"
"github.com/oneclickvirt/portchecker/email"
@@ -39,7 +38,7 @@ import (
)
var (
ecsVersion = "v0.1.27"
ecsVersion = "v0.1.30"
menuMode bool
onlyChinaTest bool
input, choice string
@@ -168,7 +167,7 @@ func main() {
commediatests.EnableLoger = true
unlocktestmodel.EnableLoger = true
ptmodel.EnableLoger = true
backtraceori.EnableLoger = true
backtracemodel.EnableLoger = true
nt3model.EnableLoger = true
speedtestmodel.EnableLoger = true
}
@@ -358,9 +357,17 @@ func main() {
}
// 给打印操作一些时间完成
time.Sleep(100 * time.Millisecond)
if runtime.GOOS == "windows" || runtime.GOOS == "darwin" {
fmt.Println("Press Enter to exit...")
fmt.Scanln()
}
os.Exit(0)
case <-time.After(30 * time.Second):
fmt.Println("上传超时,程序退出")
if runtime.GOOS == "windows" || runtime.GOOS == "darwin" {
fmt.Println("Press Enter to exit...")
fmt.Scanln()
}
os.Exit(1)
}
}
@@ -436,7 +443,7 @@ func main() {
output = utils.PrintAndCapture(func() {
if commTestStatus && !onlyChinaTest {
utils.PrintCenteredTitle("御三家流媒体解锁", width)
commediatest.ComMediaTest(language)
fmt.Printf(commediatests.MediaTests(language))
}
}, tempOutput, output)
output = utils.PrintAndCapture(func() {
@@ -463,14 +470,18 @@ func main() {
output = utils.PrintAndCapture(func() {
if backtraceStatus && !onlyChinaTest {
utils.PrintCenteredTitle("三网回程线路检测", width)
backtrace.BackTrace()
if strings.Contains(output, "IPV6") {
backtrace.BackTrace(true)
} else {
backtrace.BackTrace(false)
}
}
}, tempOutput, output)
// nexttrace 在win上不支持检测报错 bind: An invalid argument was supplied.
output = utils.PrintAndCapture(func() {
if nt3Status && !onlyChinaTest {
utils.PrintCenteredTitle("三网回程路由检测", width)
ntrace.TraceRoute3(language, nt3Location, nt3CheckType)
nt.TraceRoute(language, nt3Location, nt3CheckType)
}
}, tempOutput, output)
output = utils.PrintAndCapture(func() {

View File

@@ -1,23 +1,21 @@
#!/bin/bash
# From https://github.com/oneclickvirt/ecs
# 2025.04.02
# 2025.04.07
# curl -L https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh
# 或
# curl -L https://cnb.cool/oneclickvirt/ecs/-/git/raw/main/goecs.sh -o goecs.sh && chmod +x goecs.sh
cat <<"EOF"
GGGGGGGG OOOOOOO EEEEEEEE CCCCCCCCC SSSSSSSSSS
GG GG OO OO EE CC SS
GG OO OO EE CC SS
GG OO OO EE CC SS
GG OO OO EEEEEEEE CC SSSSSSSSSS
GG GGGGGG OO OO EE CC SS
GG GG OO OO EE CC SS
GG GG OO OO EE CC SS
GGGGGGGG OOOOOOO EEEEEEEE CCCCCCCCC SSSSSSSSSS
,ad8888ba, ,ad8888ba, 88888888888 ,ad8888ba, ad88888ba
d8"' `"8b d8"' `"8b 88 d8"' `"8b d8" "8b
d8' d8' `8b 88 d8' Y8a
88 88 88 88aaaaa 88 `"Y8aaaaa,
88 88888 88 88 88""""" 88 `"""""8b,
Y8, 88 Y8, ,8P 88 Y8, `8b
Y8a. .a88 Y8a. .a8P 88 Y8a. .a8P Y8a a8P
`"Y88888P" `"Y8888Y"' 88888888888 `"Y8888Y"' "Y88888P"
EOF
cd /root >/dev/null 2>&1
if [ ! -d "/usr/bin/" ]; then
mkdir -p "/usr/bin/"
@@ -139,8 +137,8 @@ goecs_check() {
sleep 1
done
if [ -z "$ECS_VERSION" ]; then
_yellow "Unable to get version info, using default version 0.1.27"
ECS_VERSION="0.1.27"
_yellow "Unable to get version info, using default version 0.1.30"
ECS_VERSION="0.1.30"
fi
# Check if original goecs command exists
version_output=""
@@ -232,7 +230,23 @@ goecs_check() {
_red "Download failed, please check your network connection or download manually"
return 1
fi
# Extract and install with error handling
if ! command -v unzip >/dev/null 2>&1; then
_green "Installing $cmd"
if command -v apt-get >/dev/null 2>&1; then
INSTALL_CMD="apt-get -y install"
elif command -v yum >/dev/null 2>&1; then
INSTALL_CMD="yum -y install"
elif command -v dnf >/dev/null 2>&1; then
INSTALL_CMD="dnf -y install"
elif command -v pacman >/dev/null 2>&1; then
INSTALL_CMD="pacman -S --noconfirm"
elif command -v apk >/dev/null 2>&1; then
INSTALL_CMD="apk add"
elif command -v zypper >/dev/null 2>&1; then
INSTALL_CMD="zypper install -y"
fi
${INSTALL_CMD} "$cmd"
fi
if ! unzip -o goecs.zip >/dev/null 2>&1; then
_red "Extraction failed"
return 1
@@ -461,35 +475,30 @@ env_check() {
# If system is unrecognized, try common package managers
if [ -z "$SYSTEM" ]; then
_yellow "Unable to recognize system, trying common package managers..."
# Try apt
if command -v apt-get >/dev/null 2>&1; then
SYSTEM="Unknown-Debian"
UPDATE_CMD="apt-get update"
INSTALL_CMD="apt-get -y install"
REMOVE_CMD="apt-get -y remove"
UNINSTALL_CMD="apt-get -y autoremove"
# Try yum
elif command -v yum >/dev/null 2>&1; then
SYSTEM="Unknown-RHEL"
UPDATE_CMD="yum -y update"
INSTALL_CMD="yum -y install"
REMOVE_CMD="yum -y remove"
UNINSTALL_CMD="yum -y autoremove"
# Try dnf
elif command -v dnf >/dev/null 2>&1; then
SYSTEM="Unknown-Fedora"
UPDATE_CMD="dnf -y update"
INSTALL_CMD="dnf -y install"
REMOVE_CMD="dnf -y remove"
UNINSTALL_CMD="dnf -y autoremove"
# Try pacman
elif command -v pacman >/dev/null 2>&1; then
SYSTEM="Unknown-Arch"
UPDATE_CMD="pacman -Sy"
INSTALL_CMD="pacman -S --noconfirm"
REMOVE_CMD="pacman -R --noconfirm"
UNINSTALL_CMD="pacman -Rns --noconfirm"
# Try apk
elif command -v apk >/dev/null 2>&1; then
SYSTEM="Unknown-Alpine"
UPDATE_CMD="apk update"