259ef6348b
- On some hosts the wget can finish too soon and PAPI doesn't catch even a single network event. - On some hosts, there are multiple default NICs and the scripts didn't work in that case. - The test script was writing the output of wget to /tmp directory, which causes a problem if another user tries to run the same test. Because the output file with the same name already exists in the same directory, but with a different owner, the test fails --------- Co-authored-by: David Galiffi <David.Galiffi@amd.com>
20 lines
534 B
Bash
Executable File
20 lines
534 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Copyright (c) Advanced Micro Devices, Inc.
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
# This script gets the name of the default NIC and writes it to standard output.
|
|
# NOTE: if command "ip r" finds multiple default NICs, this script will output
|
|
# all of them.
|
|
nics=$(ip r | awk '/^default /{print $5}' | sort -u)
|
|
|
|
# nics="ens50f1 ens50f2 ens50f3 ens50f4" # For testing purposes only
|
|
# nics= # For testing purposes only
|
|
|
|
if [ -z "$nics" ]; then
|
|
echo "Error: no default route found" >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "$nics"
|