Compare commits

...

7 Commits

Author SHA1 Message Date
spiritysdx
64d3602d31 update 2024-06-29 21:09:14 +08:00
spiritysdx
aa2c4bbb6e update 2024-06-29 21:07:58 +08:00
spiritysdx
d20d6c9b7c update 2024-06-29 20:53:09 +08:00
spiritysdx
a99254d0c3 update 2024-06-29 20:48:27 +08:00
spiritysdx
099dfeddcb update 2024-06-29 20:37:46 +08:00
spiritysdx
a5ea8debaa update 2024-06-29 20:24:31 +08:00
spiritysdx
6f1de5cae8 update 2024-06-29 20:15:36 +08:00
5 changed files with 31 additions and 41 deletions

View File

@@ -47,41 +47,19 @@ jobs:
GOPRIVATE: github.com/oneclickvirt/security
GITHUB_TOKEN: ${{ secrets.GHT }}
test:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Configure Git for Private Modules
run: |
git config --global url."https://${{ secrets.GHT }}@github.com/".insteadOf "https://github.com/"
git config --global url."git@github.com:".insteadOf "https://github.com/"
env:
GITHUB_TOKEN: ${{ secrets.GHT }}
- name: test
run: go test -v ./...
env:
GOPRIVATE: github.com/oneclickvirt/security
GITHUB_TOKEN: ${{ secrets.GHT }}
lint:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.22.4
- uses: actions/checkout@v3
- name: Configure Git for Private Modules
run: |
git config --global url."https://${{ secrets.GHT }}@github.com/".insteadOf "https://github.com/"
git config --global url."git@github.com:".insteadOf "https://github.com/"
env:
GITHUB_TOKEN: ${{ secrets.GHT }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.53.2
env:
GOPRIVATE: github.com/oneclickvirt/security
GITHUB_TOKEN: ${{ secrets.GHT }}
# test:
# needs: setup
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Configure Git for Private Modules
# run: |
# git config --global url."https://${{ secrets.GHT }}@github.com/".insteadOf "https://github.com/"
# git config --global url."git@github.com:".insteadOf "https://github.com/"
# env:
# GITHUB_TOKEN: ${{ secrets.GHT }}
# - name: test
# run: go test ./goecs_test.go
# env:
# GOPRIVATE: github.com/oneclickvirt/security
# GITHUB_TOKEN: ${{ secrets.GHT }}

View File

@@ -4,6 +4,7 @@ import (
"fmt"
"github.com/oneclickvirt/cputest/cpu"
"runtime"
"strings"
)
func CpuTest(language, testMethod, testThread string) {
@@ -31,5 +32,8 @@ func CpuTest(language, testMethod, testThread string) {
res = "Invalid test method specified.\n"
}
}
if !strings.Contains(res, "\n") && res != "" {
res += "\n"
}
fmt.Print(res)
}

View File

@@ -4,6 +4,7 @@ import (
"fmt"
"github.com/oneclickvirt/disktest/disk"
"runtime"
"strings"
)
func DiskTest(language, testMethod, testPath string, isMultiCheck bool) {
@@ -32,6 +33,9 @@ func DiskTest(language, testMethod, testPath string, isMultiCheck bool) {
}
}
//fmt.Println("--------------------------------------------------")
if !strings.Contains(res, "\n") && res != "" {
res += "\n"
}
fmt.Printf(res)
//fmt.Println("--------------------------------------------------")
}

View File

@@ -30,7 +30,7 @@ func printCenteredTitle(title string, width int) {
func main() {
var (
ecsVersion = "2024.06.25"
ecsVersion = "2024.06.29"
showVersion bool
language string
cpuTestMethod, cpuTestThread string
@@ -45,8 +45,8 @@ func main() {
flag.StringVar(&language, "l", "zh", "Specify language (supported: en, zh)")
flag.StringVar(&cpuTestMethod, "cpum", "sysbench", "Specify CPU test method (supported: sysbench, geekbench, winsat)")
flag.StringVar(&cpuTestThread, "cput", "", "Specify CPU test thread count (supported: 1, 2, ...)")
flag.StringVar(&memoryTestMethod, "memorym", "", "Specify Memory test method (supported: sysbench, dd, winsat)")
flag.StringVar(&diskTestMethod, "diskm", "", "Specify Disk test method (supported: sysbench, dd, winsat)")
flag.StringVar(&memoryTestMethod, "memorym", "dd", "Specify Memory test method (supported: sysbench, dd, winsat)")
flag.StringVar(&diskTestMethod, "diskm", "fio", "Specify Disk test method (supported: fio, dd, winsat)")
flag.StringVar(&diskTestPath, "diskp", "", "Specify Disk test path, example: -diskp /root")
flag.BoolVar(&diskMultiCheck, "diskmc", false, "Enable multiple disk checks, example: -diskmc=false")
flag.Parse()

View File

@@ -4,6 +4,7 @@ import (
"fmt"
"github.com/oneclickvirt/memorytest/memory"
"runtime"
"strings"
)
func MemoryTest(language, testMethod string) {
@@ -27,5 +28,8 @@ func MemoryTest(language, testMethod string) {
res = "Unsupported test method"
}
}
if !strings.Contains(res, "\n") && res != "" {
res += "\n"
}
fmt.Printf(res)
}