我正在尝试使用以下脚本通过smbclient
从jmeter
执行groovy
命令
String command = 'smbclient -U user%pass //100.97.59.95/Shares -c "scopy download\\\\temp.zip test.zip"'
OUT.println('Command to run: '+command)
def sout = new StringBuilder(), serr = new StringBuilder()
def proc_update = command.execute()
proc_update.consumeProcessOutput(sout, serr)
proc_update.waitFor()
println("command ouput :")
println "out> $sout err> $serr"
下面是回溯
File to copy: temp.zip
Command to run: smbclient -U user%pass//100.97.59.95/Shares -c "scopy download\temp.zip test.zip"
command ouput :
out> scopy <src> <dest>
err> WARNING: The "syslog" option is deprecated
Domain=[WIN-VLTIKCNNV6P] OS=[Windows Server 2012 Datacenter 9200] Server=[Windows Server 2012 Datacenter 6.2]
该命令在我的终端上正常运行,而不是在Groovy上。可能是什么原因?
答案 0 :(得分:0)
建议尽可能使用JMeter内置测试元素作为none of available scripting engines provides the same performance as Java code,所以我建议改用OS Process Sampler。相关配置如下:
<link href='@Url.Content("~/Content/site.css")' rel="stylesheet" type="text/css" />
/bin/bash
-c
您将能够像其他任何采样器一样查看/获取STDOUT / ERR输出,即,您可以使用View Results Tree侦听器对其进行可视化: