From: Jakub Kicinski <kuba@kernel.org>
To: Breno Leitao <leitao@debian.org>
Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
liuhangbin@gmail.com, petrm@nvidia.com, matttbe@kernel.org,
Shuah Khan <shuah@kernel.org>,
netdev@vger.kernel.org, Willem de Bruijn <willemb@google.com>,
David Wei <dw@davidwei.uk>,
linux-kernel@vger.kernel.org (open list),
linux-kselftest@vger.kernel.org (open list:KERNEL SELFTEST
FRAMEWORK)
Subject: Re: [PATCH net-next v5] net: netconsole: selftests: Create a new netconsole selftest
Date: Tue, 20 Aug 2024 16:06:36 -0700 [thread overview]
Message-ID: <20240820160636.7bfc4d5a@kernel.org> (raw)
In-Reply-To: <20240819090406.1441297-1-leitao@debian.org>
On Mon, 19 Aug 2024 02:03:53 -0700 Breno Leitao wrote:
> +function check_for_dependencies() {
> + if [ "$(id -u)" -ne 0 ]; then
> + echo "This test must be run as root" >&2
> + exit "${ksft_skip}"
> + fi
> +
> + if ! which socat > /dev/null ; then
> + echo "SKIP: socat(1) is not available" >&2
> + exit "${ksft_skip}"
> + fi
> +
> + if ! which ip > /dev/null ; then
> + echo "SKIP: ip(1) is not available" >&2
> + exit "${ksft_skip}"
> + fi
> +
> + if ! which udevadm > /dev/null ; then
> + echo "SKIP: udevadm(1) is not available" >&2
> + exit "${ksft_skip}"
> + fi
> +
> + if [ ! -d "${NETCONS_CONFIGFS}" ]; then
> + echo "SKIP: directory ${NETCONS_CONFIGFS} does not exist. Check if NETCONSOLE_DYNAMIC is enabled" >&2
> + exit "${ksft_skip}"
> + fi
> +
> + if ip link show "${DSTIF}" 2> /dev/null; then
> + echo "SKIP: interface ${DSTIF} exists in the system. Not overwriting it." >&2
> + exit "${ksft_skip}"
> + fi
nit: maybe ip addr list to see if the 192.168.1.x network is already in
use?
> +}
> +
> +# ========== #
> +# Start here #
> +# ========== #
> +modprobe netdevsim 2> /dev/null || true
> +modprobe netconsole 2 > /dev/null || true
> +
> +# The content of kmsg will be save to the following file
> +OUTPUT_FILE="/tmp/${TARGET}"
> +
> +# Check for basic system dependency and exit if not found
> +check_for_dependencies
> +# Set current loglevel to KERN_INFO(6), and default to KERN_NOTICE(5)
> +echo "6 5" > /proc/sys/kernel/printk
nit: should we not undo this in clenaup?
> +# Remove the namespace, interfaces and netconsole target on exit
> +trap cleanup EXIT
> +# Create one namespace and two interfaces
> +set_network
> +# Create a dynamic target for netconsole
> +create_dynamic_target
> +# Listed for netconsole port inside the namespace and destination interface
> +listen_port_and_save_to "${OUTPUT_FILE}" &
> +# Wait for socat to start and listen to the port.
> +wait_local_port_listen "${NAMESPACE}" "${PORT}" udp
> +# Send the message
> +echo "${MSG}: ${TARGET}" > /dev/kmsg
> +# Wait until socat saves the file to disk
> +busywait "${BUSYWAIT_TIMEOUT}" test -s "${OUTPUT_FILE}"
> +
> +# Make sure the message was received in the dst part
> +# and exit
> +validate_result "${OUTPUT_FILE}"
Main reason Im complaining, I see:
[ 6.686720] netconsole: unknown parameter '2' ignored
in the kernel logs when the test runs.
Is it expected?
--
pw-bot: cr
next prev parent reply other threads:[~2024-08-20 23:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-19 9:03 [PATCH net-next v5] net: netconsole: selftests: Create a new netconsole selftest Breno Leitao
2024-08-20 23:06 ` Jakub Kicinski [this message]
2024-08-21 7:58 ` Breno Leitao
2024-08-21 10:48 ` Petr Machata
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240820160636.7bfc4d5a@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=dw@davidwei.uk \
--cc=edumazet@google.com \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=liuhangbin@gmail.com \
--cc=matttbe@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@nvidia.com \
--cc=shuah@kernel.org \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).