1
0
mirror of https://passt.top/passt synced 2024-06-27 13:32:41 +00:00
passt/test
David Gibson c4d8a77512 tests: qemu-system-ppc64le isn't a thing
Several tests run pp64le guests using "qemu-system-ppc64le".  But, at the
system level there's no difference between ppc64 and ppc64le - it's the
same hardware, just placed into different endian modes by OS early boot
code.  Reflecting that, qemu only supplies a single "qemu-system-ppc64".

Some distros alias qemu-system-ppc64le to qemu-system-ppc64 (Debian does),
but it's best not to count on this (Fedora doesn't, for example).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2022-07-14 01:32:42 +02:00
..
build tests: Simplify explicit checks for command success 2022-05-19 15:24:15 +02:00
demo test: Add external mbuto profile, drop udhcpc, and switch to it 2022-07-06 08:09:26 +02:00
dhcp Use dhclient instead of udhcpc 2022-06-15 09:38:10 +02:00
distro tests: qemu-system-ppc64le isn't a thing 2022-07-14 01:32:42 +02:00
env LICENSES: Add license text files, add missing notices, fix SPDX tags 2021-10-20 08:29:30 +02:00
icmp Don't abbreviate ip(8) arguments in examples and tests 2022-06-15 09:38:10 +02:00
lib test: Add external mbuto profile, drop udhcpc, and switch to it 2022-07-06 08:09:26 +02:00
ndp Don't abbreviate ip(8) arguments in examples and tests 2022-06-15 09:38:10 +02:00
perf test: Embed script for dhclient(8) in mbuto(1) profile 2022-07-14 01:31:28 +02:00
tcp tests: Use nmap-ncat instead of openbsd netcat for pasta tests 2022-06-18 09:05:06 +02:00
two_guests test: Embed script for dhclient(8) in mbuto(1) profile 2022-07-14 01:31:28 +02:00
udp tests: Use nmap-ncat instead of openbsd netcat for pasta tests 2022-06-18 09:05:06 +02:00
valgrind test, seccomp, Makefile: Switch to valgrind runs for passt functional tests 2022-03-29 15:35:38 +02:00
.gitignore Add basic .gitignore files 2022-05-19 15:24:09 +02:00
ci test: Add CI/demo scripts 2021-09-27 15:10:35 +02:00
passt.mbuto test: Embed script for dhclient(8) in mbuto(1) profile 2022-07-14 01:31:28 +02:00
README.md tests: Use nmap-ncat instead of openbsd netcat for pasta tests 2022-06-18 09:05:06 +02:00
run test/run: Return 0 from run(), exit value already reflects failures 2022-05-19 15:24:15 +02:00
run_demo test: Add CI/demo scripts 2021-09-27 15:10:35 +02:00
valgrind.supp test, seccomp, Makefile: Switch to valgrind runs for passt functional tests 2022-03-29 15:35:38 +02:00

Scope

This directory contains test cases for passt and pasta and a simple POSIX shell-based framework to define them, and run them as a suite.

These tests can be run as part of a continuous integration workflow, and are also used to provide short usage demos, with video recording, for passt and pasta basic use cases.

Run

Dependencies

Packages

The tests require some package dependencies commonly available in Linux distributions. If some packages are not available, the test groups that need them will be selectively skipped.

This is a non-exhaustive list of packages that might not commonly be installed on a system, i.e. common utilities such as a shell are not included here.

Example for Debian, and possibly most Debian-based distributions:

build-essential git jq strace iperf3 qemu-system-x86 tmux sipcalc bc
clang-tidy cppcheck isc-dhcp-common psmisc linux-cpupower ncat
netcat-openbsd fakeroot lz4 lm-sensors qemu-system-arm qemu-system-ppc
qemu-system-misc qemu-system-x86 valgrind

Other tools

Test measuring request-response and connect-request-response latencies use neper, which is not commonly packaged by distributions and needs to be built and installed manually:

git clone https://github.com/google/neper
cd neper; make
cp tcp_crr tcp_rr udp_rr /usr/local/bin

Virtual machine images are built during test executions using mbuto, the shell script is sourced via git as needed, so there's no need to actually install it.

Special requirements for continuous integration and demo modes

Running the test suite as continuous integration or demo modes will record the terminal with the steps being executed, using asciinema(1), and create binary packages.

The following additional packages are commonly needed:

alien asciinema linux-perf tshark

Regular test

Just issue:

./run

from the test directory. Elevated privileges are not needed. Environment variable settings: DEBUG=1 enables debugging messages, TRACE=1 enables tracing (further debugging messages), PCAP=1 enables packet captures. Example:

PCAP=1 TRACE=1 ./run

Continuous integration

Issuing:

./ci

will run the whole test suite while recording the execution, and it will also build JavaScript fragments used on http://passt.top/ for performance data tables and links to specific offsets in the captures.

Demo mode

Issuing:

./demo

will run the demo cases under demo, with terminal captures as well.

Framework

The implementation of the testing framework is under lib, and it provides facilities for terminal and tmux session management, interpretation of test directives, video recording, and suchlike. Test cases are organised in the remaining directories.

Test cases can be implemented as POSIX shell scripts, or as a set of directives, which are not formally documented here, but should be clear enough from the existing cases. The entry point for interpretation of test directives is implemented in lib/test.