public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
blob 72a49863f46b12f2265e784dd6214ab0239fa924 3789 bytes (raw)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
 
<!---
SPDX-License-Identifier: AGPL-3.0-or-later
Copyright (c) 2021-2022 Red Hat GmbH
Author: Stefano Brivio <sbrivio@redhat.com>
-->

# 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 socat
    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](https://mbuto.lameexcu.se/), the shell script is sourced via _git_
as needed, so there's no need to actually install it.

### Kernel parameters

Performance tests use iperf3 with rather large TCP receiving and sending
windows, to decrease the likelihood of iperf3 itself becoming the bottleneck.
These values need to be allowed by the kernel of the host running the tests.
Example for /etc/sysctl.conf:

  net.core.rmem_max = 134217728
  net.core.wmem_max = 134217728

Further, the passt demo uses perf(1), relying on hardware events for performance
counters, to display syscall overhead. The kernel needs to allow unprivileged
users to access these events. Suggested entry for /etc/sysctl.conf:

  kernel.perf_event_paranoid = -1

### 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`.

debug log:

solving 72a4986 ...
found 72a4986 in https://passt.top/passt

Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

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 IMAP folder(s).