<feed xmlns='http://www.w3.org/2005/Atom'>
<title>passt/test/lib/term, 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: 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: 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: Pass TRACE from run_term() into ./run from_term</title>
<updated>2024-10-10T03:25:19+00:00</updated>
<author>
<name>Stefano Brivio</name>
<email>sbrivio@redhat.com</email>
</author>
<published>2024-10-04T16:50:43+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=7612cb80fe80c089b25245e12a5e934f772480f8'/>
<id>7612cb80fe80c089b25245e12a5e934f772480f8</id>
<content type='text'>
Just like we do for PCAP, DEBUG and KERNEL. Otherwise, running tests
with TRACE=1 will not actually enable tracing output.

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>
Just like we do for PCAP, DEBUG and KERNEL. Otherwise, running tests
with TRACE=1 will not actually enable tracing output.

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/lib/term: Always use printf for messages with escape sequences</title>
<updated>2024-10-10T03:25:00+00:00</updated>
<author>
<name>Stefano Brivio</name>
<email>sbrivio@redhat.com</email>
</author>
<published>2024-10-08T20:40:58+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=b40880c157ea12ccfc93266cc08252be1aaedaa9'/>
<id>b40880c157ea12ccfc93266cc08252be1aaedaa9</id>
<content type='text'>
...instead of echo: otherwise, bash won't handle escape sequences we
use to colour messages (and 'echo -e' is not specified by POSIX).

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>
...instead of echo: otherwise, bash won't handle escape sequences we
use to colour messages (and 'echo -e' is not specified by POSIX).

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: Kernel binary can now be passed via the KERNEL environmental variable</title>
<updated>2024-10-02T12:50:34+00:00</updated>
<author>
<name>Stefano Brivio</name>
<email>sbrivio@redhat.com</email>
</author>
<published>2024-09-27T16:43:16+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=def8acdcd846582df5939446be0d73d50971ab18'/>
<id>def8acdcd846582df5939446be0d73d50971ab18</id>
<content type='text'>
This is quite useful at least for myself as I'm usually running tests
using a guest kernel that's not the same as the one on the host.

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>
This is quite useful at least for myself as I'm usually running tests
using a guest kernel that's not the same as the one on the host.

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: Speed up by cutting on eye candy and performance test duration</title>
<updated>2024-08-15T07:13:15+00:00</updated>
<author>
<name>Stefano Brivio</name>
<email>sbrivio@redhat.com</email>
</author>
<published>2024-08-14T17:25:38+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=946206437a215ca5ce5020ff1e745e237f27f3e7'/>
<id>946206437a215ca5ce5020ff1e745e237f27f3e7</id>
<content type='text'>
We have a number of delays when we switch to new layouts that were
added to make the tests visually easier to follow, together with
blinking status bars. Shorten the delays and avoid blinking the
status bar if $FAST is set to 1 (no demo mode).

Shorten delays in busy loops to 10ms, instead of 100ms, and skip the
one-second fixed delay when we wait for the status of a command.

Cut the duration of throughput and latency tests to one second, down
from ten. Somewhat surprisingly, the results we get are rather
consistent, and not significantly different from what we'd get with
10 seconds.

This, together with Podman's commit 20f3e8909e3a ("test/system:
pasta_test_do add explicit port check"), cuts the time needed on my
setup for full test run from approximately 37 minutes to...:

  $ time ./run
  [exited]
  PASS: 165, FAIL: 0
  Log at /home/sbrivio/passt/test/test_logs/test.log

  real	15m34.253s
  user	0m0.011s
  sys	0m0.011s

Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Tested-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We have a number of delays when we switch to new layouts that were
added to make the tests visually easier to follow, together with
blinking status bars. Shorten the delays and avoid blinking the
status bar if $FAST is set to 1 (no demo mode).

Shorten delays in busy loops to 10ms, instead of 100ms, and skip the
one-second fixed delay when we wait for the status of a command.

Cut the duration of throughput and latency tests to one second, down
from ten. Somewhat surprisingly, the results we get are rather
consistent, and not significantly different from what we'd get with
10 seconds.

This, together with Podman's commit 20f3e8909e3a ("test/system:
pasta_test_do add explicit port check"), cuts the time needed on my
setup for full test run from approximately 37 minutes to...:

  $ time ./run
  [exited]
  PASS: 165, FAIL: 0
  Log at /home/sbrivio/passt/test/test_logs/test.log

  real	15m34.253s
  user	0m0.011s
  sys	0m0.011s

Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Tested-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test: Make handling of shell prompts with escapes a little more reliable</title>
<updated>2023-12-07T06:24:48+00:00</updated>
<author>
<name>David Gibson</name>
<email>david@gibson.dropbear.id.au</email>
</author>
<published>2023-11-23T01:52:53+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=d491a4099b8db6199225812562b4dfc315accc6d'/>
<id>d491a4099b8db6199225812562b4dfc315accc6d</id>
<content type='text'>
When using the old-style "pane" methods of executing commands during the
tests, we need to scan the shell output for prompts in order to tell when
commands have finished.  This is inherently unreliable because commands
could output things that look like prompts, and prompts might not look like
we expect them to.  The only way to really fix this is to use a better way
of dispatching commands, like the newer "context" system.

However, it's awkward to convert everything to "context" right at the
moment, so we're still relying on some tests that do work most of the time.
It is, however, particularly sensitive to fancy coloured prompts using
escape sequences.  Currently we try to handle this by stripping actual
ESC characters with tr, then looking for some common variants.

We can do a bit better: instead strip all escape sequences using sed before
looking for our prompt.  Or, at least, any one using [a-zA-Z] as the
terminating character. Strictly speaking ANSI escapes can be terminated by
any character in 0x40..0x7e, which isn't easily expressed in a regexp.
This should capture all common ones, though.

With this transformation we can simplify the list of patterns we then look
for as a prompt, removing some redundant variants.

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>
When using the old-style "pane" methods of executing commands during the
tests, we need to scan the shell output for prompts in order to tell when
commands have finished.  This is inherently unreliable because commands
could output things that look like prompts, and prompts might not look like
we expect them to.  The only way to really fix this is to use a better way
of dispatching commands, like the newer "context" system.

However, it's awkward to convert everything to "context" right at the
moment, so we're still relying on some tests that do work most of the time.
It is, however, particularly sensitive to fancy coloured prompts using
escape sequences.  Currently we try to handle this by stripping actual
ESC characters with tr, then looking for some common variants.

We can do a bit better: instead strip all escape sequences using sed before
looking for our prompt.  Or, at least, any one using [a-zA-Z] as the
terminating character. Strictly speaking ANSI escapes can be terminated by
any character in 0x40..0x7e, which isn't easily expressed in a regexp.
This should capture all common ones, though.

With this transformation we can simplify the list of patterns we then look
for as a prompt, removing some redundant variants.

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>passt: Relicense to GPL 2.0, or any later version</title>
<updated>2023-04-06T16:00:33+00:00</updated>
<author>
<name>Stefano Brivio</name>
<email>sbrivio@redhat.com</email>
</author>
<published>2023-04-05T18:11:44+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=ca2749e1bd520c6a1dbca24f1561ee31dd833a54'/>
<id>ca2749e1bd520c6a1dbca24f1561ee31dd833a54</id>
<content type='text'>
In practical terms, passt doesn't benefit from the additional
protection offered by the AGPL over the GPL, because it's not
suitable to be executed over a computer network.

Further, restricting the distribution under the version 3 of the GPL
wouldn't provide any practical advantage either, as long as the passt
codebase is concerned, and might cause unnecessary compatibility
dilemmas.

Change licensing terms to the GNU General Public License Version 2,
or any later version, with written permission from all current and
past contributors, namely: myself, David Gibson, Laine Stump, Andrea
Bolognani, Paul Holzinger, Richard W.M. Jones, Chris Kuhn, Florian
Weimer, Giuseppe Scrivano, Stefan Hajnoczi, and Vasiliy Ulyanov.

Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In practical terms, passt doesn't benefit from the additional
protection offered by the AGPL over the GPL, because it's not
suitable to be executed over a computer network.

Further, restricting the distribution under the version 3 of the GPL
wouldn't provide any practical advantage either, as long as the passt
codebase is concerned, and might cause unnecessary compatibility
dilemmas.

Change licensing terms to the GNU General Public License Version 2,
or any later version, with written permission from all current and
past contributors, namely: myself, David Gibson, Laine Stump, Andrea
Bolognani, Paul Holzinger, Richard W.M. Jones, Chris Kuhn, Florian
Weimer, Giuseppe Scrivano, Stefan Hajnoczi, and Vasiliy Ulyanov.

Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
