Jmeter「第九节」-ssh插件,执行linux命令

此次分享使用的jmeter版本是:5.1

背景

在某项目的高可用测试过程中,有个case,要求针对某些节点频繁断开与重启的过程中,接口的调用是否正常;

但是手动来启动与关闭服务,非常的麻烦,可能还达不到预想的结果,手动执行毕竟还是没有机器快。

于是乎,就想到了jmeter可否执行linux命令呢?

下载及安装

下载相应的jar包,分别存入jmeter相应的目录,如下:

Copy the ApacheJMeter_ssh-1.2.0.jar to $JMETER_HOME/lib/ext directory
Copy the jsch-0.1.55.jar to $JMETER_HOME/lib directory

Jmeter「第九节」-ssh插件,执行linux命令

用法:

本次分享只使用到了:SSH Command

Usage

Using the plugin is simple (assuming familiarity with SSH and JMeter):

SSH Command
1.Create a new Test Plan
2.Add a Thread Group
3.Add a Sampler > SSH Command
4.Specify the host to connect to, port, username and password (unencrypted) or a key file, and a command to execute (such as date)
5.Add a Listener > View Results Tree
6.Run the test

SSH SFTP
1.Create a new Test Plan
2.Add a Thread Group
3.Add a Sampler > SSH SFTP
4.Specify the host to connect to, port, username and password (unencrypted) or a key file, and a SFTP command to execute (such as get)
5.Specify a source file to download, an output file or to print the content in the test
6.Add a Listener > View Results Tree
7.Run the test

展示:

下面的内容替换为真实内容即可

Jmeter「第九节」-ssh插件,执行linux命令

多个命令可以分号间隔,比如:cd /data;ls

Jmeter「第九节」-ssh插件,执行linux命令

结果

Jmeter「第九节」-ssh插件,执行linux命令

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

测试界

您的支持是我前进的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值