@@ -36,7 +36,9 @@ func NewCommandExecutor(outputCallback func(string)) *CommandExecutor {
3636 }
3737}
3838
39- func (e * CommandExecutor ) Execute (selectedOptions map [string ]bool , language string , testUpload bool , testDownload bool , chinaModeEnabled bool ) error {
39+ func (e * CommandExecutor ) Execute (selectedOptions map [string ]bool , language string , testUpload bool , testDownload bool , chinaModeEnabled bool ,
40+ cpuMethod , threadMode , memoryMethod , diskMethod , diskPath string , diskMulti bool ,
41+ nt3Location , nt3Type string , spNum int ) error {
4042 // 设置测试选项
4143 basicStatus := selectedOptions ["basic" ]
4244 cpuTestStatus := selectedOptions ["cpu" ]
@@ -135,7 +137,7 @@ func (e *CommandExecutor) Execute(selectedOptions map[string]bool, language stri
135137 // 2. CPU测试
136138 if cpuTestStatus {
137139 outputMutex .Lock ()
138- realTestMethod , res := cputest .CpuTest (language , "sysbench" , "multi" )
140+ realTestMethod , res := cputest .CpuTest (language , cpuMethod , threadMode )
139141 if language == "zh" {
140142 ecsutils .PrintCenteredTitle (fmt .Sprintf ("CPU测试-通过%s测试" , realTestMethod ), 82 )
141143 } else {
@@ -148,7 +150,7 @@ func (e *CommandExecutor) Execute(selectedOptions map[string]bool, language stri
148150 // 3. 内存测试
149151 if memoryTestStatus {
150152 outputMutex .Lock ()
151- realTestMethod , res := memorytest .MemoryTest (language , "auto" )
153+ realTestMethod , res := memorytest .MemoryTest (language , memoryMethod )
152154 if language == "zh" {
153155 ecsutils .PrintCenteredTitle (fmt .Sprintf ("内存测试-通过%s测试" , realTestMethod ), 82 )
154156 } else {
@@ -161,7 +163,7 @@ func (e *CommandExecutor) Execute(selectedOptions map[string]bool, language stri
161163 // 4. 磁盘测试
162164 if diskTestStatus {
163165 outputMutex .Lock ()
164- realTestMethod , res := disktest .DiskTest (language , "fio" , "" , false , true )
166+ realTestMethod , res := disktest .DiskTest (language , diskMethod , diskPath , diskMulti , true )
165167 if language == "zh" {
166168 ecsutils .PrintCenteredTitle (fmt .Sprintf ("硬盘测试-通过%s测试" , realTestMethod ), 82 )
167169 } else {
@@ -255,7 +257,7 @@ func (e *CommandExecutor) Execute(selectedOptions map[string]bool, language stri
255257 } else {
256258 ecsutils .PrintCenteredTitle ("NextTrace-3Networks-Check" , 82 )
257259 }
258- nexttrace .NextTrace3Check (language , "GZ" , "ipv4" )
260+ nexttrace .NextTrace3Check (language , nt3Location , nt3Type )
259261 outputMutex .Unlock ()
260262 }
261263
@@ -286,7 +288,7 @@ func (e *CommandExecutor) Execute(selectedOptions map[string]bool, language stri
286288 if testUpload || testDownload {
287289 speedtest .NearbySP ()
288290 if language == "zh" {
289- speedtest .CustomSP ("net" , "global" , 2 , language )
291+ speedtest .CustomSP ("net" , "global" , spNum , language )
290292 } else {
291293 speedtest .CustomSP ("net" , "global" , - 1 , language )
292294 }
0 commit comments