<feed xmlns='http://www.w3.org/2005/Atom'>
<title>passt/test/lib, branch bug165c</title>
<subtitle>Plug A Simple Socket Transport</subtitle>
<link rel='alternate' type='text/html' href='https://passt.top/passt/'/>
<entry>
<title>test: Expand tmux right status bar to fit pass/fail/skipped counter and time</title>
<updated>2025-12-07T22:17:59+00:00</updated>
<author>
<name>Stefano Brivio</name>
<email>sbrivio@redhat.com</email>
</author>
<published>2025-12-04T21:59:34+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=7c7be67ddf264281f192084521af23a1c429dd99'/>
<id>7c7be67ddf264281f192084521af23a1c429dd99</id>
<content type='text'>
I recently realised I couldn't see seconds elapsing in asciinema test
recordings. That's because now that we display a SKIPPED counter, we
need some extra room for characters, 64 in total:

  PASS: xxx | FAIL: xxx | SKIPPED: xxx | YYYY-MM-DDThh:mm:ss+00:00

Fixes: 4234ace84cdf ("test: Display count of skipped tests in status and summary")
Signed-off-by: Stefano Brivio &lt;sbrivio@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>
I recently realised I couldn't see seconds elapsing in asciinema test
recordings. That's because now that we display a SKIPPED counter, we
need some extra room for characters, 64 in total:

  PASS: xxx | FAIL: xxx | SKIPPED: xxx | YYYY-MM-DDThh:mm:ss+00:00

Fixes: 4234ace84cdf ("test: Display count of skipped tests in status and summary")
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test: For missing static checkers, skip rather than failing tests</title>
<updated>2025-10-15T21:16:38+00:00</updated>
<author>
<name>David Gibson</name>
<email>david@gibson.dropbear.id.au</email>
</author>
<published>2025-10-10T03:45:49+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=6d84c90c8e32659d3b25fd352126889f33d66f1d'/>
<id>6d84c90c8e32659d3b25fd352126889f33d66f1d</id>
<content type='text'>
We run a bunch of static checkers as part of our testsuite.  That's useful,
but it means that if a user doesn't have one of them installed, it fails
the entire testsuite.  Alter our scripts to skip the test, rather than
failing outright if the checker tool is not installed.

This requires exeter v0.4.4 or later.

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>
We run a bunch of static checkers as part of our testsuite.  That's useful,
but it means that if a user doesn't have one of them installed, it fails
the entire testsuite.  Alter our scripts to skip the test, rather than
failing outright if the checker tool is not installed.

This requires exeter v0.4.4 or later.

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: Add some missing quoting in exeter runner</title>
<updated>2025-10-15T21:16:38+00:00</updated>
<author>
<name>David Gibson</name>
<email>david@gibson.dropbear.id.au</email>
</author>
<published>2025-10-10T03:45:48+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=5149f34902555852ff96a33ea377223d4b770ffe'/>
<id>5149f34902555852ff96a33ea377223d4b770ffe</id>
<content type='text'>
exeter() quoted ${__testid}, but in some places we use it there's an
extra level of shell, which needs another layer of quoting.  This breaks
if testids include ';', which is quite common in exeter tests created as
a composition/pipeline of two functions.  Add the required extra quoting.

While we're there, improve consistency with other scripts by always using
the optional {} around variable names.

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>
exeter() quoted ${__testid}, but in some places we use it there's an
extra level of shell, which needs another layer of quoting.  This breaks
if testids include ';', which is quite common in exeter tests created as
a composition/pipeline of two functions.  Add the required extra quoting.

While we're there, improve consistency with other scripts by always using
the optional {} around variable names.

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: Use ${} consistently in lib/exeter</title>
<updated>2025-10-15T21:16:38+00:00</updated>
<author>
<name>David Gibson</name>
<email>david@gibson.dropbear.id.au</email>
</author>
<published>2025-10-10T03:45:47+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=898cf50e94e596409869d57e58e29f1ff069664a'/>
<id>898cf50e94e596409869d57e58e29f1ff069664a</id>
<content type='text'>
Most of the test shell scripts use {} around variable names even when it's
not required, for consistency.  lib/exeter didn't do so consistently,
however.  Correct that.

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>
Most of the test shell scripts use {} around variable names even when it's
not required, for consistency.  lib/exeter didn't do so consistently,
however.  Correct that.

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: Fix printf error when debug is enabled</title>
<updated>2025-09-30T09:56:21+00:00</updated>
<author>
<name>Yumei Huang</name>
<email>yuhuang@redhat.com</email>
</author>
<published>2025-09-30T01:41:58+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=70867817a93353653e367010b18416040740e75c'/>
<id>70867817a93353653e367010b18416040740e75c</id>
<content type='text'>
Running test pasta/tcp with debug enabled would get stuck with
below error:

  + printf 'DEBUG: ns     socat -u OPEN:__BASEPATH__/big.bin TCP6:[__GW6__%__IFNAME__]:10003\n'
  lib/term: line 38: printf: `_': invalid format character

The error occurs because printf interprets the % character as the
start of a format specifier, and the following '_' isn't one of
them.

Fix it by replacing 'printf "${*}"' with 'printf "%b" "${*}"'.
Also update the docstring.

Link: https://bugs.passt.top/show_bug.cgi?id=154
Fixes: de28c20d8051 ("test: Update lib/term for clearer output when DEBUG is enabled")
Signed-off-by: Yumei Huang &lt;yuhuang@redhat.com&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>
Running test pasta/tcp with debug enabled would get stuck with
below error:

  + printf 'DEBUG: ns     socat -u OPEN:__BASEPATH__/big.bin TCP6:[__GW6__%__IFNAME__]:10003\n'
  lib/term: line 38: printf: `_': invalid format character

The error occurs because printf interprets the % character as the
start of a format specifier, and the following '_' isn't one of
them.

Fix it by replacing 'printf "${*}"' with 'printf "%b" "${*}"'.
Also update the docstring.

Link: https://bugs.passt.top/show_bug.cgi?id=154
Fixes: de28c20d8051 ("test: Update lib/term for clearer output when DEBUG is enabled")
Signed-off-by: Yumei Huang &lt;yuhuang@redhat.com&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: Update lib/term for clearer output when DEBUG is enabled</title>
<updated>2025-09-26T10:14:32+00:00</updated>
<author>
<name>Yumei Huang</name>
<email>yuhuang@redhat.com</email>
</author>
<published>2025-09-26T06:15:53+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=de28c20d8051735d0b828cedb8697c8ef65dd719'/>
<id>de28c20d8051735d0b828cedb8697c8ef65dd719</id>
<content type='text'>
When running tests with DEBUG=1, we used to get some
"DEBUG:DEBUG:DEBUG:" in logs, which is not very helpful for
debugging.

With this patch, the log would show the steps like below:

    DEBUG: g1tools  ip jq dhclient socat cat
    DEBUG: htools   ip jq
    DEBUG:
    DEBUG: set      MAP_HOST4 192.0.2.1
    DEBUG: set      MAP_HOST6 2001:db8:9a55::1

The problem here is that "${@}" is magic and expands to multiple
arguments, even though it's quoted.  That means instead of the whole
message going into a single string, the "DEBUG:" becomes the format
string and the rest goes into unused parameters.

Suggested-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Yumei Huang &lt;yuhuang@redhat.com&gt;
[dwg: root cause explanation in commit message]
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>
When running tests with DEBUG=1, we used to get some
"DEBUG:DEBUG:DEBUG:" in logs, which is not very helpful for
debugging.

With this patch, the log would show the steps like below:

    DEBUG: g1tools  ip jq dhclient socat cat
    DEBUG: htools   ip jq
    DEBUG:
    DEBUG: set      MAP_HOST4 192.0.2.1
    DEBUG: set      MAP_HOST6 2001:db8:9a55::1

The problem here is that "${@}" is magic and expands to multiple
arguments, even though it's quoted.  That means instead of the whole
message going into a single string, the "DEBUG:" becomes the format
string and the rest goes into unused parameters.

Suggested-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Yumei Huang &lt;yuhuang@redhat.com&gt;
[dwg: root cause explanation in commit message]
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: 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>treewide: By default, don't quit source after migration, keep sockets open</title>
<updated>2025-07-29T15:57:01+00:00</updated>
<author>
<name>Stefano Brivio</name>
<email>sbrivio@redhat.com</email>
</author>
<published>2025-07-17T08:38:17+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=a8782865c342eb2682cca292d5bf92b567344351'/>
<id>a8782865c342eb2682cca292d5bf92b567344351</id>
<content type='text'>
We are hitting an issue in the KubeVirt integration where some data is
still sent to the source instance even after migration is complete. As
we exit, the kernel closes our sockets and resets connections. The
resulting RST segments are sent to peers, effectively terminating
connections that were meanwhile migrated.

At the moment, this is not done intentionally, but in the future
KubeVirt might enable OVN-Kubernetes features where source and
destination nodes are explicitly getting mirrored traffic for a while,
in order to decrease migration downtime.

By default, don't quit after migration is completed on the source: the
previous behaviour can be enabled with the new, but deprecated,
--migrate-exit option. After migration (as source), the -1 / --one-off
option has no effect.

Also, by default, keep migrated TCP sockets open (in repair mode) as
long as we're running, and ignore events on any epoll descriptor
representing data channels. The previous behaviour can be enabled with
the new, equally deprecated, --migrate-no-linger option.

By keeping sockets open, and not exiting, we prevent the kernel
running on the source node to send out RST segments if further data
reaches us.

Reported-by: Nir Dothan &lt;ndothan@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 are hitting an issue in the KubeVirt integration where some data is
still sent to the source instance even after migration is complete. As
we exit, the kernel closes our sockets and resets connections. The
resulting RST segments are sent to peers, effectively terminating
connections that were meanwhile migrated.

At the moment, this is not done intentionally, but in the future
KubeVirt might enable OVN-Kubernetes features where source and
destination nodes are explicitly getting mirrored traffic for a while,
in order to decrease migration downtime.

By default, don't quit after migration is completed on the source: the
previous behaviour can be enabled with the new, but deprecated,
--migrate-exit option. After migration (as source), the -1 / --one-off
option has no effect.

Also, by default, keep migrated TCP sockets open (in repair mode) as
long as we're running, and ignore events on any epoll descriptor
representing data channels. The previous behaviour can be enabled with
the new, equally deprecated, --migrate-no-linger option.

By keeping sockets open, and not exiting, we prevent the kernel
running on the source node to send out RST segments if further data
reaches us.

Reported-by: Nir Dothan &lt;ndothan@redhat.com&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/perf: Simplify iperf3 server lifetime management</title>
<updated>2025-03-12T22:08:33+00:00</updated>
<author>
<name>David Gibson</name>
<email>david@gibson.dropbear.id.au</email>
</author>
<published>2025-03-12T05:26:57+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=78f1f0fdfc1831f2ca3a65c2cee98c44ff3c30ab'/>
<id>78f1f0fdfc1831f2ca3a65c2cee98c44ff3c30ab</id>
<content type='text'>
After we start the iperf3 server in the background, we have a sleep to
make sure it's ready to receive connections.  We can simplify this slightly
by using the -D option to have iperf3 background itself rather than
backgrounding it manually.  That won't return until the server is ready to
use.

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>
After we start the iperf3 server in the background, we have a sleep to
make sure it's ready to receive connections.  We can simplify this slightly
by using the -D option to have iperf3 background itself rather than
backgrounding it manually.  That won't return until the server is ready to
use.

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>
</feed>
