<feed xmlns='http://www.w3.org/2005/Atom'>
<title>passt/test/run, branch 2026_12_04.a39d958</title>
<subtitle>Plug A Simple Socket Transport</subtitle>
<link rel='alternate' type='text/html' href='https://passt.top/passt/'/>
<entry>
<title>netlink: Fix gateway selection for multipath default routes</title>
<updated>2026-12-02T21:36:25+00:00</updated>
<author>
<name>Benjamin Schubert</name>
<email>bschubert15@bloomberg.net</email>
</author>
<published>2026-12-01T14:07:58+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=05d3780b82d858041f982a276db0de7167f8b661'/>
<id>05d3780b82d858041f982a276db0de7167f8b661</id>
<content type='text'>
The documentation of `--gateway` in `passt.1` states that
for a multipath default route, the first nexthop router returned
by the kernel with the highest weight is selected.

`nl_route_get_def_multipath()` however allowed a subsequent route with
the same weight to override the nexthop, so it was the last gateway
with a nexthop that would actually be chosen.

This aligns the code with the documentation, by fixing the code to
only select a new gateway if it has strictly a higher weight.

Also update the selected weight only after finding a gateway.
Since a device-only nexthop is not a gateway candidate, it must
not prevent a subsequent gateway from being selected.

Add 7 tests for various ipv4 and ipv6 scenarios with multipath
gateways. Note that ipv6 with no default gateway is not accepted by
the kernel, and thus ipv6 has one less test.
All 7 tests fail before this change.

Link: https://bugs.passt.top/show_bug.cgi?id=230
Signed-off-by: Benjamin Schubert &lt;bschubert15@bloomberg.net&gt;
[sbrivio: Fix typos in commit message]
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The documentation of `--gateway` in `passt.1` states that
for a multipath default route, the first nexthop router returned
by the kernel with the highest weight is selected.

`nl_route_get_def_multipath()` however allowed a subsequent route with
the same weight to override the nexthop, so it was the last gateway
with a nexthop that would actually be chosen.

This aligns the code with the documentation, by fixing the code to
only select a new gateway if it has strictly a higher weight.

Also update the selected weight only after finding a gateway.
Since a device-only nexthop is not a gateway candidate, it must
not prevent a subsequent gateway from being selected.

Add 7 tests for various ipv4 and ipv6 scenarios with multipath
gateways. Note that ipv6 with no default gateway is not accepted by
the kernel, and thus ipv6 has one less test.
All 7 tests fail before this change.

Link: https://bugs.passt.top/show_bug.cgi?id=230
Signed-off-by: Benjamin Schubert &lt;bschubert15@bloomberg.net&gt;
[sbrivio: Fix typos in commit message]
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>conf: Follow changes to the host nameserver used for DNS forwarding</title>
<updated>2026-11-29T23:37:09+00:00</updated>
<author>
<name>Aditya Merchant</name>
<email>adityamerchant08@gmail.com</email>
</author>
<published>2026-11-13T11:21:13+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=f6d66985479641283059841b71966f84b5188890'/>
<id>f6d66985479641283059841b71966f84b5188890</id>
<content type='text'>
We read the host's /etc/resolv.conf once, at start, and forward queries
sent to the --dns-forward address to the first nameserver listed there.
If the host then joins another network, connects to a VPN, or pasta
starts before the network is configured, that nameserver goes stale and
name resolution in the namespace stops working until pasta restarts.
With rootless Podman, that means stopping every container using the
rootless network namespace.

In pasta mode, if we forward DNS queries for an IP version, and the host
nameserver for it comes from resolv.conf (no --dns-host or --dns), watch
resolv.conf with inotify and read it again as it changes, so that new
DNS flows go to its current first nameserver. Watch the directory, not
the file, as NetworkManager and others replace resolv.conf by renaming
a new file over it. If resolv.conf is a symbolic link, watch the
directory of its target, as long as that's also called resolv.conf:
the other usual target, systemd-resolved's stub-resolv.conf, always
points to its local stub resolver anyway.

Once sandboxed, we can't open files by path, and keeping a descriptor
for the directory would undo the filesystem isolation: lookups of ".."
from it reach the rest of the host filesystem. Instead, right after
isolate_prefork() unshares our mount namespace, and before mounts become
unbindable, take a detached copy of the directory with open_tree() and
OPEN_TREE_CLONE: lookups from its root can't go above it, so the
directory holding resolv.conf is all we can still see. Make that copy
read-only, and only ever open resolv.conf from it. This needs Linux 5.12
or later: if any step fails, or if we can't read resolv.conf through the
copy, we don't follow changes.

AppArmor resolves paths of files on a detached mount relative to their
filesystem, so allow the usual locations of resolv.conf under /run with
paths relative to /run, too. For SELinux, allow watching /etc, and the
directories under /run used by NetworkManager and systemd-resolved.

Flows that already exist keep their target, so a client reusing the
same source port keeps reaching the old nameserver until its flow
expires.

The new test replaces resolv.conf on an overlay mounted on /etc, in a
separate mount namespace, and checks that we pick up the new nameserver.

Link: https://github.com/podman-container-tools/podman/issues/29130
Link: https://archives.passt.top/passt-dev/20230121104703.3ebcc753@elisabeth/
Signed-off-by: Aditya Merchant &lt;adityamerchant08@gmail.com&gt;
Reviewed-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We read the host's /etc/resolv.conf once, at start, and forward queries
sent to the --dns-forward address to the first nameserver listed there.
If the host then joins another network, connects to a VPN, or pasta
starts before the network is configured, that nameserver goes stale and
name resolution in the namespace stops working until pasta restarts.
With rootless Podman, that means stopping every container using the
rootless network namespace.

In pasta mode, if we forward DNS queries for an IP version, and the host
nameserver for it comes from resolv.conf (no --dns-host or --dns), watch
resolv.conf with inotify and read it again as it changes, so that new
DNS flows go to its current first nameserver. Watch the directory, not
the file, as NetworkManager and others replace resolv.conf by renaming
a new file over it. If resolv.conf is a symbolic link, watch the
directory of its target, as long as that's also called resolv.conf:
the other usual target, systemd-resolved's stub-resolv.conf, always
points to its local stub resolver anyway.

Once sandboxed, we can't open files by path, and keeping a descriptor
for the directory would undo the filesystem isolation: lookups of ".."
from it reach the rest of the host filesystem. Instead, right after
isolate_prefork() unshares our mount namespace, and before mounts become
unbindable, take a detached copy of the directory with open_tree() and
OPEN_TREE_CLONE: lookups from its root can't go above it, so the
directory holding resolv.conf is all we can still see. Make that copy
read-only, and only ever open resolv.conf from it. This needs Linux 5.12
or later: if any step fails, or if we can't read resolv.conf through the
copy, we don't follow changes.

AppArmor resolves paths of files on a detached mount relative to their
filesystem, so allow the usual locations of resolv.conf under /run with
paths relative to /run, too. For SELinux, allow watching /etc, and the
directories under /run used by NetworkManager and systemd-resolved.

Flows that already exist keep their target, so a client reusing the
same source port keeps reaching the old nameserver until its flow
expires.

The new test replaces resolv.conf on an overlay mounted on /etc, in a
separate mount namespace, and checks that we pick up the new nameserver.

Link: https://github.com/podman-container-tools/podman/issues/29130
Link: https://archives.passt.top/passt-dev/20230121104703.3ebcc753@elisabeth/
Signed-off-by: Aditya Merchant &lt;adityamerchant08@gmail.com&gt;
Reviewed-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pasta: Add --no-pidns to keep spawned command in caller's PID namespace</title>
<updated>2026-09-16T08:54:02+00:00</updated>
<author>
<name>Christian Korneck</name>
<email>christian@korneck.de</email>
</author>
<published>2026-09-06T13:17:58+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=588b545dae741bec6fd7622a33c7852c06d72a59'/>
<id>588b545dae741bec6fd7622a33c7852c06d72a59</id>
<content type='text'>
This is to allow running pasta inside a container without unmasking
/proc for the whole container (Docker's --security-opt
systempaths=unconfined, Podman's --security-opt unmask=ALL), which is
undesirable as it exposes /proc/sysrq-trigger and other masked paths.

In spawn mode, pasta clones the command with CLONE_NEWPID and mounts a
new procfs instance on /proc, so that it matches the new PID namespace.

Mounting procfs in a new user namespace requires a fully visible,
unobstructed procfs. Container runtimes deliberately obstruct /proc
(Docker, for example, masks /proc/kcore and friends and mounts
/proc/sys read-only), so the mount is refused:

  Couldn't mount /proc: Operation not permitted

We only warn and continue, leaving the command in a new PID namespace
while the visible /proc still numbers processes in the outer one.
Anything resolving its own PID through /proc then fails, for example
bubblewrap:

  bwrap: open /proc/22/ns/ns failed: No such file or directory

Add a --no-pidns option: skip CLONE_NEWPID for the spawned command and
don't mount /proc, which is then not needed. User, network, mount, UTS
and IPC namespaces, --config-net and port forwarding are unaffected.
The option is rejected together with PID or --netns, as it only makes
sense when we spawn the command ourselves.

Add a test checking that, by default, the command runs in a new PID
namespace, and that --no-pidns keeps it in the caller's one.

Signed-off-by: Christian Korneck &lt;christian@korneck.de&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is to allow running pasta inside a container without unmasking
/proc for the whole container (Docker's --security-opt
systempaths=unconfined, Podman's --security-opt unmask=ALL), which is
undesirable as it exposes /proc/sysrq-trigger and other masked paths.

In spawn mode, pasta clones the command with CLONE_NEWPID and mounts a
new procfs instance on /proc, so that it matches the new PID namespace.

Mounting procfs in a new user namespace requires a fully visible,
unobstructed procfs. Container runtimes deliberately obstruct /proc
(Docker, for example, masks /proc/kcore and friends and mounts
/proc/sys read-only), so the mount is refused:

  Couldn't mount /proc: Operation not permitted

We only warn and continue, leaving the command in a new PID namespace
while the visible /proc still numbers processes in the outer one.
Anything resolving its own PID through /proc then fails, for example
bubblewrap:

  bwrap: open /proc/22/ns/ns failed: No such file or directory

Add a --no-pidns option: skip CLONE_NEWPID for the spawned command and
don't mount /proc, which is then not needed. User, network, mount, UTS
and IPC namespaces, --config-net and port forwarding are unaffected.
The option is rejected together with PID or --netns, as it only makes
sense when we spawn the command ourselves.

Add a test checking that, by default, the command runs in a new PID
namespace, and that --no-pidns keeps it in the caller's one.

Signed-off-by: Christian Korneck &lt;christian@korneck.de&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pasta: Regression test for bug 216</title>
<updated>2026-07-23T09:47:08+00:00</updated>
<author>
<name>Dwayne B. Bent</name>
<email>dbb@dbb.dev</email>
</author>
<published>2026-07-22T15:32:42+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=37a73a24512f967665d1d018d340f999ed888127'/>
<id>37a73a24512f967665d1d018d340f999ed888127</id>
<content type='text'>
Adds a test that asserts that when pasta is invoked via `unshare -r` in
standalone mode with `--netns-only` it does not print any warnings, and
the command executes successfully.

Link: https://bugs.passt.top/show_bug.cgi?id=216
Assisted-by: Codex:gpt-5.6-sol
Signed-off-by: Dwayne B. Bent &lt;dbb@dbb.dev&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adds a test that asserts that when pasta is invoked via `unshare -r` in
standalone mode with `--netns-only` it does not print any warnings, and
the command executes successfully.

Link: https://bugs.passt.top/show_bug.cgi?id=216
Assisted-by: Codex:gpt-5.6-sol
Signed-off-by: Dwayne B. Bent &lt;dbb@dbb.dev&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test: Convert build tests to exeter</title>
<updated>2025-09-05T11:00:17+00:00</updated>
<author>
<name>David Gibson</name>
<email>david@gibson.dropbear.id.au</email>
</author>
<published>2025-09-05T06:43:15+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=ffe34d28d53790d2d5a258587f9410d835ab0049'/>
<id>ffe34d28d53790d2d5a258587f9410d835ab0049</id>
<content type='text'>
Convert the tests in build/all to be based on exeter.  The new version of
the tests is more robust than the original, since it makes a temporary copy
of the source tree so will not be affected by concurrent manual builds.

Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Convert the tests in build/all to be based on exeter.  The new version of
the tests is more robust than the original, since it makes a temporary copy
of the source tree so will not be affected by concurrent manual builds.

Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test: Run static checkers as exeter tests</title>
<updated>2025-09-05T11:00:15+00:00</updated>
<author>
<name>David Gibson</name>
<email>david@gibson.dropbear.id.au</email>
</author>
<published>2025-09-05T06:43:14+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=a58e60e83e31bd5c32b965eb9adabe99e781cb5d'/>
<id>a58e60e83e31bd5c32b965eb9adabe99e781cb5d</id>
<content type='text'>
Move the static checkers from the current DSL to exeter.

Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move the static checkers from the current DSL to exeter.

Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test: Extend test scripts to allow running exeter tests.</title>
<updated>2025-09-05T11:00:04+00:00</updated>
<author>
<name>David Gibson</name>
<email>david@gibson.dropbear.id.au</email>
</author>
<published>2025-09-05T06:43:13+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=a283ef47b9b3d525e54d1679f0bbc68ed5498e27'/>
<id>a283ef47b9b3d525e54d1679f0bbc68ed5498e27</id>
<content type='text'>
Introduce some trivial testcases based on the exeter library.  These run
passt and pasta with --help and --version options.  Extend our test
scripts to run these tests.

Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introduce some trivial testcases based on the exeter library.  These run
passt and pasta with --help and --version options.  Extend our test
scripts to run these tests.

Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test: Display count of skipped tests in status and summary</title>
<updated>2025-05-15T16:06:19+00:00</updated>
<author>
<name>Laurent Vivier</name>
<email>lvivier@redhat.com</email>
</author>
<published>2025-05-14T13:45:09+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=4234ace84cdf989cbcdb96a8165221dc83a11c85'/>
<id>4234ace84cdf989cbcdb96a8165221dc83a11c85</id>
<content type='text'>
This commit enhances test reporting by tracking and displaying the
number of skipped tests.

The skipped test count is now visible in the tmux status bar during
execution and included in the final test summary log. This provides
a more complete overview of test suite results.

Signed-off-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit enhances test reporting by tracking and displaying the
number of skipped tests.

The skipped test count is now visible in the tmux status bar during
execution and included in the final test summary log. This provides
a more complete overview of test suite results.

Signed-off-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test: Add migration tests</title>
<updated>2025-02-17T07:29:36+00:00</updated>
<author>
<name>Stefano Brivio</name>
<email>sbrivio@redhat.com</email>
</author>
<published>2025-02-13T12:14:14+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=a1e48a02ff3550eb7875a7df6726086e9b3a1213'/>
<id>a1e48a02ff3550eb7875a7df6726086e9b3a1213</id>
<content type='text'>
PCAP=1 ./run migrate/bidirectional gives an overview of how the
whole thing is working.

Add 12 tests in total, checking basic functionality with and without
flows in both directions, with and without sockets in half-closed
states (both inbound and outbound), migration behaviour under traffic
flood, under traffic flood with &gt; 253 flows, and strict checking of
sequences under flood with ramp patterns in both directions.

These tests need preparation and teardown for each case, as we need
to restore the source guest in its own context and pane before we can
test again. Eventually, we could consider alternating source and
target so that we don't need to restart from scratch every time, but
that's beyond the scope of this initial test implementation.

Trick: './run migrate/*' runs all the tests with preparation and
teardown steps.

Co-authored-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PCAP=1 ./run migrate/bidirectional gives an overview of how the
whole thing is working.

Add 12 tests in total, checking basic functionality with and without
flows in both directions, with and without sockets in half-closed
states (both inbound and outbound), migration behaviour under traffic
flood, under traffic flood with &gt; 253 flows, and strict checking of
sequences under flood with ramp patterns in both directions.

These tests need preparation and teardown for each case, as we need
to restore the source guest in its own context and pane before we can
test again. Eventually, we could consider alternating source and
target so that we don't need to restart from scratch every time, but
that's beyond the scope of this initial test implementation.

Trick: './run migrate/*' runs all the tests with preparation and
teardown steps.

Co-authored-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test: Add tests for passt in vhost-user mode</title>
<updated>2024-11-27T15:49:21+00:00</updated>
<author>
<name>Stefano Brivio</name>
<email>sbrivio@redhat.com</email>
</author>
<published>2024-11-22T16:43:35+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=676bf5488ec4bd4312dbae4be1a1bb2ed02bd2ba'/>
<id>676bf5488ec4bd4312dbae4be1a1bb2ed02bd2ba</id>
<content type='text'>
Run functional and performance tests for vhost-user mode as well. For
functional tests, we add passt_vu and passt_vu_in_ns as symbolic links
to their non-vhost-user counterparts, as no differences are intended
but we want to distinguish them in test logs.

For performance tests, instead, we add separate perf/passt_vu_tcp and
perf/passt_vu_udp files, as we need longer test duration, as well as
higher UDP sending bandwidths and larger TCP windows, to actually get
the highest throughput vhost-user mode offers.

For valgrind tests, vhost-user mode needs two extra system calls:
statx and readlink. Add them as EXTRA_SYSCALLS for the valgrind
target.

Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
Signed-off-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Run functional and performance tests for vhost-user mode as well. For
functional tests, we add passt_vu and passt_vu_in_ns as symbolic links
to their non-vhost-user counterparts, as no differences are intended
but we want to distinguish them in test logs.

For performance tests, instead, we add separate perf/passt_vu_tcp and
perf/passt_vu_udp files, as we need longer test duration, as well as
higher UDP sending bandwidths and larger TCP windows, to actually get
the highest throughput vhost-user mode offers.

For valgrind tests, vhost-user mode needs two extra system calls:
statx and readlink. Add them as EXTRA_SYSCALLS for the valgrind
target.

Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
Signed-off-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
</pre>
</div>
</content>
</entry>
</feed>
