Commit 3ade6ce1 authored by Vegard Nossum's avatar Vegard Nossum Committed by David S. Miller
Browse files

selftests: rds: add testing infrastructure



This adds some basic self-testing infrastructure for RDS-TCP.

Signed-off-by: default avatarVegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarAllison Henderson <allison.henderson@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bc75dcc3
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -75,6 +75,17 @@ Only files which are linked to the main kernel image or are compiled as
kernel modules are supported by this mechanism.


Module specific configs
-----------------------

Gcov kernel configs for specific modules are described below:

CONFIG_GCOV_PROFILE_RDS:
        Enables GCOV profiling on RDS for checking which functions or
        lines are executed. This config is used by the rds selftest to
        generate coverage reports. If left unset the report is omitted.


Files
-----

+1 −0
Original line number Diff line number Diff line
@@ -19197,6 +19197,7 @@ S: Supported
W:	https://oss.oracle.com/projects/rds/
F:	Documentation/networking/rds.rst
F:	net/rds/
F:	tools/testing/selftests/net/rds/
RDT - RESOURCE ALLOCATION
M:	Fenghua Yu <fenghua.yu@intel.com>
+1 −0
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ TARGETS += net/mptcp
TARGETS += net/openvswitch
TARGETS += net/tcp_ao
TARGETS += net/netfilter
TARGETS += net/rds
TARGETS += nsfs
TARGETS += perf_events
TARGETS += pidfd
+12 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0

all:
	@echo mk_build_dir="$(shell pwd)" > include.sh

TEST_PROGS := run.sh \
	include.sh \
	test.py

EXTRA_CLEAN := /tmp/rds_logs

include ../../lib.mk
+41 −0
Original line number Diff line number Diff line
RDS self-tests
==============

These scripts provide a coverage test for RDS-TCP by creating two
network namespaces and running rds packets between them. A loopback
network is provisioned with optional probability of packet loss or
corruption. A workload of 50000 hashes, each 64 characters in size,
are passed over an RDS socket on this test network. A passing test means
the RDS-TCP stack was able to recover properly.  The provided config.sh
can be used to compile the kernel with the necessary gcov options.  The
kernel may optionally be configured to omit the coverage report as well.

USAGE:
	run.sh [-d logdir] [-l packet_loss] [-c packet_corruption]
	       [-u packet_duplcate]

OPTIONS:
	-d	Log directory.  Defaults to tools/testing/selftests/net/rds/rds_logs

	-l	Simulates a percentage of packet loss

	-c	Simulates a percentage of packet corruption

	-u	Simulates a percentage of packet duplication.

EXAMPLE:

    # Create a suitable gcov enabled .config
    tools/testing/selftests/net/rds/config.sh -g

    # Alternatly create a gcov disabled .config
    tools/testing/selftests/net/rds/config.sh

    # build the kernel
    vng --build  --config tools/testing/selftests/net/config

    # launch the tests in a VM
    vng -v --rwdir ./ --run . --user root --cpus 4 -- \
        "export PYTHONPATH=tools/testing/selftests/net/; tools/testing/selftests/net/rds/run.sh"

An HTML coverage report will be output in tools/testing/selftests/net/rds/rds_logs/coverage/.
Loading