Public tests moved to centos-stream tests repositories

This commit is contained in:
František Hrdina 2025-10-21 12:20:12 +02:00
commit 38178d2415
27 changed files with 1 additions and 1886 deletions

View file

@ -1 +0,0 @@
1

View file

@ -1,46 +0,0 @@
GPL Cooperation Commitment
Version 1.0
Before filing or continuing to prosecute any legal proceeding or claim
(other than a Defensive Action) arising from termination of a Covered
License, we commit to extend to the person or entity ('you') accused
of violating the Covered License the following provisions regarding
cure and reinstatement, taken from GPL version 3. As used here, the
term 'this License' refers to the specific Covered License being
enforced.
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly
and finally terminates your license, and (b) permanently, if the
copyright holder fails to notify you of the violation by some
reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you
have received notice of violation of this License (for any work)
from that copyright holder, and you cure the violation prior to 30
days after your receipt of the notice.
We intend this Commitment to be irrevocable, and binding and
enforceable against us and assignees of or successors to our
copyrights.
Definitions
'Covered License' means the GNU General Public License, version 2
(GPLv2), the GNU Lesser General Public License, version 2.1
(LGPLv2.1), or the GNU Library General Public License, version 2
(LGPLv2), all as published by the Free Software Foundation.
'Defensive Action' means a legal proceeding or claim that We bring
against you in response to a prior proceeding or claim initiated by
you or your affiliate.
'We' means each contributor to this repository as of the date of
inclusion of this file, including subsidiaries of a corporate
contributor.
This work is available under a Creative Commons Attribution-ShareAlike
4.0 International license (https://creativecommons.org/licenses/by-sa/4.0/).

339
LICENSE
View file

@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View file

@ -1,3 +1 @@
# iperf3
Repository for iperf3 CI tests
Public tests have been moved to: https://gitlab.com/redhat/centos-stream/tests/

View file

@ -1,26 +0,0 @@
summary: TC testing all docs/man regressions
description: ''
author: Patrik Mosko <pmosko@pmosko>
component:
- iperf3
test: ./runtest.sh
framework: beakerlib
recommend:
- iperf3
duration: 5m
enabled: true
tag:
- Tier3
tier: '3'
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1656429
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1647413
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1665142
adjust:
- enabled: false
when: distro < rhel-7
continue: false
extra-nitrate: TC#0606299
extra-summary: /CoreOS/iperf3/Regression/docs
extra-task: /CoreOS/iperf3/Regression/docs
id: 2e26d562-ac95-49c4-a5af-a5d1d220f2e9

View file

@ -1,93 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/iperf3/Regression/docs
# Description: TC testing all docs/man regressions
# Author: Patrik Mosko <pmosko@pmosko>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2020 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="iperf3"
PKG_VER="$(rpm -q --qf %{V} iperf3)"
PKG_REL="$(rpm -q --qf %{R} iperf3)"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
# Testing documentation, this is the same for both x86 and i686 versions
PACVER=$(rpm -q iperf3 | head -n 1)
rlRun "_HELP=\$(mktemp -t $PACVER.help-XXX)"
rlRun "_MAN=\$(mktemp -t $PACVER.manpage-XXX)"
rlRun "_VER=\$(mktemp -t $PACVER.version-XXX)"
rlRun "man -P cat iperf3 &>$_MAN"
rlRun "iperf3 --help &>$_HELP" 0,1
rlRun "iperf3 --version &>$_VER"
rlPhaseEnd
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BZ#1656429
rlPhaseStartTest "BZ#1656429: option --udp-counters-64bit shown in --help output but not in man page"
# Minus char in man pages were changed from 'HYPHEN-MINUS' (U+002D) to 'HYPHEN' (U+2010)
if [[ "$PKG_VER" > "3.4" && "$PKG_REL" > "4.el8" ]] || rlIsFedora; then
rlAssertGrep "udpcounters64bit|--udp-counters-64bit" $_MAN -E
fi
rlAssertGrep "$udpcounters64bit|--udp-counters-64bit" $_HELP -E
rlPhaseEnd
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BZ#1647413
if ! rlIsRHEL 7; then #rhel-7 is not compiled with sctp support
rlPhaseStartTest "BZ#1647413: --sctp option is directly bonded"
if ! grep -iq 'SCTP' "$_VER"; then
rlLogInfo "This release of iperf3 isn't compiled with sctp support!"
# Minus char in man pages were changed from 'HYPHEN-MINUS' (U+002D) to 'HYPHEN' (U+2010)
for __f in $_HELP $_MAN; do
rlAssertNotGrep "sctp" $__f
rlAssertNotGrep "xbind" $__f
rlAssertNotGrep "nstreams" $__f
rlAssertNotGrep "--sctp" $__f
rlAssertNotGrep "--xbind" $__f
rlAssertNotGrep "--nstreams" $__f
done
else
rlLogInfo "This release of iperf3 is compiled with sctp support!"
# Minus char in man pages were changed from 'HYPHEN-MINUS' (U+002D) to 'HYPHEN' (U+2010)
for __f in $_HELP $_MAN; do
rlAssertGrep "sctp|--sctp" $__f -E
rlAssertGrep "xbind|--xbind" $__f -E
rlAssertGrep "nstreams|--nstreams" $__f -E
done
fi
rlPhaseEnd
fi
## Add next documentation Bug in another test phase
#rlPhaseStartTest "BZ#XXXXXXX"
#rlPhaseEnd
rlPhaseStartCleanup
rlRun "rm -f $_HELP $_MAN $_VER"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -1,367 +0,0 @@
#!/usr/bin/env python3
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# iperf3 integration test
# Description: Test for ipertf3
# Author: Susant Sahani <susant@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2018 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import errno
import os
import sys
import time
import unittest
import subprocess
import signal
import shutil
import re
import psutil
IPERF3_SERVER_LOGS='/var/run/iperf3-test-log'
IPERF3_PID_FILE='/var/run/iperf3-test-pid'
TEST_COMPLETE='Test Complete. Summary Results:'
SERVER_TEST_PROTOCOL_TCP_MSG='Starting Test: protocol: TCP'
SERVER_TEST_PROTOCOL_UDP_MSG='Starting Test: protocol: UDP'
SERVER_LISTENING_PORT_5202_MSG='Server listening on 5202'
SERVER_LISTENING_PORT_5201_MSG='Server listening on 5201'
SERVER_CONNECTED_LOCAL_PORT_5202_WITH_REMOTE_PORT_MSG='local 127.0.0.1 port 5202 connected to 127.0.0.1 port \d+'
SERVER_CONNECTED_LOCAL_PORT_5202_WITH_REMOTE_PORT_IPV6_MSG='local ::1 port 5202 connected to ::1 port \d+'
SERVER_CONNECTED_LOCAL_PORT_5201_WITH_REMOTE_PORT_MSG='local 127.0.0.1 port 5201 connected to 127.0.0.1 port \d+'
SERVER_INCOMING_CONNECTION_MSG='Accepted connection from 127.0.0.1, port \d+'
SERVER_INCOMING_CONNECTION_IPV6_MSG='Accepted connection from ::1, port \d+'
CLIENT_CONNECTED_TO_SERVER_PORT_5202_MSG='local 127.0.0.1 port \d+ connected to 127.0.0.1 port 5202'
CLIENT_CONNECTED_TO_SERVER_PORT_5201_MSG='local 127.0.0.1 port \d+ connected to 127.0.0.1 port 5201'
CLIENT_CONNECTED_TO_SERVER_PORT_5202_IPV6_MSG='local ::1 port \d+ connected to ::1 port 5202'
CLIENT_TEST_COMPLETE_MSG='iperf Done'
def setUpModule():
"""Initialize the environment, and perform sanity checks on it."""
if shutil.which('iperf3') is None:
raise OSError(errno.ENOENT, 'iperf3 not found')
for pid in psutil.pids():
try:
p = psutil.Process(pid)
except psutil.NoSuchProcess as exp:
continue
if p.name() == "iperf3":
raise unittest.SkipTest('iperf3 is already active')
class Iperf3ServerLogUtilities():
"""Provide a set of utility functions to facilitate iperf3 tests.
This class must be inherited along with unittest.TestCase to define
some required methods.
"""
def findTextInServerLog(self, **kwargs):
"""Look various success lines from iperf3 server logs."""
if kwargs is not None:
with open (IPERF3_SERVER_LOGS, 'rt') as in_file:
contents = in_file.read()
for key in kwargs:
self.assertRegex(contents, kwargs[key])
def KillIperf3Server(self):
time.sleep(3)
try:
with open(IPERF3_PID_FILE, 'r') as f:
pid = f.read().rstrip(' \t\r\n\0')
os.kill(int(pid), signal.SIGTERM)
os.remove(IPERF3_PID_FILE)
except IOError:
pass
def VerifyPortIsOpenAuto(self, port):
""" Tests whether iperf3 is listening on given port """
netstat_output = subprocess.check_output(['netstat', '-antpl']).rstrip().decode('utf-8')
self.assertIsNotNone(netstat_output)
match='tcp.*' + str(port) +'.*LISTEN.*/iperf3'
self.assertRegex(netstat_output, match)
class Iperf3TestsBindToInterface(unittest.TestCase, Iperf3ServerLogUtilities):
def setUp(self):
"""Setup veth interface"""
subprocess.check_output(['ip', 'link', 'add', 'iperf-veth', 'type', 'veth', 'peer', 'name', 'iperf-veth-peer'])
subprocess.check_output(['ip', 'addr', 'add', '192.168.50.5', 'dev', 'iperf-veth'])
subprocess.check_output(['ip', 'addr', 'add', '192.168.50.6', 'dev', 'iperf-veth-peer'])
subprocess.check_output(['ip', 'link', 'set', 'iperf-veth', 'up'])
subprocess.check_output(['ip', 'link', 'set', 'iperf-veth-peer', 'up'])
"""Start iperf3."""
subprocess.check_output(['iperf3', '-s', '--daemon', '--verbose' , '--logfile', '/var/run/iperf3-test-log', '--pidfile', '/var/run/iperf3-test-pid', '--bind', '192.168.50.5'])
time.sleep(3)
self.VerifyPortIsOpenAuto(5201)
def tearDown(self):
self.KillIperf3Server()
subprocess.check_output(['ip', 'link', 'del', 'iperf-veth'])
def test_tcp_client_bind_to_interface_default_port(self):
client_output = subprocess.check_output(['iperf3', '-c', '192.168.50.5', '--bind', '192.168.50.6']).rstrip().decode('utf-8')
time.sleep(3)
self.assertRegex(client_output, 'Connecting to host 192.168.50.5, port 5201')
self.assertRegex(client_output, 'local 192.168.50.6 port \d+ connected to 192.168.50.5 port 5201')
self.assertRegex(client_output, CLIENT_TEST_COMPLETE_MSG)
self.findTextInServerLog(test1='Accepted connection from 192.168.50.6, port \d+',
test2='local 192.168.50.5 port 5201 connected to 192.168.50.6 port \d+',
test3=SERVER_TEST_PROTOCOL_TCP_MSG,
test4=TEST_COMPLETE)
class Iperf3Tests(unittest.TestCase, Iperf3ServerLogUtilities):
def setUp(self):
"""Start iperf3."""
subprocess.check_output(['iperf3', '-s', '-p', '5202', '--daemon', '--verbose' , '--logfile', '/var/run/iperf3-test-log', '--pidfile', '/var/run/iperf3-test-pid'])
time.sleep(3)
self.VerifyPortIsOpenAuto(5202)
def tearDown(self):
self.KillIperf3Server()
def test_tcp_client_custom_port_5202(self):
client_output = subprocess.check_output(['iperf3', '-c', '127.0.0.1', '-p', '5202']).rstrip().decode('utf-8')
time.sleep(3)
self.assertRegex(client_output, CLIENT_CONNECTED_TO_SERVER_PORT_5202_MSG)
self.assertRegex(client_output, CLIENT_TEST_COMPLETE_MSG)
self.findTextInServerLog(test1=SERVER_CONNECTED_LOCAL_PORT_5202_WITH_REMOTE_PORT_MSG,
test2=SERVER_INCOMING_CONNECTION_MSG,
test3=SERVER_CONNECTED_LOCAL_PORT_5202_WITH_REMOTE_PORT_MSG,
test4=SERVER_TEST_PROTOCOL_TCP_MSG,
test5=TEST_COMPLETE)
def test_udp_client_custom_port_5202(self):
client_output = subprocess.check_output(['iperf3', '-c', '127.0.0.1', '-u', '-p', '5202']).rstrip().decode('utf-8')
time.sleep(3)
self.assertRegex(client_output, CLIENT_CONNECTED_TO_SERVER_PORT_5202_MSG)
self.assertRegex(client_output, "Total Datagrams")
self.assertRegex(client_output, CLIENT_TEST_COMPLETE_MSG)
self.findTextInServerLog(test1=SERVER_CONNECTED_LOCAL_PORT_5202_WITH_REMOTE_PORT_MSG,
test2=SERVER_INCOMING_CONNECTION_MSG,
test3=SERVER_CONNECTED_LOCAL_PORT_5202_WITH_REMOTE_PORT_MSG,
test4=SERVER_TEST_PROTOCOL_UDP_MSG,
test5=TEST_COMPLETE)
def test_tcp_client_custom_port_5202_time_15sec(self):
client_output = subprocess.check_output(['iperf3', '-c', '127.0.0.1', '-p', '5202', '-t','15']).rstrip().decode('utf-8')
time.sleep(3)
self.assertRegex(client_output, CLIENT_CONNECTED_TO_SERVER_PORT_5202_MSG)
self.assertRegex(client_output, CLIENT_TEST_COMPLETE_MSG)
self.findTextInServerLog(test1=SERVER_CONNECTED_LOCAL_PORT_5202_WITH_REMOTE_PORT_MSG,
test2=SERVER_INCOMING_CONNECTION_MSG,
test3=SERVER_CONNECTED_LOCAL_PORT_5202_WITH_REMOTE_PORT_MSG,
test4=SERVER_TEST_PROTOCOL_TCP_MSG,
test5='15 second test',
test6=TEST_COMPLETE)
def test_tcp_client_port_5202_ipv6(self):
client_output = subprocess.check_output(['iperf3', '-c', '::1', '-p', '5202']).rstrip().decode('utf-8')
time.sleep(3)
self.assertRegex(client_output, CLIENT_CONNECTED_TO_SERVER_PORT_5202_IPV6_MSG)
self.assertRegex(client_output, CLIENT_TEST_COMPLETE_MSG)
self.findTextInServerLog(test1=SERVER_CONNECTED_LOCAL_PORT_5202_WITH_REMOTE_PORT_IPV6_MSG,
test2=SERVER_INCOMING_CONNECTION_IPV6_MSG,
test3=SERVER_TEST_PROTOCOL_TCP_MSG,
test4=TEST_COMPLETE)
def test_udp_client_port_5202_ipv6(self):
client_output = subprocess.check_output(['iperf3', '-c', '::1', '-u', '-p', '5202']).rstrip().decode('utf-8')
time.sleep(3)
self.assertRegex(client_output, CLIENT_CONNECTED_TO_SERVER_PORT_5202_IPV6_MSG)
self.assertRegex(client_output, CLIENT_TEST_COMPLETE_MSG)
self.findTextInServerLog(test1=SERVER_CONNECTED_LOCAL_PORT_5202_WITH_REMOTE_PORT_IPV6_MSG,
test2=SERVER_INCOMING_CONNECTION_IPV6_MSG,
test3=SERVER_TEST_PROTOCOL_UDP_MSG,
test4=TEST_COMPLETE)
def test_tcp_client_custom_port_5202_parallel(self):
client_output = subprocess.check_output(['iperf3', '-c', '127.0.0.1', '-p', '5202', '--parallel', '10']).rstrip().decode('utf-8')
time.sleep(3)
self.assertRegex(client_output, CLIENT_CONNECTED_TO_SERVER_PORT_5202_MSG)
self.assertRegex(client_output, CLIENT_TEST_COMPLETE_MSG)
self.findTextInServerLog(test1=SERVER_CONNECTED_LOCAL_PORT_5202_WITH_REMOTE_PORT_MSG,
test2=SERVER_INCOMING_CONNECTION_MSG,
test3=SERVER_CONNECTED_LOCAL_PORT_5202_WITH_REMOTE_PORT_MSG,
test4='Starting Test: protocol: TCP, 10 streams',
test5=TEST_COMPLETE)
def test_tcp_client_custom_port_5202_reverse(self):
client_output = subprocess.check_output(['iperf3', '-c', '127.0.0.1', '-p', '5202', '-R']).rstrip().decode('utf-8')
time.sleep(3)
self.assertRegex(client_output, CLIENT_CONNECTED_TO_SERVER_PORT_5202_MSG)
self.assertRegex(client_output, 'Reverse mode, remote host 127.0.0.1 is sending')
self.assertRegex(client_output, CLIENT_TEST_COMPLETE_MSG)
self.findTextInServerLog(test1=SERVER_CONNECTED_LOCAL_PORT_5202_WITH_REMOTE_PORT_MSG,
test2=SERVER_INCOMING_CONNECTION_MSG,
test3=SERVER_CONNECTED_LOCAL_PORT_5202_WITH_REMOTE_PORT_MSG,
test4=TEST_COMPLETE)
def test_tcp_client_custom_port_5202_dscp(self):
client_output = subprocess.check_output(['iperf3', '-c', '127.0.0.1', '-p', '5202', '--dscp', '22']).rstrip().decode('utf-8')
time.sleep(3)
self.assertRegex(client_output, CLIENT_CONNECTED_TO_SERVER_PORT_5202_MSG)
self.assertRegex(client_output, CLIENT_TEST_COMPLETE_MSG)
self.findTextInServerLog(test1=SERVER_CONNECTED_LOCAL_PORT_5202_WITH_REMOTE_PORT_MSG,
test2=SERVER_INCOMING_CONNECTION_MSG,
test3=SERVER_CONNECTED_LOCAL_PORT_5202_WITH_REMOTE_PORT_MSG,
test4='tos 88',
test5=TEST_COMPLETE)
def test_tcp_client_custom_port_5202_mss(self):
client_output = subprocess.check_output(['iperf3', '-c', '127.0.0.1', '-p', '5202', '--set-mss', '400']).rstrip().decode('utf-8')
time.sleep(3)
self.assertRegex(client_output, CLIENT_CONNECTED_TO_SERVER_PORT_5202_MSG)
self.assertRegex(client_output, CLIENT_TEST_COMPLETE_MSG)
self.findTextInServerLog(test1=SERVER_CONNECTED_LOCAL_PORT_5202_WITH_REMOTE_PORT_MSG,
test2=SERVER_INCOMING_CONNECTION_MSG,
test3=SERVER_CONNECTED_LOCAL_PORT_5202_WITH_REMOTE_PORT_MSG,
test4='TCP MSS: 400',
test5=TEST_COMPLETE)
def test_tcp_client_custom_port_5202_title(self):
client_output = subprocess.check_output(['iperf3', '-c', '127.0.0.1', '-p', '5202', '--title', 'Susant']).rstrip().decode('utf-8')
time.sleep(3)
self.assertRegex(client_output, CLIENT_CONNECTED_TO_SERVER_PORT_5202_MSG)
self.assertRegex(client_output, "Susant")
self.assertRegex(client_output, CLIENT_TEST_COMPLETE_MSG)
self.findTextInServerLog(test1=SERVER_CONNECTED_LOCAL_PORT_5202_WITH_REMOTE_PORT_MSG,
test2=SERVER_INCOMING_CONNECTION_MSG,
test3=SERVER_CONNECTED_LOCAL_PORT_5202_WITH_REMOTE_PORT_MSG,
test4=TEST_COMPLETE)
def test_tcp_client_custom_port_5202_get_server_output(self):
client_output = subprocess.check_output(['iperf3', '-c', '127.0.0.1', '-p', '5202', '--get-server-output']).rstrip().decode('utf-8')
time.sleep(3)
self.assertRegex(client_output, "Server output:")
self.assertRegex(client_output, CLIENT_TEST_COMPLETE_MSG)
self.findTextInServerLog(test1=SERVER_CONNECTED_LOCAL_PORT_5202_WITH_REMOTE_PORT_MSG,
test2=SERVER_INCOMING_CONNECTION_MSG,
test5=TEST_COMPLETE)
def test_tcp_client_custom_port_5202_custom_client_port(self):
client_output = subprocess.check_output(['iperf3', '-c', '127.0.0.1', '-p', '5202', '--bind', '127.0.0.1', '--cport', '5203']).rstrip().decode('utf-8')
time.sleep(3)
self.assertRegex(client_output, CLIENT_CONNECTED_TO_SERVER_PORT_5202_MSG)
self.assertRegex(client_output, CLIENT_TEST_COMPLETE_MSG)
self.findTextInServerLog(test1=SERVER_CONNECTED_LOCAL_PORT_5202_WITH_REMOTE_PORT_MSG,
test2='port 5203',
test3=TEST_COMPLETE)
class Iperf3SanityTests(unittest.TestCase, Iperf3ServerLogUtilities):
def setUp(self):
"""Start iperf3 default TCP mode."""
subprocess.check_output(['iperf3', '--daemon', '--server', '--verbose' , '--logfile', '/var/run/iperf3-test-log', '--pidfile', '/var/run/iperf3-test-pid'])
time.sleep(3)
self.VerifyPortIsOpenAuto(5201)
def tearDown(self):
self.KillIperf3Server()
def test_basic_tcp_client_default_port_5201(self):
client_output = subprocess.check_output(['iperf3', '-c', '127.0.0.1',]).rstrip().decode('utf-8')
time.sleep(3)
self.assertRegex(client_output, CLIENT_CONNECTED_TO_SERVER_PORT_5201_MSG)
self.assertRegex(client_output, CLIENT_TEST_COMPLETE_MSG)
self.findTextInServerLog(test1=SERVER_LISTENING_PORT_5201_MSG,
test2=SERVER_INCOMING_CONNECTION_MSG,
test3=SERVER_CONNECTED_LOCAL_PORT_5201_WITH_REMOTE_PORT_MSG,
test4=SERVER_TEST_PROTOCOL_TCP_MSG,
test5=TEST_COMPLETE)
def test_server_log_file_exists(self):
self.assertTrue(os.path.exists(IPERF3_SERVER_LOGS))
def test_server_pid_file_exists(self):
self.assertTrue(os.path.exists(IPERF3_PID_FILE))
def test_server_daemon_pid_equal_to_pid_file(self):
with open(IPERF3_PID_FILE, 'r') as f:
pid = f.read().rstrip(' \t\r\n\0')
proc_path = os.path.join('/proc/', pid)
self.assertTrue(os.path.exists(proc_path))
process = psutil.Process(int(pid))
self.assertEqual(process.name(), 'iperf3')
f.close()
def test_basic_udp_client_default_port_5201(self):
client_output = subprocess.check_output(['iperf3', '-c', '127.0.0.1', '-u']).rstrip().decode('utf-8')
time.sleep(3)
self.assertRegex(client_output, CLIENT_CONNECTED_TO_SERVER_PORT_5201_MSG)
self.assertRegex(client_output, 'Total Datagrams')
self.assertRegex(client_output, CLIENT_TEST_COMPLETE_MSG)
self.findTextInServerLog(test1=SERVER_LISTENING_PORT_5201_MSG,
test2=SERVER_INCOMING_CONNECTION_MSG,
test3=SERVER_CONNECTED_LOCAL_PORT_5201_WITH_REMOTE_PORT_MSG,
test4=SERVER_TEST_PROTOCOL_UDP_MSG,
test5=TEST_COMPLETE)
if __name__ == '__main__':
unittest.main(testRunner=unittest.TextTestRunner(stream=sys.stdout,
verbosity=2))

View file

@ -1,25 +0,0 @@
summary: Basic-integration-test
description: ''
author: Susant Sahani <susant@redhat.com>
component:
- iperf3
test: ./runtest.sh
framework: beakerlib
recommend:
- iperf3
- python3
- net-tools
- python3-psutil
duration: 15m
enabled: true
tag:
- Tier1
tier: '1'
adjust:
- enabled: false
when: distro < rhel-8
continue: false
extra-nitrate: TC#0613929
extra-summary: /CoreOS/iperf3/Sanity/Integration-test
extra-task: /CoreOS/iperf3/Sanity/Integration-test
id: ecdfce8d-7ced-4d23-9cf2-83e5b11b1f5e

View file

@ -1,116 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/iperf3/Sanity/Integration-test
# Description: Basic-integration-test
# Author: Susant Sahani <susant@redhat.com>
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2022 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="iperf3"
Iperf3PidFile="/var/run/iperf3-test-pid"
TEST_LOG="test.log"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
if rlIsRHELLike '<9'; then
rlAssertRpm "python36"
else
rlAssertRpm "python3"
fi
rlAssertRpm "net-tools"
dnf list --installed | grep "python3-psutil"
if [ $? -eq 1 ]; then
rlRun "dnf install python3-psutil -y" 0 "Installing python3-psutil module"
fi
rlRun "dnf list --installed | grep \"python3-psutil\"" 0 "Checking if python3-psutil module install"
if pgrep -x "iperf3" > /dev/null
then
rlLog "Iperf3 is already Running"
fi
rlRun "cp iperf3-test.py /usr/bin/"
rlPhaseEnd
rlPhaseStartTest
rlLog "iperf3 tests"
rlRun "/usr/bin/python3 /usr/bin/iperf3-test.py |& tee $TEST_LOG"
tests=(
"test_basic_tcp_client_default_port_5201"
"test_basic_tcp_client_default_port_5201"
"test_basic_udp_client_default_port_5201"
"test_server_daemon_pid_equal_to_pid_file"
"test_server_log_file_exists"
"test_server_pid_file_exists"
"test_tcp_client_custom_port_5202"
"test_tcp_client_custom_port_5202_custom_client_port"
"test_tcp_client_custom_port_5202_get_server_output"
"test_tcp_client_custom_port_5202_mss"
"test_tcp_client_custom_port_5202_parallel"
"test_tcp_client_custom_port_5202_reverse"
"test_tcp_client_custom_port_5202_time_15sec"
"test_tcp_client_custom_port_5202_title"
"test_tcp_client_port_5202_ipv6"
"test_udp_client_custom_port_5202"
"test_udp_client_port_5202_ipv6"
"test_tcp_client_bind_to_interface_default_port"
)
# test_tcp_client_custom_port_5202_dscp, tos=4*dscp is only implemented on Fedora >36 at the moment
if rlIsFedora '>36'; then
tests=(${tests[@]} "test_tcp_client_custom_port_5202_dscp")
fi
for t in "${tests[@]}"; do
rlRun "cat $TEST_LOG | grep -e \"$t .* ok\"" 0 $t
done;
rlPhaseEnd
rlPhaseStartCleanup
rlRun "rm /usr/bin/iperf3-test.py"
rlRun "rm $TEST_LOG"
if [ -f "$Iperf3PidFile" ]
then
rlRun "read Iperf3Pid < $Iperf3PidFile"
rlRun "echo $Iperf3Pid"
if [ -z $Iperf3Pid ]
then
rlRun "kill -9 $Iperf3Pid"
rlRun "rm Iperf3PidFile"
fi
fi
rlLog "iperf3 tests done"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -1,28 +0,0 @@
summary: Tests SCTP support
description: ''
enabled: true
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1665142
tag:
- Tier1
tier: '1'
adjust:
- enabled: false
when: distro < rhel-8.3
continue: false
author: Patrik Mosko <pmosko@redhat.com>
component:
- iperf3
test: ./runtest.sh
framework: beakerlib
recommend:
- iperf3
- kmod
- kernel-modules-extra
- psmisc
- nmap-ncat
duration: 5m
extra-nitrate: TC#0606326
extra-summary: /CoreOS/iperf3/Sanity/basic-SCTP
extra-task: /CoreOS/iperf3/Sanity/basic-SCTP
id: 38141333-f4cb-4a0e-9718-2d33bdce5e5c

View file

@ -1,121 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/iperf3/Sanity/basic-SCTP
# Description: Tests SCTP support
# Author: Patrik Mosko <pmosko@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2020 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="iperf3"
function find_free_port() {
for port in `seq $1 $2`; do
if ! nc -z localhost $port &>/dev/null; then
echo "$port"
return 0
fi
done
return 1
}
rlJournalStart
rlPhaseStartSetup
rlIsCentOS '>=10' && dnf config-manager --set-disabled testing-farm-tag-repository
if [ $? -eq 0 ]; then
rlLog "Remove kernel-modules version installed from testing-farm-tag-repository"
rlRun "dnf remove kernel-modules* -y"
fi
# kernel-modules shoud be same version as running version of kernel
# because modprobe is looking for kernel-modules according to running kernel version
# different versions were causing Fedora CI failure on Fedora-Rawhide image
if rlIsRHELLike '>=8' || rlIsFedora; then
rlRun "dnf install kernel-modules-$(uname -r) -y"
fi
if rlIsRHELLike '>=8'; then
rlRun "dnf install kernel-modules-extra-$(uname -r) -y"
fi
rlRun "rlCheckDependencies"
rlRun -l "iperf3 --version"
rlRun "iperf3 --version | grep SCTP" 0 "iperf3 should be compiled with SCTP support"
rlRun "depmod" 0 "Updating modules dependencies"
# load SCTP kernel module
LSMOD_HASH="$(lsmod|cut -d\ -f1|sha256sum|cut -d\ -f1)"
LSMOD_OLD="$(lsmod|cut -d\ -f1)"
if ! lsmod | grep -q ^sctp; then
rlRun "modprobe sctp --first-time"
SCTP_LOADED="yes"
fi
rlPhaseEnd
#################### TEST PHASE ####################
rlPhaseStartTest "SCTP throughput tests"
rlWaitForCmd "killall $PACKAGE" -r 1 -m 10
PORT=`find_free_port 5201 65535`
rlRun "iperf3 -sDp $PORT" ;sleep 2
rlRun "taskset -cp \$(pidof iperf3)" 0 "Check whether iperf3-server is running"
rlRun "iperf3 --sctp -c 127.0.0.1 -p $PORT --nstreams 2" ;sleep 1
rlRun "iperf3 --sctp -c localhost -p $PORT --nstreams 10" ;sleep 1
# add xbind tests
#rlRun "iperf3 --sctp -c localhost -p $PORT --xbind <arg>" ;sleep 1
#rlRun "iperf3 --sctp -c localhost -p $PORT --xbind <arg> --nstreams 5" ;sleep 1
# testing specific amount of bytes/blocks/time
# !!! max (65507) and min (16) are valid probably ONLY for UDP, rewrite for SCTP when available!!! (should be same as for TCP)
rlRun "iperf3 --sctp -c 127.0.0.1 -p $PORT -n 1" ;sleep 1
rlRun "iperf3 --sctp -c 127.0.0.1 -p $PORT --bytes 100K" ;sleep 1
rlRun "iperf3 --sctp -c 127.0.0.1 -p $PORT -k 1" ;sleep 1
rlRun "iperf3 --sctp -c 127.0.0.1 -p $PORT --blockcount 100" ;sleep 1
rlRun "iperf3 --sctp -c 127.0.0.1 -p $PORT -n1 -k1" 1 ;sleep 1
rlRun "iperf3 --sctp -c 127.0.0.1 -p $PORT -t1 -k1" 1 ;sleep 1
rlRun "iperf3 --sctp -c 127.0.0.1 -p $PORT -t1 -n1" 1 ;sleep 1
rlRun "iperf3 --sctp -c 127.0.0.1 -p $PORT -n 2000 --length 1048577" 1 ;sleep 1
rlRun "iperf3 --sctp -c 127.0.0.1 -p $PORT --bytes 100K --length 16" ;sleep 1
# beware all-angering RISC (ones' complement ?!?) architectures!!! (ppc*, s390*, aarch*)
if [ "$(rlGetPrimaryArch)" = "x86_64" ]; then
rlRun "iperf3 --sctp -c 127.0.0.1 -p $PORT --bytes 200K --length -1" 1
else
rlRun "iperf3 --sctp -c 127.0.0.1 -p $PORT --bytes 200K --length 0xFFFFFFFFFFFFFFFF" 1
fi
rlRun "rlWatchdog \"iperf3 --sctp -c localhost -p $PORT -t0\" 30" 1 "option '-t0' should run forever so Watchdog should kill it!"
rlPhaseEnd
rlPhaseStartCleanup
rlWaitForCmd "killall $PACKAGE" -r 1 -m 10
[ -n "$SCTP_LOADED" ] && rlRun "modprobe -fr sctp" 0-255
if [ "$LSMOD_HASH" != "$(lsmod|cut -d\ -f1|sha256sum|cut -d\ -f1)" ]; then
diff <(echo "$LSMOD_OLD") <(lsmod | cut -d\ -f1)
rlLogWarning "Amount of kernel modules being loaded differs! (probably issue with removing SCTP module)"
fi
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -1,27 +0,0 @@
summary: Tests basic authentication/authorization capabilities of iperf3
description: ''
enabled: true
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1700497
tag:
- Tier1
tier: '1'
adjust:
- enabled: false
when: distro < rhel-8.3
continue: false
author: Patrik Mosko <pmosko@redhat.com>
component:
- iperf3
test: ./runtest.sh
framework: beakerlib
recommend:
- iperf3
- openssl
- expect
- psmisc
duration: 5m
extra-nitrate: TC#0606327
extra-summary: /CoreOS/iperf3/Sanity/basic-ssl
extra-task: /CoreOS/iperf3/Sanity/basic-ssl
id: e5166e5d-3d27-448b-be89-0ea1b45b4bdb

View file

@ -1,95 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/iperf3/Sanity/basic-ssl
# Description: Tests basic authentication/authorization capabilities of iperf3
# Author: Patrik Mosko <pmosko@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2020 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="iperf3"
: ${DEBUG_INFO:="no"}
rlJournalStart
rlPhaseStartSetup
rlRun "rlCheckMakefileRequires"
rlRun -l "iperf3 --version"
rlRun "iperf3 --version | grep authentication" 0 "iperf3 should be compiled with 'auth' support"
rlRun "log_client=\`mktemp\`" 0 "temporary file for storing output of iperf3 client"
rlRun "log_server=\`mktemp\`" 0 "temporary file for storing output of iperf3 server"
rlRun "auth_users=\`mktemp\`" 0 "temporary file for storing map of 'user,hash' values"
rlPhaseEnd
#################### TEST PHASE ####################
rlPhaseStartTest "openssl/crypto tests"
rlRun "pushd ssl_stuff"
rlWaitForCmd "killall $PACKAGE" -r 1 -m 10
# keys in directory 'ssl_stuff' have been generated as follows (example from `man iperf3`):
#rl1Run "openssl genrsa -out private.pem 2048"
#rlRun "openssl rsa -in private.pem -out public.pem -pubout -outform PEM"
#rlRun "openssl rsa -in private.pem -out private_no_enc.pem -outform PEM"
##debug
[ "$DEBUG_INFO" == "yes" ] && {
rlRun "openssl pkey -inform PEM -in public.pem -pubin -text -noout"
rlRun "openssl pkey -inform PEM -in private.pem -text -noout" -passin pass:shadowman
rlRun "openssl pkey -inform PEM -in private_no_enc.pem -text -noout"
}
# create a 'password file' with usernames and their hashes separated by commas
rlRun "touch auth_users" 0 "file storing pairs 'user,password_hash'"
_PASSWD="whats_good"
_USERS="pmosko psklenar omejzlik pdancak kzilkova"
for _u in $_USERS; do
rlRun "echo $_u,\$(echo -n \"{$_u}$_PASSWD\" | sha256sum | awk '{ print \$1 }') >> $auth_users"
done
rlRun -l "cat $auth_users" 0 "final database of users + their password hashes"
rlRun "iperf3 -sD --debug --rsa-private-key-path $(pwd)/private_no_enc.pem --authorized-users-path $auth_users --logfile $log_server"
for _user_ in $_USERS; do
> $log_server; > $log_client;
rlRun "expect password.expect $_user_ > $log_client"
rlRun -l "cat $log_server" 0 "cat logserver"
rlRun -l "cat $log_client" 0 "cat logfile"
if rlIsFedora '>=35' || rlIsRHELLike '>=10'; then
succeeded_str="succeeded"
else
succeeded_str="successed"
fi
rlAssertGrep "Authentication $succeeded_str for user.*$_user_" $log_server -i
rlAssertNotGrep "iperf3: error - test authorization failed" $log_server
done
rlRun "popd"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "rm -r $log_client $log_server $auth_users" 0 "Removing tmp files"
rlWaitForCmd "killall $PACKAGE" -r 1 -m 10
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -1,5 +0,0 @@
pmosko,69be581c601368d026088a1d71028e14e9c88bd9659334acd5a5b10d6694a985
psklenar,7bd3062c84caf6bed9ddf9c9c9d4bf5f18828c699e479248b6a7992166a28520
omejzlik,4626f0fa62cc30209415c5ce7fe4dd18fa5d3f059a85e9db65d3ca820e992025
pdancak,44456e5e35065e1312f9c64a30046a6dffac154d8fdc0363b49994fc40892e2c
kzilkova,a0753b7402dd28130be4026cfc7b5e60d4d214fe23c7861335acb52894eeda69

View file

@ -1,15 +0,0 @@
#!/usr/bin/expect
#exp_internal 1
log_user 1
set timeout 20
set _user_ [lindex $argv 0]
spawn iperf3 -c localhost --rsa-public-key-path public.pem -t3 --username $_user_
#puts "\$expect_out(buffer)"
expect -re "Password: "
send -- "whats_good\r"
expect

View file

@ -1,30 +0,0 @@
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,DFA254ACEB474DE7
abmxwlOosy1dhpaI/64M9vgB+sXjdFaZtaWEd9M/EffkUwXrhMlCeJU9UCvBin85
etbSkSUtHwd8XTzZw+vJmhmC26K/XFwpuPOgyaA95pWcSwKnZBxaJAFiWQAO5dy3
xnMN7oZwXXX2xR6/nV4iMlxFAETAduMtca9cAxbrvWV1DNCL3PxRR/k0hjeH30GV
aD0q1mI+vu4Yb6/NX+iz28rXTilkZJTzrh8SkWGXdQ4+959SSiF6qgHKqv+w+ZWX
wE+e0+oMuWWR6YvP0cvIlVSGlyLXL5Aq6uYtojwhBh3RcHMB5fRyzWqlhx+J8CGK
Qxo9ipXt6YZo4aO1bs6A4jfH+QImuJUUOcYF7BPIv7QoWDGMDmYe8+naA0TbB5pi
UB9K01/KDE81GWARxQmVOtJEoEitJ1TpEfWxdY/9/4BRxH3/kfXNzGae0APUScSd
9GaJoL4xCX+mkMEElpj0DP5qO+u9fFdgfOxQUvgo5BZENuX5ItN3YC3I1UFfAWrX
F9tmGQKnmQ29zJd0JJx+PZ5m5nP4dUm813iwJ47H+S7Cihg5dbEBMLBTlfIVub6u
1kKoFDPvI5znJ68qe5DgVOsHtczNfwI29EoIXQxKrIiqzOaW1FENRxyHJxwD/pqB
3Fli8hI8oW4+8kwCsVuaL8c2rR5Th4CMDgzAB4mLe8AHf0i6GD6ydnFfY4UxIAA0
fLdr7smf/U2cNp7u48cq5PNQXj0cFowV1ESvJAj0XbeObWDcIfMuzVRsVqAxGglB
Oxq8CQ7oVMJ7QerT1r+LIPnslZTNCgRNBViNjYeKuASnY9pP80oxc2a6HapA5Pld
zosvXCWoPHfCamMwsxuwyP33lSNfiJgOcezLk9CbjeIkdS+zVapmxyE82yt0Mi9c
tBnWZvfBLR1yD7RXC7LRNQhkYOEEQ4SAPKVZPFvKkSCEDH5YFGjTCSceY4iJ9QXD
AHYBbn04P7l9pesb0PzlDasEeUiPu9ArQCyx9jMj+jO+kDYMGltzbSxtoB/WJG/W
vblErBks+piBWC9yweUUy5y3Xlp49PlEzIdlt+1Bcy/rKcOaZO6ANYSfCLiAIdlE
jhBdZCqOi0HqTIUJBv1gM2JP+iL6g1tXNH2x2wBRceBAETZqRcOHGFdXR+dcMVd3
sP+4WuA/bkGIWTvsmkBw4+5ITE7KSfzJG8KH3iAyNLQC3SfCHZi3K21sSf8q1LVT
AlCR2V21pVhLUASI++9sA4s/c6QQOxHNBfd2irUR8yc34FVR6VXRJ3K3umc13Sr5
dgkCl3H1/42BBN8Varr/JcjxFe6WOi0Sc+OzS+s1j2Muy+aAs7O13gtX8oHySwfi
B522lDbeeJY9kQgz1BeqKejpMP3NsZvxp9y3ux191Y8/Gv++18ypbGJYvDAKzFnf
+xQAeLID1d0T3c+34aR0AxNC758Mi6C0FNEzH/1LbheYDk0lrmgua7TCns2g7XHX
ZQS48sjyMpxwVsDOnIgziM2T+RYPRRfrdBiABz2D1TSlXdZ+UNAI/IonvEtS39L3
ZdtZMihhNggvZsr6oZXmlt/pchVkfB1WYXWsmstER4r5LuiFhd+/wA==
-----END RSA PRIVATE KEY-----

View file

@ -1,27 +0,0 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEAx2dnXKJ3polUKvrK7yvgWa8t9P6pOjIXtKVISHj7Asbl9PWi
j/Q03RTbtXwTPbYl9Ew+y++sWyXlf9wRBLFqZvVD0JLu3Femx/l6H45B51pygYhS
Et4k3eAck4acJ97L/iiYWYmHNVNyDktUooIP7+MfvDCZ/RGPsz8huhyL85l7D7ST
MojoHyvItJujmf9rN0q0mrCdZw8R5s+0c4KjNIPm31O5B16BzwYU4X+rXFv/oK/E
RrL32EetYSgZD/mrcUQvIZ/FjEb+elzwYWFq5LwmRG5b8ANdL420X4NIaoQx70RU
kH+p7TKO80+c0Q+OUvwgWvBH1/qPFqF3i13jMwIDAQABAoIBAHq6GdPZ6uqE+1i4
os4xoxOPzilL07wNuKlmUObKDzPWVxI9XKBdHWw0ukUo6G7C/PkvNDcwfFRdLrNT
LuZEi8hyjBqDVKApEm1iDtf9JnLOKEuxK1KRhv9IQE5MOzAO4F69fYceLimUAk7p
7l1Wz5hFofKhtyUa+ebIpGl3yGtUpBELgFxfpvFL72cuvqcPaz79bO5/LsSh5Rvr
pjfRcLR0SiDPBHqi+nTbMSrVoJZ38JzAxhDqJMLJ4kWBwMKmrdQqLe6cc6HZr/Q0
6iz4MQpLmfJFeA1KwIR/+l8fnPkCOawHESJ9VXnBXy3o6QfMFIv25zqBajFnooS5
oumk/4ECgYEA+MHXg5FUnvq9nJIc3A12kBcJe1O0/TLDN4Gu9TSImiz37nBDCvRc
d/jOiRk9DQf5E62qzBxF74CDSPb5MJXQj6tgZMCTWJw82oytrusHDr/waWSLhhUv
zC1VwUY3D7tOvkxLfMYiWHKCcBw43Ylw72wBCWFeWFA9KMltnYokpQcCgYEAzTWy
tP/ykFIbtjgI8qtqyI2Q3Ms4xkKcN20LNJzB7V8Mb7ge9ux5bOWdxABFY6kFwhUH
Y319cnqbO8zChIbohYQjWH02c6aJXgbWXJA7gJVUzKC6QKoq6Sf9qzWQ5Fh+JHDn
mRNI9VTEeYa2vcCHl74wE7doeYPElaVEqO/PEXUCgYB7LloPP7c8poOgdcYuvcf5
YD8EwBW+0BVVdjVyHRqL5jq76wF3+juT+TQlNcdCnbEcqoIKYvHKwMPCLPKGuZk2
m7G3EpmkZnHH86PKG346MpfVSMHCmtk5bTWq6J85fhJnL5at6dt2GvY2l/Mc2QOA
u+XjhEDY0JsIiH5sZczxnwKBgFT0sjN08vsEwyxBLpMonGDDGwINsEeENCBOKKFz
dGXNP9zQoSEg7XRD63jFk/SaeSPMiO6LeW/3imTLdIxhPcpo1ilATVa7z4r50a0o
mTm2mRDOSc2TpYg5Yi+LUZz3deGoTHl3HnFS0rRtLSKJnpkXx9ehysLj5nL9pNs7
zMIxAoGADQdYGquCRFsLpEJqjelWhpf9ufw4JKDpjh4Fbp3h9SujZq0ttwZ241Ri
5EwlxooMxjQ0j61aRxbAyrKgCp5xNOFzglWGReoVlvXp0MLX7Giwm4d6jE/DCivq
elbJ0fIMD0ZqcI/3FHC+AmWqnBTAxLrFifnOCLEmGMHT2xkV9fw=
-----END RSA PRIVATE KEY-----

View file

@ -1,9 +0,0 @@
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx2dnXKJ3polUKvrK7yvg
Wa8t9P6pOjIXtKVISHj7Asbl9PWij/Q03RTbtXwTPbYl9Ew+y++sWyXlf9wRBLFq
ZvVD0JLu3Femx/l6H45B51pygYhSEt4k3eAck4acJ97L/iiYWYmHNVNyDktUooIP
7+MfvDCZ/RGPsz8huhyL85l7D7STMojoHyvItJujmf9rN0q0mrCdZw8R5s+0c4Kj
NIPm31O5B16BzwYU4X+rXFv/oK/ERrL32EetYSgZD/mrcUQvIZ/FjEb+elzwYWFq
5LwmRG5b8ANdL420X4NIaoQx70RUkH+p7TKO80+c0Q+OUvwgWvBH1/qPFqF3i13j
MwIDAQAB
-----END PUBLIC KEY-----

View file

@ -1,22 +0,0 @@
summary: Sanity test
description: ''
author: Vaclav Danek <vdanek@redhat.com>
component:
- iperf3
test: ./runtest.sh
framework: beakerlib
recommend:
- iperf3
duration: 5m
enabled: true
tag:
- Tier1
tier: '1'
adjust:
- enabled: false
when: distro < rhel-7
continue: false
extra-nitrate: TC#0554169
extra-summary: /CoreOS/iperf3/Sanity/sanity-test
extra-task: /CoreOS/iperf3/Sanity/sanity-test
id: 6331bb54-a94a-41d5-bc2b-54388cc061b9

View file

@ -1,63 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/iperf3/Sanity/sanity-test
# Description: Sanity test
# Author: Vaclav Danek <vdanek@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2017 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="iperf3"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm "$PACKAGE"
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlPhaseEnd
rlPhaseStartTest
rlRun -s "iperf3 -c localhost" 1 "Client should fail when no server is listening."
if rlIsFedora || rlIsRHELLike '>=10'; then
MESSAGE="iperf3: error - unable to connect to server - server may have stopped running or use a different port, firewall issue, etc.: Connection refused"
elif rlIsRHELLike '9'; then
MESSAGE="iperf3: error - unable to send control message: Bad file descriptor"
else
MESSAGE="iperf3: error - unable to connect to server: Connection refused"
fi
rlAssertGrep "$MESSAGE" $rlRun_LOG -E
rm -f $rlRun_LOG
rlRun "iperf3 -D -s -1"
rlRun -s "iperf3 -c localhost"
rlAssertGrep "iperf Done." $rlRun_LOG -i
rm -f $rlRun_LOG
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -1,66 +0,0 @@
summary: Sanity test case for testing basic functionality
description: |
--------------------------------------------------------------------------------
Description of TC's environment:
Iperf3 could be compiled with some optional features. In iperf3-3.5-2.el8, those are:
- CPU affinity
- sendfile / zerocopy
- socket pacing
- tcp congestion algorithm
- IPv6 flow label
- ssl / authentication
- SCTP
You can enable all runs of specific opt. feature from all test phases by assigning "yes" to it's related variable.
* AFFINITY
* ZEROCOPY
* PACING
* TCP_CONGESTION
* FLOW_LABEL
* SSL
* SCTP
--------------------------------------------------------------------------------
Test Phases
TC consists of a few different "test phases" testing various functionalities and/or aspects of iperf3.
Those are:
- TCP throughput testing phase
- UDP throughput testing phase
- SCTP throughput testing phase
- SSL/authentication phase
- One-off testing phase (Server run with server-only option '-1, --one-off')
- Miscellaneous tests phase (mix of everything from above or mix of esoteric features/options of iperf3)
You can DISABLE those Phases by assigning "yes" to their related variables:
* TCP_DISABLED
* UDP_DISABLED
* SCTP_DISABLED
* SSL_DISABLED
* ONEOFF_DISABLED
* MISC_DISABLED
--------------------------------------------------------------------------------
author: Patrik Mosko <pmosko@redhat.com>
component:
- iperf3
test: ./runtest.sh
framework: beakerlib
recommend:
- iperf3
- psmisc
- nmap-ncat
duration: 60m
enabled: true
tag:
- Tier1
tier: '1'
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1665142
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1700497
adjust:
- enabled: false
when: distro < rhel-7
continue: false
extra-nitrate: TC#0589607
extra-summary: /CoreOS/iperf3/Sanity/sanity-test2
extra-task: /CoreOS/iperf3/Sanity/sanity-test2
id: 1f5512cc-c376-4076-adf6-c25c4d8e2934

View file

@ -1,292 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/iperf3/Sanity/sanity-test2
# Description: Sanity test case for testing basic functionality
# Author: Patrik Mosko <pmosko@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2018 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="iperf3"
# different test phases - all enabled by default
: ${TCP_DISABLED="no"}
: ${UDP_DISABLED="no"}
: ${MISC_DISABLED="no"}
: ${ONEOFF_DISABLED="no"}
function find_free_port() {
for port in `seq $1 $2`; do
if ! nc -z localhost $port &>/dev/null; then
echo "$port"
return 0
fi
done
return 1
}
#########################################################################
# functions that expand inside iperf3 (client) command to either empty string or actual option with its potential argument
# this is done because some options are optional which means actual iperf3 version may not support/provide them
# sendfile / zerocopy
function opt_aff() {
[ "$AFFINITY" == "yes" ] && echo "-A$1"
}
# CPU affinity
function opt_zer() {
[ "$ZEROCOPY" == "yes" ] && echo "-Z"
}
# socket pacing
function opt_pac() {
[ "$PACING" == "yes" ] && echo "--fq-rate=$1"
}
# tcp congestion contorl algorithm
function opt_con() {
[ "$TCP_CONGESTION" == "yes" ] && echo "-C$1"
}
# IPv6 flow label
function opt_flow() {
[ "$FLOW_LABEL" == "yes" ] && echo "-L$1"
}
#########################################################################
# RHEL-specific options
opt_pac_timer() {
rlIsRHEL ">=8" && echo "--pacing-timer $1"
}
opt_dscp() {
rlIsRHEL ">=8" && echo "--dscp $1"
}
rlJournalStart
########## SETUP PHASE ##########
rlPhaseStartSetup "Setup basic variables"
rlAssertRequired
# check availability of optional features
# all features can be found in 'src/iperf_util.c' inside function 'get_optional_features'
rlRun "touch opts"
rlRun "iperf3 --version > opts"
rlLog "Optional features of installed iperf3 build"
grep -qi 'affinity' opts && AFFINITY="yes" || AFFINITY="no" ;rlLog "affinity: $AFFINITY"
grep -qi 'zerocopy' opts && ZEROCOPY="yes" || ZEROCOPY="no" ;rlLog "zerocopy: $ZEROCOPY"
grep -qi 'pacing' opts && PACING="yes" || PACING="no" ;rlLog "pacing: $PACING"
grep -qi 'TCP congestion' opts && TCP_CONGESTION="yes" || TCP_CONGESTION="no" ;rlLog "tcp congestion: $TCP_CONGESTION"
grep -qi 'flow label' opts && FLOW_LABEL="yes" || FLOW_LABEL="no" ;rlLog "flow label: $FLOW_LABEL"
rlPhaseEnd
########## SETUP PHASE ##########
rlPhaseStartSetup
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlRun "log_client=\`mktemp\`" 0 "temporary file for storing output of iperf3 client"
rlRun "log_server=\`mktemp\`" 0 "temporary file for storing output of iperf3 server"
rlPhaseEnd
#################### TEST PHASE ####################
[ "$ONEOFF_DISABLED" != "yes" ] && {
rlPhaseStartTest "Server 'one-off' shots harassment"
rlWaitForCmd "killall $PACKAGE" -r 1 -m 10
[ "$AFFINITY" == "yes" ] && {
PORT=`find_free_port 5201 65535`
rlRun "iperf3 -sDp $PORT -A0 -1" ;sleep 2
rlRun "iperf3 -c 127.0.0.1 --port $PORT" ;sleep 1
PORT=`find_free_port 5201 65535`
rlRun "iperf3 -sDp $PORT -A $(($(nproc)-1)) --one-off" ;sleep 2
rlRun "iperf3 --client localhost --port $PORT -t5" ;sleep 1
> $log_client; > $log_server
PORT=`find_free_port 5201 65535`
rlRun "iperf3 -sDp $PORT --logfile $log_server -1" ;sleep 2
rlRun "iperf3 --udp --client 127.0.0.1 --logfile $log_client --port $PORT -A0,$(($(nproc)-1))" ;sleep 1
rlAssertGrep "iperf done" $log_client -i
rlRun "test -s $log_server"
} || rlLogInfo "Skipping few tests which require missing iperf3's optional feature: 'CPU affinity'"
# /1/ --cport have to be specified with "--bind" on rhel-7 version of iperf3
# /2/ --bitrate isn't supported on rhel_ý version of iperf3
rlIsRHEL 8 && {
PORT=`find_free_port 5201 65535`
rlRun "iperf3 -sDp $PORT --one-off -B 0.0.0.0" ;sleep 2
rlRun "iperf3 --udp -c 0.0.0.0 --port $PORT --bitrate 10K" ;sleep 1
PORT=`find_free_port 5201 65535`
rlRun "iperf3 -sDp $PORT -1" ;sleep 2
rlRun "iperf3 --udp -c 127.0.0.1 -p $PORT -b 5M --cport \`find_free_port 5500 65535\`" ;sleep 1
PORT=`find_free_port 5201 65535`
rlRun "iperf3 -sDp $PORT -1 -B 0.0.0.0" ;sleep 2
rlRun "iperf3 --udp -c 127.0.0.1 -p $PORT -i0 -t15 --cport \`find_free_port 5500 65535\`" ;sleep 1
PORT=`find_free_port 5201 65535`
rlRun "iperf3 -sDp $PORT -1" ;sleep 2
rlRun "iperf3 --udp -c 127.0.0.1 -p $PORT -i0 -t15 --cport \`find_free_port 5500 65535\`" ;sleep 1
}
rlPhaseEnd
}
#################### TEST PHASE ####################
[ "$TCP_DISABLED" != "yes" ] && {
rlPhaseStartTest "TCP throughput tests"
rlWaitForCmd "killall $PACKAGE" -r 1 -m 10
# basic/minimal localhost tests
PORT=`find_free_port 5201 65535`
rlRun "iperf3 -sDp $PORT" ;sleep 2
rlRun "taskset -cp \`pidof iperf3\`" 0 "Check whether iperf3-server is running"
rlRun "iperf3 --client 127.0.0.1 --port $PORT"; sleep 1
rlRun "iperf3 --client localhost --port $PORT"; sleep 1
# testing specific amount of bytes/blocks/time
rlRun "iperf3 -c 127.0.0.1 -p $PORT -n 1" ;sleep 1
rlRun "iperf3 -c 127.0.0.1 -p $PORT --bytes 2M" ;sleep 1
rlRun "iperf3 -c 127.0.0.1 -p $PORT -k 1" ;sleep 1
rlRun "iperf3 -c 127.0.0.1 -p $PORT --blockcount 100K" ;sleep 1
rlRun "iperf3 -c 127.0.0.1 -p $PORT -n1 -k1" 1 ;sleep 1
rlRun "iperf3 -c 127.0.0.1 -p $PORT -t1 -k1" 1 ;sleep 1
rlRun "iperf3 -c 127.0.0.1 -p $PORT -t1 -n1" 1 ;sleep 1
rlRun "iperf3 -c 127.0.0.1 -p $PORT -n 10M --length 1048576" ;sleep 1
rlRun "iperf3 -c 127.0.0.1 -p $PORT -n 10M --length 1048577" 1 ;sleep 1
rlIsRHEL 7 && rlRun "iperf3 -c 127.0.0.1 -p $PORT --bytes 2000K --length 15"; sleep 1
# test congestion control algorithms
[ "$TCP_CONGESTION" == "yes" ] && {
PORT=`find_free_port 5201 65535`
rlRun "iperf3 -sDp $PORT"
CONG_ALG=`sysctl net.ipv4.tcp_available_congestion_control | sed 's;^.*= \(.*\);\1;'`
for c_alg in $CONG_ALG; do
rlRun "iperf3 -T \"congestion control alg. [$c_alg]:\" -c localhost -p $PORT -C $c_alg" ;sleep 1
done
}
# watchdog tests
rlRun "rlWatchdog \"iperf3 -c localhost -p $PORT -t0\" 30" 1 "option '-t0' should run forewer so Watchdog should kill it!"
rlPhaseEnd
}
#################### TEST PHASE ####################
[ "$UDP_DISABLED" != "yes" ] && {
rlPhaseStartTest "UDP throughput tests"
rlWaitForCmd "killall $PACKAGE" -r 1 -m 10
# basic/minimal localhost tests
PORT=`find_free_port 5201 65535`
rlRun "iperf3 -sDp $PORT" ;sleep 2
rlRun "taskset -cp \`pidof iperf3\`" 0 "Check whether iperf3-server is running"
rlRun "iperf3 --udp --client 127.0.0.1 --port $PORT" ;sleep 1
rlRun "iperf3 --udp --client localhost --port $PORT" ;sleep 1
# testing specific amount of bytes/blocks/time
rlRun "iperf3 --udp -c 127.0.0.1 -p $PORT -n 1" ;sleep 1
rlRun "iperf3 --udp -c 127.0.0.1 -p $PORT --bytes 2M" ;sleep 1
rlRun "iperf3 --udp -c 127.0.0.1 -p $PORT -k 1" ;sleep 1
rlRun "iperf3 --udp -c 127.0.0.1 -p $PORT --blockcount 100" ;sleep 1
rlRun "iperf3 --udp -c 127.0.0.1 -p $PORT -n1 -k1" 1 ;sleep 1
rlRun "iperf3 --udp -c 127.0.0.1 -p $PORT -t1 -k1" 1 ;sleep 1
rlRun "iperf3 --udp -c 127.0.0.1 -p $PORT -t1 -n1" 1 ;sleep 1
rlRun "iperf3 --udp -c 127.0.0.1 -p $PORT -n 5.2M --length 65507" ;sleep 1
rlRun "iperf3 --udp -c 127.0.0.1 -p $PORT -n 7M --length 65508" 1 ;sleep 1
rlRun "iperf3 --udp -c 127.0.0.1 -p $PORT --bytes 100K --length 16" ;sleep 1
rlIsRHEL ">7" && rlRun "iperf3 --udp -c 127.0.0.1 -p $PORT --bytes 100K --length 15" 1 ;sleep 1
rlRun "iperf3 --udp --client localhost --port $PORT -t3" ;sleep 1
rlRun "rlWatchdog \"iperf3 --udp -c 127.0.0.1 -p $PORT -t0\" 30" 1 "option '-t0' should run forever so Watchdog should kill it!"
rlPhaseEnd
}
#################### TEST PHASE ####################
[ "$MISC_DISABLED" != "yes" ] && {
rlPhaseStartTest "Miscellaneous tests"
rlWaitForCmd "killall $PACKAGE" -r 1 -m 10
PORT=`find_free_port 5201 65535`
rlRun "iperf3" 1 "Must be either a client or server"
rlRun "iperf3 --server --daemon --port $PORT -1" ; sleep 2
rlRun "taskset -cp \`pidof iperf3\`" 0 "Check whether iperf3-server is running"
rlWaitForCmd "killall $PACKAGE" -r 1 -m 10
# server with affinity tests
[ "$AFFINITY"="yes" ] && {
rlRun "iperf3 -sDp $PORT --affinity 1025 -1" 1 "too big value for affinity!"
rlRun "iperf3 -sDp $PORT --affinity -1 -1" 1 "affinity can be set with positive integer only"
rlRun "iperf3 -sDp $PORT --affinity 1024 -1" 0 "MAX value for affinity!" ;sleep 2
rlWaitForCmd "killall $PACKAGE" -r 1 -m 10
} || rlLogInfo "Skipping few tests which require missing iperf3's optional feature: 'CPU affinity'"
> $log_client
rlRun "iperf3 --server --daemon --port $PORT" ;sleep 2
rlRun "iperf3 --client 127.0.0.1 --logfile $log_client --port $PORT" ;sleep 1
rlRun "iperf3 --client 127.0.0.1 -p $PORT" ;sleep 1
rlRun "iperf3 --client localhost -p $PORT --omit 3 -t 5" ;sleep 1
rlRun "iperf3 -c localhost -p $PORT -O5 --title 'pmosko_was_here'" ;sleep 1
rlRun "iperf3 -c localhost -p $PORT --no-delay -T ''" ;sleep 1
rlRun "test -s $log_client"
#woah, those are pretty stacked clients!!!
rlRun "iperf3 -c 127.0.0.1 -p $PORT -N -w200 $(opt_aff 0) -T'superclient-' -O1 -t15 -V $(opt_pac 0) -P2 $(opt_pac_timer 100)" ;sleep 1
rlRun "iperf3 -c localhost -p $PORT -J -w2000 $(opt_aff 0,$(($(nproc)-1))) -i3 --verbose -O1 -t20 --forceflush" ;sleep 1
> $log_client
rlRun "iperf3 -c localhost -p $PORT -w1 $(opt_aff 0) -i1 -R -l 1024K -N $(opt_zer) --get-server-output -O1 --logfile $log_client" ;sleep 1
rlAssertGrep "Server output" $log_client -i "logfile contains both clients and servers output"
# workaround, regression in f31+
if ! rlIsFedora '>=31'; then
rlRun "iperf3 -c 127.0.0.1 -p $PORT -i2 -V --forceflush --debug -l 1M -N --parallel 3 $(opt_dscp 0) $(opt_pac 0) -t 10 -T'dope'";sleep 1
fi
# Negative asserts, checking boundaries or option arguments, ... (only some)
rlRun "iperf3 -c localhost -p $PORT -n0 --parallel 129" 1 ;sleep 1
rlRun "rlWatchdog \"iperf3 -c localhost -p $PORT --parallel -10\" 30" 1 "negative --parallel argument usually hangs" ;sleep 1
rlRun "iperf3 -c localhost -p $PORT -n0 --parallel 129" 1 ;sleep 1
rlRun "iperf3 -c localhost -p $PORT -i -2" 1 "test min. vlaue boundary for printing interval (min is 0)" ;sleep 1
rlRun "iperf3 -c localhost -p $PORT -i 70" 1 "test max value for printing interval (max should be 60)" ;sleep 1
rlRun "iperf3 -c localhost -p $PORT -O -2" 1 "Bogus (negative) value for --omit option is invalid" ;sleep 1
rlPhaseEnd
}
########## CLEANUP PHASE ##########
rlPhaseStartCleanup
rlWaitForCmd "killall $PACKAGE" -r 1 -m 50
rlRun "rm -f $log_client $log_server" 0 "remove temporary files for storing output"
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -1,5 +0,0 @@
# QE owner
contact: Frantisek Hrdina <fhrdina@redhat.com>
component: iperf3
check:
- how: avc

View file

@ -1,5 +0,0 @@
summary: Run all tests
discover:
how: fmf
execute:
how: tmt

View file

@ -1,20 +0,0 @@
/public:
summary: Public other tests
discover:
how: fmf
filter: 'tier: -1 & tier: -2 & tier: -3 & tag: -multihost'
url: "https://src.fedoraproject.org/tests/iperf3.git"
execute:
how: tmt
/internal:
summary: Internal other tests
discover:
how: fmf
filter: 'tier: -1 & tier: -2 & tier: -3 & tag: -multihost'
url: https://gitlab.com/redhat/rhel/tests/iperf3
adjust:
enabled: false
when: distro == centos-stream or distro == fedora
execute:
how: tmt

View file

@ -1,20 +0,0 @@
/public:
summary: Public Tier1 tests
discover:
how: fmf
filter: 'tier: 1'
url: "https://src.fedoraproject.org/tests/iperf3.git"
execute:
how: tmt
/internal:
summary: Internal Tier1 tests
discover:
how: fmf
filter: 'tier: 1'
url: https://gitlab.com/redhat/rhel/tests/iperf3
adjust:
enabled: false
when: distro == centos-stream or distro == fedora
execute:
how: tmt

View file

@ -1,20 +0,0 @@
/public:
summary: Public Tier2 and Tier3 tests
discover:
how: fmf
filter: 'tier: 2 | tier: 3'
url: "https://src.fedoraproject.org/tests/iperf3.git"
execute:
how: tmt
/internal:
summary: Internal Tier2 and Tier3 tests
discover:
how: fmf
filter: 'tier: 2 | tier: 3'
url: https://gitlab.com/redhat/rhel/tests/iperf3
adjust:
enabled: false
when: distro == centos-stream or distro == fedora
execute:
how: tmt