Skip to content

Commit

Permalink
Upgrade iperf3 to 3.17.1 and deal with the fallout in the plugin. #1432
Browse files Browse the repository at this point in the history
… (#1433)
  • Loading branch information
mfeit-internet2 authored May 17, 2024
1 parent 467055a commit 184c574
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 8 deletions.
Binary file removed iperf3/iperf3-3.16.tar.gz
Binary file not shown.
Binary file added iperf3/iperf3-3.17.1.tar.gz
Binary file not shown.
6 changes: 6 additions & 0 deletions iperf3/unibuild-packaging/deb/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
iperf3 (3.17.1-1) perfsonar-5.1-staging; urgency=low

* New upstream version

-- Mark Feit <[email protected]> Wed, 15 May 2024 15:50:00 -0400

iperf3 (3.16-1) perfsonar-5.0-staging; urgency=low

* New upstream version
Expand Down
2 changes: 1 addition & 1 deletion iperf3/unibuild-packaging/rpm/iperf3.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#

Name: iperf3
Version: 3.16
Version: 3.17.1
Release: 1%{?dist}
Summary: Measurement tool for TCP/UDP bandwidth performance

Expand Down
19 changes: 18 additions & 1 deletion pscheduler-tool-iperf3/iperf3/participant-data
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#

import hashlib
import packaging.version
import pscheduler
import sys
import iperf3_utils
Expand All @@ -17,9 +18,25 @@ from cryptography.hazmat.backends import default_backend

json = pscheduler.json_load(exit_on_error=True)
result = {
"schema": 2
"schema": 3
}


# Provide the local iperf3 version

status, out, err = pscheduler.run_program(['iperf3', '--version'], timeout=2)
if status != 0:
pscheduler.fail(f'Unable to run iperf3: {err}')

try:
version_text = out.split()[1]
version = packaging.version.Version(version_text)
except (IndexError, packaging.version.InvalidVersion) as ex:
pscheduler.fail(str(ex))

result['iperf3-version'] = str(version)


try:
participant = json['participant']
except KeyError:
Expand Down
57 changes: 53 additions & 4 deletions pscheduler-tool-iperf3/iperf3/run
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import sys
import time
import threading
import iperf3_parser
import packaging.version
import tempfile
import traceback
import iperf3_utils
Expand Down Expand Up @@ -78,11 +79,51 @@ else:
# if we're doing a reverse test, have to change a few things
reverse = test_spec.get('reverse', False)


iperf3_first_args = [ iperf3_cmd ]


if participants > 1:

# iperf3 3.17 broke compatibility with 3.16 to fix a security
# vulnerability but has a switch to allow interoperability with older
# versions.

other_participant = 1 if participant == 0 else 0

# Any pScheduler that doesn't provide iperf3-version in its
# participant data is presumed to be using an iperf3 earlier than
# 3.17 that we'll call 0.0.

my_version = packaging.version.Version(participant_data[participant].get('iperf3-version', '0.0'))
other_version = packaging.version.Version(participant_data[other_participant].get('iperf3-version', '0.0'))
logger.debug(f'Local iperf3 is {my_version}, other is {other_version}')

# If the other end is believed-vulnerable and the local iperf3 has
# the compatibility switch, use it.

if other_version < packaging.version.Version('3.17') and my_version >= packaging.version.Version('3.17'):
logger.debug(f'Other side is using an old iperf3 ({other_version}); running in vulnerable mode')
iperf3_first_args.append('--use-pkcs1-padding')

else:

# Where there's one participant, we don't care. Loopback will
# work correctly because it's the same binary on both ends. For
# single-ended, opt for whatever the default behavior is because
# we can't tell what's on the other end. This may cause those
# tests to break.

logger.debug(f'Only one participant; running in iperf3 default mode')



def run_client():

diags = []

iperf3_args = [ iperf3_cmd ]
global iperf3_first_args
iperf3_args = iperf3_first_args.copy()

iperf3_args.append('-p')
iperf3_args.append(server_port)
Expand Down Expand Up @@ -309,9 +350,17 @@ def run_server():

diags = []
#init command
iperf3_args = [ iperf3_cmd, '-s', '-1', '--idle-timeout', str(test_duration), '--json']
iperf3_args.append("-p")
iperf3_args.append(server_port)

global iperf3_first_args
iperf3_args = iperf3_first_args.copy()

iperf3_args.extend([
'-s',
'-1',
'--idle-timeout', str(test_duration),
'--json',
'-p', server_port
])

#Determine if we need to bind to an address and have enough info to do so intelligently
ip_version = test_spec.get('ip-version', None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Requires: pscheduler-server >= 4.4.0
Requires: %{_pscheduler_python}-pscheduler >= 4.4.1
Requires: %{_pscheduler_python}-cryptography
Requires: pscheduler-test-throughput
requires: iperf3 >= 3.11
requires: iperf3 >= 3.17.1
Requires: numactl

BuildRequires: pscheduler-rpm
Expand Down
2 changes: 1 addition & 1 deletion unibuild-order
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ ifelse(DISTRO/eval(MAJOR <= 18),Ubuntu/1,, # Doesn't build on U18, TODO: no
HAVE_ETHR,1,ethr) # But D10 build can be used on U18 and up

iperf
ifelse(FAMILY/eval(MAJOR == 10 || MAJOR == 12),Debian/1,iperf3, # We only want iperf3 on D10 and D12
ifelse(FAMILY/eval(MAJOR == 12),Debian/1,iperf3, # We only want iperf3 on D12
FAMILY,Debian,,
iperf3)
nuttcp
Expand Down

0 comments on commit 184c574

Please sign in to comment.