<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/test, branch next</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>cmd: test: add bug-compatibility special case for 'test -n'</title>
<updated>2026-04-02T22:00:29+00:00</updated>
<author>
<name>Rasmus Villemoes</name>
<email>ravi@prevas.dk</email>
</author>
<published>2026-03-30T14:01:06+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=f7e7c55e53e80100c327b9cb0512c069acf80ab5'/>
<id>f7e7c55e53e80100c327b9cb0512c069acf80ab5</id>
<content type='text'>
It turns out that there is lots of code in the wild, including in the
U-Boot tree itself, which used to rely on

  test -n $somevar

to yield false when $somevar is not defined or empty. See for example
all the occurrences of 'test -n $fdtfile'. That was really only a
quirk of the implementation that refused calls with argc &lt; 3, and not
because it was interpreted as

  test -n "$somevar"

which is how this should be spelled.

While not exactly conforming to POSIX, we can accomodate such scripts
by special-casing a single argument "-n" to be interpreted as if it
comes from code as above with empty $somevar.

Since we only just added the ability to test a string for emptiness
using the single-argument form, it is very unlikely that there is code
doing

  test "$str"

which would now fail if $str happens to be exactly "-n"; such a test
should really always be spelled

  test -n "$str"

Fixes: 8b0619579b2 ("cmd: test: fix handling of single-argument form of test")
Reported-by: Franz Schnyder &lt;franz.schnyder@toradex.com&gt;
Signed-off-by: Rasmus Villemoes &lt;ravi@prevas.dk&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It turns out that there is lots of code in the wild, including in the
U-Boot tree itself, which used to rely on

  test -n $somevar

to yield false when $somevar is not defined or empty. See for example
all the occurrences of 'test -n $fdtfile'. That was really only a
quirk of the implementation that refused calls with argc &lt; 3, and not
because it was interpreted as

  test -n "$somevar"

which is how this should be spelled.

While not exactly conforming to POSIX, we can accomodate such scripts
by special-casing a single argument "-n" to be interpreted as if it
comes from code as above with empty $somevar.

Since we only just added the ability to test a string for emptiness
using the single-argument form, it is very unlikely that there is code
doing

  test "$str"

which would now fail if $str happens to be exactly "-n"; such a test
should really always be spelled

  test -n "$str"

Fixes: 8b0619579b2 ("cmd: test: fix handling of single-argument form of test")
Reported-by: Franz Schnyder &lt;franz.schnyder@toradex.com&gt;
Signed-off-by: Rasmus Villemoes &lt;ravi@prevas.dk&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test: Correct dependencies for SPL_UNIT_TEST</title>
<updated>2026-03-30T22:59:17+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2026-03-17T01:24:54+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=2ee6606f3576d017ce2b914b3d4f858de562bebe'/>
<id>2ee6606f3576d017ce2b914b3d4f858de562bebe</id>
<content type='text'>
As exposed by "make randconfig", we have an issue with the dependencies
for SPL_UNIT_TEST. In order to test SPL_DM_DEVICE_REMOVE we also need to
have ensured that SPL_DM is enabled, so select that as well.

Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As exposed by "make randconfig", we have an issue with the dependencies
for SPL_UNIT_TEST. In order to test SPL_DM_DEVICE_REMOVE we also need to
have ensured that SPL_DM is enabled, so select that as well.

Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge patch series "test/py: gpio: cleanups and improvement"</title>
<updated>2026-03-25T20:38:28+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2026-03-25T20:38:28+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=8813d74163e4d84dbd4fb30d9639f01c0acb6d39'/>
<id>8813d74163e4d84dbd4fb30d9639f01c0acb6d39</id>
<content type='text'>
David Lechner &lt;dlechner@baylibre.com&gt; says:

I wanted to do some quick tests to make sure gpios were working without
having to dig out a schematic. Which means I didn't want to set any GPIO
as an output first without checking. So the main point here is the last
patch which allows gpio_op_pin to be optional and skip the test instead
of failing with exception. This works similar to several other config
options that are already optional in this module.

I also noticed a few easy things to clean up while I was looking at the
file, so there are a couple of extra patches for that.

Link: https://lore.kernel.org/r/20260312-test-gpio-cleanup-v1-0-bcf549671eb1@baylibre.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
David Lechner &lt;dlechner@baylibre.com&gt; says:

I wanted to do some quick tests to make sure gpios were working without
having to dig out a schematic. Which means I didn't want to set any GPIO
as an output first without checking. So the main point here is the last
patch which allows gpio_op_pin to be optional and skip the test instead
of failing with exception. This works similar to several other config
options that are already optional in this module.

I also noticed a few easy things to clean up while I was looking at the
file, so there are a couple of extra patches for that.

Link: https://lore.kernel.org/r/20260312-test-gpio-cleanup-v1-0-bcf549671eb1@baylibre.com
</pre>
</div>
</content>
</entry>
<entry>
<title>test/py: gpio: allow omitting gpio_op_pin</title>
<updated>2026-03-25T20:38:15+00:00</updated>
<author>
<name>David Lechner</name>
<email>dlechner@baylibre.com</email>
</author>
<published>2026-03-12T20:33:41+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=0f101dac8fb6792f981c78ccd7a284e553ce5764'/>
<id>0f101dac8fb6792f981c78ccd7a284e553ce5764</id>
<content type='text'>
Modify tests that make use of gpio_op_pin from env__gpio_dev_config to
be skipped if gpio_op_pin is not provided. This is useful in cases where
one might not be sure which GPIOs are safe to use as outputs that can be
toggled without causing problems.

Signed-off-by: David Lechner &lt;dlechner@baylibre.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Modify tests that make use of gpio_op_pin from env__gpio_dev_config to
be skipped if gpio_op_pin is not provided. This is useful in cases where
one might not be sure which GPIOs are safe to use as outputs that can be
toggled without causing problems.

Signed-off-by: David Lechner &lt;dlechner@baylibre.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test/py: gpio: removing trailing semicolons</title>
<updated>2026-03-25T20:38:15+00:00</updated>
<author>
<name>David Lechner</name>
<email>dlechner@baylibre.com</email>
</author>
<published>2026-03-12T20:33:40+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=908db6c647ce1cf265f0bafd98578ad903c16a04'/>
<id>908db6c647ce1cf265f0bafd98578ad903c16a04</id>
<content type='text'>
Remove trailing semicolons in test_gpio.py. Python does not require
them and they are considered improper style.

Signed-off-by: David Lechner &lt;dlechner@baylibre.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove trailing semicolons in test_gpio.py. Python does not require
them and they are considered improper style.

Signed-off-by: David Lechner &lt;dlechner@baylibre.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test/py: gpio: remove unused imports</title>
<updated>2026-03-25T20:38:15+00:00</updated>
<author>
<name>David Lechner</name>
<email>dlechner@baylibre.com</email>
</author>
<published>2026-03-12T20:33:39+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b02b0a0c6cb1b977718d05182ac492f04c996561'/>
<id>b02b0a0c6cb1b977718d05182ac492f04c996561</id>
<content type='text'>
Remove unused imports in test_gpio.py.

Signed-off-by: David Lechner &lt;dlechner@baylibre.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove unused imports in test_gpio.py.

Signed-off-by: David Lechner &lt;dlechner@baylibre.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge patch series "add [ as alias for test, fix 0/1 argument handling"</title>
<updated>2026-03-25T20:38:02+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2026-03-25T20:38:02+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=6701997e9ca2cab0c0e1cde96437ac1dabefdaa1'/>
<id>6701997e9ca2cab0c0e1cde96437ac1dabefdaa1</id>
<content type='text'>
Rasmus Villemoes &lt;ravi@prevas.dk&gt; says:

Make 'test' behave a little more like its cousins in other shells, by
allowing the [ ... ] spelling, and while here, fix up the handling of
a single, non-empty argument to comply with POSIX.

Link: https://lore.kernel.org/r/20260312100106.702368-1-ravi@prevas.dk
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rasmus Villemoes &lt;ravi@prevas.dk&gt; says:

Make 'test' behave a little more like its cousins in other shells, by
allowing the [ ... ] spelling, and while here, fix up the handling of
a single, non-empty argument to comply with POSIX.

Link: https://lore.kernel.org/r/20260312100106.702368-1-ravi@prevas.dk
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd: test: fix handling of single-argument form of test</title>
<updated>2026-03-25T20:37:55+00:00</updated>
<author>
<name>Rasmus Villemoes</name>
<email>ravi@prevas.dk</email>
</author>
<published>2026-03-12T10:01:06+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=8b0619579b2282050e7fb0d92fbc645b79d18bae'/>
<id>8b0619579b2282050e7fb0d92fbc645b79d18bae</id>
<content type='text'>
POSIX states that

  0 arguments:
      Exit false (1).
  1 argument:
      Exit true (0) if $1 is not null; otherwise, exit false.

and at least bash and busybox sh behave that way.

The current 'argc &lt; 3' does the right thing for a non-existing or
empty argv[1], but not for a non-empty argv[1]. Fix that and add
corresponding test cases.

Signed-off-by: Rasmus Villemoes &lt;ravi@prevas.dk&gt;
Tested-by: Anshul Dalal &lt;anshuld@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
POSIX states that

  0 arguments:
      Exit false (1).
  1 argument:
      Exit true (0) if $1 is not null; otherwise, exit false.

and at least bash and busybox sh behave that way.

The current 'argc &lt; 3' does the right thing for a non-existing or
empty argv[1], but not for a non-empty argv[1]. Fix that and add
corresponding test cases.

Signed-off-by: Rasmus Villemoes &lt;ravi@prevas.dk&gt;
Tested-by: Anshul Dalal &lt;anshuld@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test: add tests for left-bracket alias for 'test' command</title>
<updated>2026-03-25T20:37:55+00:00</updated>
<author>
<name>Rasmus Villemoes</name>
<email>ravi@prevas.dk</email>
</author>
<published>2026-03-12T10:01:05+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=6f9cc3310a764aaae4478b5a8a0c0cae3b2be4a1'/>
<id>6f9cc3310a764aaae4478b5a8a0c0cae3b2be4a1</id>
<content type='text'>
Duplicate a few of the existing test cases, using the [ spelling, and
also ensure that the presence of a matching ] as a separate and last
argument is enforced.

Signed-off-by: Rasmus Villemoes &lt;ravi@prevas.dk&gt;
Tested-by: Anshul Dalal &lt;anshuld@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Duplicate a few of the existing test cases, using the [ spelling, and
also ensure that the presence of a matching ] as a separate and last
argument is enforced.

Signed-off-by: Rasmus Villemoes &lt;ravi@prevas.dk&gt;
Tested-by: Anshul Dalal &lt;anshuld@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio: Fix virtio initialization sequence</title>
<updated>2026-03-25T20:33:00+00:00</updated>
<author>
<name>Christian Pötzsch</name>
<email>christian.poetzsch@kernkonzept.com</email>
</author>
<published>2026-03-10T14:16:42+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=30e1733297ac7d9703bd0950bd237648dcb41850'/>
<id>30e1733297ac7d9703bd0950bd237648dcb41850</id>
<content type='text'>
The virtio spec clearly states in "3.1.1 Driver Requirements: Device
Initialization" the sequence a client has to follow after device reset.
Because u-boot resets here again, it also needs to set the "acknowledge"
bit again even if this was done in virtio_uclass_child_post_bind already
once before.

Signed-off-by: Christian Pötzsch &lt;christian.poetzsch@kernkonzept.com&gt;
Signed-off-by: Adam Lackorzynski &lt;adam@l4re.org&gt;
[trini: Add VIRTIO_CONFIG_S_ACKNOWLEDGE flag check to the test]
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The virtio spec clearly states in "3.1.1 Driver Requirements: Device
Initialization" the sequence a client has to follow after device reset.
Because u-boot resets here again, it also needs to set the "acknowledge"
bit again even if this was done in virtio_uclass_child_post_bind already
once before.

Signed-off-by: Christian Pötzsch &lt;christian.poetzsch@kernkonzept.com&gt;
Signed-off-by: Adam Lackorzynski &lt;adam@l4re.org&gt;
[trini: Add VIRTIO_CONFIG_S_ACKNOWLEDGE flag check to the test]
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
