更新时间:2023-01-02 10:38:11浏览次数:312+次
本文介绍如何在Ubuntu 22.04系统上安装SIPp测试工具,同时附上SIPp的用法。
安装SIPp的方法
1、安装SIPp依赖程序包
通过在终端上运行以下命令来安装SIPp所需的依赖项:
sudo apt update
sudo apt install -y pkg-config dh-autoreconf ncurses-dev build-essential libssl-dev libpcap-dev libncurses5-dev libsctp-dev lksctp-tools cmake
下载完成后,继续在Ubuntu 22.04上下载并编译SIPp。
2、下载并安装SIPp
我们将从Github主分支安装SIPp以获得最新版本。确保系统中安装了git:
sudo apt -y install git
从Github克隆项目:
git clone https://github.com/SIPp/sipp.git
现在使用提供的脚本build.sh构建SIPp:
1]、查看gtest子模块。
2]、生成自动工具文件。
3]、运行configure。
4]、构建并运行测试套件。
5]、构建SIPp。
要使用SSL、PCAP和SCTP支持构建SIPp,请运行:
cd sipp
cmake . -DUSE_SSL=1 -DUSE_SCTP=1 -DUSE_PCAP=1 -DUSE_GSL=1
make all
样本输出:
root@ubuntu-01:~/sipp# cmake .
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for endian.h
-- Looking for endian.h - found
-- Looking for sys/endian.h
-- Looking for sys/endian.h - not found
-- Looking for sys/epoll.h
-- Looking for sys/epoll.h - found
-- Performing Test HAVE_UDP_UH_PREFIX
-- Performing Test HAVE_UDP_UH_PREFIX - Success
-- Looking for le16toh
-- Looking for le16toh - found
-- Looking for le16toh
-- Looking for le16toh - not found
-- Found Git: /usr/bin/git (found version "2.25.1")
-- Checking for one of the modules 'ncursesw;cursesw;ncurses;curses'
-- Checking for one of the modules 'tinfo'
-- Configuring done
-- Generating done
-- Build files have been written to: /root/sipp
如果构建成功,您将在构建目录中获得一个sipp二进制文件。将此文件复制到/usr/local/bin目录:
$ sudo make install
[ 0%] Built target version
[100%] Built target sipp
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/bin/sipp
-- Set runtime path of "/usr/local/bin/sipp" to ""
现在,您应该可以从任何目录调用sipp命令:
$ sipp -v
SIPp的用法
sipp remote_host[:remote_port] [options]
最重要的选项如下截图所示:
要查看帮助页和所有可用选项,请使用:
sipp --help
以下是示例:
使用嵌入式服务器(uas)方案运行SIPp:
sipp -sn uas
在同一主机上,使用嵌入式客户端(uac)场景运行SIPp:
sipp -sn uac 127.0.0.1
发送10条OPTIONS消息100@10.1.1.20:
sipp 10.1.1.20 -sf OPTIONS.xml -m 10 -s 100
更多的用法请自行运行sipp --help命令查看,并配合上机操作落实。
相关资讯