• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0-or-later
3# Copyright (c) 2017-2018 Oracle and/or its affiliates. All Rights Reserved.
4# Author: Alexey Kodanev <alexey.kodanev@oracle.com>
5
6TST_TESTFUNC="test"
7TST_NEEDS_TMPDIR=1
8TST_NEEDS_ROOT=1
9TST_TEST_DATA=",-A 65000"
10TST_TEST_DATA_IFS=","
11
12. tst_net.sh
13
14test()
15{
16	local opts="$2"
17
18	tst_res TINFO "compare TCP/SCTP performance"
19
20	tst_netload -H $(tst_ipaddr rhost) -T tcp -R 3 $opts
21	local res0="$(cat tst_netload.res)"
22
23	tst_netload -S $(tst_ipaddr) -H $(tst_ipaddr rhost) -T sctp -R 3 $opts
24	local res1="$(cat tst_netload.res)"
25
26	local per=$(( $res0 * 100 / $res1 - 100 ))
27
28	if [ "$per" -gt "100" -o "$per" -lt "-100" ]; then
29		tst_res TFAIL "sctp performance $per %"
30	else
31		tst_res TPASS "sctp performance $per % in range -100 ... 100 %"
32	fi
33}
34
35tst_run
36