Commit Graph

2208 Commits

Author SHA1 Message Date
Heinrich Schuchardt
51b2f4f085 disk: simplify print_part_header()
Using uclass_get_name() reduces the code size.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-04-12 08:53:31 -06:00
Heinrich Schuchardt
9b6d415eea test: remove unused import from pkg_resources
load_entry_point is not used.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-04-12 08:53:31 -06:00
Heinrich Schuchardt
92f4cb6f9a boot: correct finding the default EFI binary
* The sandbox must not use an arbitrary file name bootsbox.efi but the
  file name matching the host architecture to properly boot the respective
  file. We already have an include which provides a macro with the name of
  the EFI binary. Use it.

* The path to the EFI binary should be absolute.

* The path and the file name must be capitalized to conform to the UEFI
  specification. This is important when reading from case sensitive
  file systems.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-04-08 13:05:21 +02:00
Heinrich Schuchardt
08c51a715a boot: correct the default sequence of boot methods
The default sequence of boot methods is determined by alphabetical sorting
during linkage.

* efi_mgr must run before efi to be UEFI compliant
* pxe should run as last resort

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-04-08 13:03:40 +02:00
Sughosh Ganu
d350b79e6d sandbox: capsule: binman: generate some capsules as part of build
Currently, all the capsules for the sandbox platform are generated at
the time of running the capsule tests. To showcase generation of
capsules through binman, generate all raw(non FIT payload) capsules
needed for the sandbox platform as part of the build. This acts as an
illustrative example for generating capsules as part of a platform's
build.

Make corresponding change in the capsule test's configuration to get
these capsules from the build directory.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2024-04-08 12:59:31 +02:00
Heinrich Schuchardt
4735d03a97 acpi: rename aslc_id, aslc_revision
The fields Creator ID and Creator Revision contain information about the
tool that created an ACPI table. This may be the ASL compiler for some
tables but it is not for others. Naming these fields aslc_id and
aslc_revision is misleading.

It is usual to see diverse values of Creator ID. On a laptop I saw these:
'AMD ', 'INTL, 'MSFT', 'PTEC'. Obviously not all relate to the Intel
ASL compiler.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-03-27 09:15:39 +01:00
Caleb Connolly
d47e1fa819 test: dm: add button_cmd test
Add a test for the button_cmd feature. This validates that commands can
be mapped to two buttons, that the correct command runs based on which
button is pressed, that only 1 command is run, and that no command runs
if button_cmd_0_name is wrong or unset.

Additionally, fix a potential uninitialised variable use caught by these
tests, the btn variable in get_button_cmd() is assumed to be null if
button_get_by_label() fails, but it's actually used uninitialised in
that case.

CONFIG_BUTTON is now enabled automatically and was removed when running
save_defconfig.

Fixes: e761035b64 ("boot: add support for button commands")
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-03-20 17:13:05 -04:00
Love Kumar
8132970f7d test/py: reset: Add a test for reset command
Add a test for reset commands which performs resetting of CPU, It does
COLD reset by default and WARM reset with -w option.

Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-03-19 18:40:47 -04:00
Love Kumar
4eff1145bc test/py: saveenv: Add a test for saveenv command
Add test case for saveenv command in non-JTAG bootmode which saves the
u-boot environment variables in persistent storage.

Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-03-19 18:40:47 -04:00
Dan Carpenter
c15d73d189 bootstd: fix build error when CONFIG_MMC is disabled
This code assumes that CONFIG_MMC and it causes a build error when
the config is disabled.

aarch64-linux-gnu-ld.bfd: test/boot/bootstd_common.o: in function `bootstd_test_check_mmc_hunter':
test/boot/bootstd_common.c:83:(.text.bootstd_test_check_mmc_hunter+0x70):
    undefined reference to `_u_boot_list_2_bootdev_hunter_2_mmc_bootdev_hunter'

Fixes: 66e3dce787 ("bootstd: Allow hunting for a bootdev by label")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
2024-03-04 10:25:47 -05:00
Dan Carpenter
2160cb141f bootflow: Fix build error when BOOTMETH_CROS is disabled
The bootflow testing assumes that BOOTMETH_CROS is enabled but it
might not be which leads to a build error.

aarch64-linux-gnu-ld.bfd: test/boot/bootflow.o: in function `prep_mmc_bootdev':
test/boot/bootflow.c:549:(.text.prep_mmc_bootdev+0x1c8):
    undefined reference to `_u_boot_list_2_driver_2_bootmeth_cros'

Fixes: d08db02d2d ("bootstd: Add a test for bootmeth_cros")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
2024-03-04 10:25:47 -05:00
Massimiliano Minella
4c73630686 cmd: setexpr: fix no matching string in gsub return empty value
In gsub, when the destination string is empty, the string 't' is
provided and the regular expression doesn't match, then the final result
is an empty string.

Example:

=> echo ${foo}

=> setenv foo
=> setexpr foo gsub e a bar
=> echo ${foo}

=>

The variable ${foo} should contain "bar" and the lack of match shouldn't
be considered an error.

This patch fixes the erroneous behavior by removing the return
statement and breaking out of the loop in case of lack of match.

Also add a test for the no match case.

Signed-off-by: Massimiliano Minella <massimiliano.minella@se.com>
2024-03-02 12:26:19 -05:00
Alexander Gendin
8904e933a3 test: cmd: mbr: Fix Smatch static checker warning
This patch fixes Smatch static checker warning:
        test/cmd/mbr.c:243 mbr_test_run()
        warn: sizeof(NUMBER)?

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Alexander Gendin <agendin@matrox.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2024-03-02 12:25:20 -05:00
Love Kumar
783ba859ad test/py: net: Add dhcp abort test
Abort the dhcp request in the middle by pressing ctrl + c on u-boot
prompt and validate the abort status.

Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-03-01 18:34:08 -05:00
Tom Rini
ea3348ebc2 Merge patch series "Handoff bloblist from previous boot stage"
Raymond Mao <raymond.mao@linaro.org> says:

This patch set adds/adapts a few bloblist APIs and implements Arm arch
custom function to retrieve the bloblist (aka. Transfer List) from
previous loader via boot arguments when BLOBLIST option is enabled and
all boot arguments are compliant to the register conventions defined
in the Firmware Handoff spec v0.9.

If an arch wishes to have different behaviors for loading bloblist
from the previous boot stage, it is required to implement the custom
function xferlist_from_boot_arg().
2024-02-29 09:24:49 -05:00
Raymond Mao
1ef43f3bf2 bloblist: refactor of bloblist_reloc()
The current bloblist pointer and size can be retrieved from global
data, so we don't need to pass them from the function arguments.
This change also help to remove all external access of gd->bloblist
outside of bloblist module.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-02-29 09:24:22 -05:00
Raymond Mao
6725421493 bloblist: check bloblist with specified buffer size
Instead of expecting the bloblist total size to be the same as the
pre-allocated buffer size, practically we are more interested in
whether the pre-allocated buffer size is bigger than the bloblist
total size.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-02-29 09:24:22 -05:00
Igor Opaniuk
a14aa59e7e avb: move SPDX license identifiers to the first line
Move SPDX license identifiers to the first line, so it conforms
to license placement rule [1]:

Placement:
The SPDX license identifier in kernel files shall be added at the first
possible line in a file which can contain a comment.  For the majority
of files this is the first line, except for scripts which require the
'#!PATH_TO_INTERPRETER' in the first line.  For those scripts the SPDX
identifier goes into the second line.

[1] https://www.kernel.org/doc/Documentation/process/license-rules.rst

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com>
Link: https://lore.kernel.org/r/20240209192045.3961832-3-igor.opaniuk@foundries.io
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2024-02-15 10:38:34 +01:00
Sean Anderson
82719d3f40 clk: Remove rfree
Nothing uses this function. Remove it. Since clk_free no longer does
anything, just stub it out.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20231216193843.2463779-2-seanga2@gmail.com
2024-01-29 22:35:02 -05:00
Love Kumar
e24e5405d2 test/py: scsi: Add test for scsi commands
Add a following test cases for scsi commands:
scsi_reset - To reset SCSI controller
scsi_info - To show available SCSI devices
scsi_scan - To (re-)scan SCSI bus
scsi_device - To show or set surrent device
scsi_part - To print partition table of selected SCSI device

Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-01-29 12:50:34 -05:00
Love Kumar
1c5b6edad3 test/py: usb: Add tests for USB device
Add the test cases for usb commands to test its various functionality
such as start, stop, reset, info, tree, storage, dev, part, ls, load,
and save. It also adds different file systems cases such as fat32, ext2
and ext4.

Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-01-29 10:31:24 -05:00
Love Kumar
6c509cab6a test/py: mmc: Add tests for MMC device
Add the test cases for mmc commands to test its various functionality
such as mmc list, dev, info, rescan, part, ls, load, and save. It also
adds different file systems cases such as fat32, ext2 and ext4.

Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-01-29 10:31:24 -05:00
Love Kumar
a0d9432c4d test/py: secure: Add secure tests for Zynq & ZynqMP
Add test cases to verify the different type of secure boot images loaded
at DDR location for AMD's ZynqMP SoC. It also adds tests authentication
and decryption functionality using AES and RSA features for Zynq.

Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-01-29 10:31:24 -05:00
Love Kumar
d07f9e6661 test/py: gpio: Add gpio pins generic test
Add gpio pins generic test for the set of gpio pin list to test various
gpio related functionality, such as the input, set, clear, and toggle,
it also tests the input and output functionality for shorted gpio pins.
This test depends on boardenv* configuration to define gpio pins names.

Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-01-29 10:31:24 -05:00
Love Kumar
e894c10c04 test/py: zynqmp_rpu: Add test for loading RPU apps
Add testcases for loading RPU applications in split and lockstep mode
including the negative one for AMD's ZynqMP SoC.

Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-01-29 10:31:24 -05:00
Caleb Connolly
274e9acff4 pytest: update requirements.txt
Update pygit2 and py to their latest versions. Even in the venv pygit2
still links against the system libgit2 library which is failing on
latest Arch Linux.

The py library also needs updating to fix a KeyNotFound exception during
test initialisation.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-01-29 10:31:23 -05:00
Heinrich Schuchardt
b07d98afdf test: unit test for smbios command
Provide a unit test for the smbios command.

Provide different test functions for QEMU, sandbox, and other systems.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-01-26 14:15:08 +01:00
Heinrich Schuchardt
aeba385e41 test: enhance unicode_test_utf8_to_utf32_stream()
Additionally test a UTF-8 string where each code point translates to three
UTF-8 bytes.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-01-24 16:17:14 -05:00
Love Kumar
bded9f13b2 test/py: bootstage: Add test for bootstage command
Add test cases for bootstage command to print the bootstage report, to
stash the data into memory and to unstash the data from memory.

Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-01-18 20:24:12 -05:00
Tobias Deiminger
2d30b293c8 test: Skip cleanup test if not built out of tree
With commit 42c0e5bb05 ("test: Find leftovers after clean/mrproper")
we assume that we are performing out of tree builds. test_clean and
test_mrproper fail if the assumption isn't met.

However there are valid scenarios where tests run with in source builds
(i.e., test.py --build-dir=.).

Automatically skip cleanup tests in such scenarios to prevent false
positives.

Signed-off-by: Tobias Deiminger <tdmg@linutronix.de>
Reviewed-by: Harald Seiler <u-boot@rahix.de>
2024-01-18 20:23:37 -05:00
Tom Rini
f7cca7ccc5 Revert "test: hush: dollar: fix bugous behavior"
What we were doing here amounts to simplifying the code for the new hush
parser, and the workarounds are required when using the old one. As we
have returned to having the old parser be default for now, we must undo
this so that the test passes again.

This reverts commit 6c2f753f4a.

Signed-off-by: Tom Rini <trini@konsulko.com>
2024-01-18 11:38:25 -05:00
Tom Rini
5b3cd0f31d Revert "test/py: net: Add dhcp abort test"
In practice, as this test defaults to enabled rather than disabled, too
many platforms now fail.

This reverts commit d836473862.

Signed-off-by: Tom Rini <trini@konsulko.com>
2024-01-18 09:05:38 -05:00
Tom Rini
1858bebeaf test: test_trace.py: Have trace-cmd report always use -l
With newer versions of trace-cmd the report subcommand will have
different output from before if we do or do not pass -l. However, with
the -l flag passed our put is consistent here. This updates our regular
expressions and comments for this as well now.

Signed-off-by: Tom Rini <trini@konsulko.com>
2024-01-18 09:04:34 -05:00
Tom Rini
662eade79e test/py/requirements.txt: Update packaging requirement
Update packaging to be version 23.2 to match our Sphinx requirements.
This will let us build a pip cache out of both of our requirements.txt
files.

Signed-off-by: Tom Rini <trini@konsulko.com>
2024-01-17 15:24:22 -05:00
Tom Rini
bdaa0b27b3 Documentation:
* add generated index to table of contents
 * create index entries for commands
 * update Python packages used to build the documentation
 * fix typos in dfu documentation
 
 UEFI:
 
 * split unrelated code from efi_bootmgr.c
 * rename CONFIG_BOOTEFI_BOOTMGR to CONFIG_EFI_BOOTMGR
 * net: tftp: remove explicit EFI configuration dependency
 * fs: remove explicit EFI configuration dependency
 
 Other:
 
 * Add Goldfish RTC driver and make it available on RISC-V QEMU
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEK7wKXt3/btL6/yA+hO4vgnE3U0sFAmWnit8ACgkQhO4vgnE3
 U0uI5hAAiIx3GO7KM/T+xLYZksCyPLKoQZ8zCHcfguuB4pHtv5JeyBO4xbuWGCq4
 0P3uDsrCBYJREd7MMRcuY0u7rQVTTMxlS59JvUuIaSJ4qYPEVS3ZsPnW7CrtT5ue
 P6E/anEZK3e2xzQk3YMdAuxquLt6C9xIzFX0mMIRsRkRlYYVEqTeAtwMF+DaJzOy
 5mO+6vbYEmuF+Oakt4OJkxjuJ2lbcNv1OxgmbgQehCtahtZyqC4/AGskq2BO4kEK
 vB4N+orJThYQ2iqkMQmRJHifnuoxLoVS63YLbuDapzR216JusiZbVwqlKZgsNSiq
 6fpHAC+l5Cam3KcCmQgmjEnyadXvdaHFvAP+a8ID4AX84F3zyrXKVBByiTB4M6ge
 NPC4c6uhq+A6L9TLiGQ171y6Z8cKQiJdMG48EdOJeUlfFc8kROjPOalNY4LREsnx
 I+Ma4SQY5MHBoqP9XQf3//5mLB4InElvEh8Up+r1i0QNuIuXjke3zEGIA/Zb0x1C
 HqZ5HQDJKineIJDMU78iJCzC3uP74ZwTixGzTtW1c5eDSHPNoW/FTxZYlpge8yk1
 LjmI+un5RS08dBMPWCGP9buDTMfnjQfbGYGT3In/yYbHOS/TE9REJdjFES1j4UpS
 c9IMc5m+wF2h+cU4eFtUHFm9Pfn2hZkMeInauMumfQS7stj1Qdk=
 =q+5u
 -----END PGP SIGNATURE-----

Merge tag 'efi-2024-04-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Documentation:

* add generated index to table of contents
* create index entries for commands
* update Python packages used to build the documentation
* fix typos in dfu documentation

UEFI:

* split unrelated code from efi_bootmgr.c
* rename CONFIG_BOOTEFI_BOOTMGR to CONFIG_EFI_BOOTMGR
* net: tftp: remove explicit EFI configuration dependency
* fs: remove explicit EFI configuration dependency

Other:

* Add Goldfish RTC driver and make it available on RISC-V QEMU
2024-01-17 09:27:23 -05:00
Tom Rini
a300ac3851 test.py: Update pycryptodomex to address CVE-2023-52323
The version of pycryptodomex that we use is vulnerable to this CVE.
While not likely an issue for us, let us upgrade to be on the safe side.

Reported-by: GitHub dependabot
Signed-off-by: Tom Rini <trini@konsulko.com>
2024-01-17 08:00:07 -05:00
Rasmus Villemoes
13f4c85828 test: add test of "cp" shell command
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2024-01-17 08:00:05 -05:00
AKASHI Takahiro
279b03d979 efi_loader: rename BOOTEFI_BOOTMGR to EFI_BOOTMGR
At this point, EFI boot manager interfaces is fully independent from
bootefi command. So just rename the configuration parameter.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2024-01-17 08:40:25 +01:00
Love Kumar
22efc1cf27 test/py: memtest: Add tests for mtest command
Add the following memory tests:
memtest_negative - To test mtest command by providing incorrect inputs
memtest_ddr - To test memory write-read-comparision for DDR memory

Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-01-16 17:05:29 -05:00
Love Kumar
9b8b0431ea test/py: i2c: Add tests for i2c command
Add below test cases for i2c commands:
i2c_bus - To show i2c bus info,
i2c_dev - To set or show the current bus,
i2c_probe - To probe the i2c device,
i2c_eeprom - To test i2c eeprom device,
i2c_probe_all_buses - To list down all the buses and probes it

Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-01-16 17:05:29 -05:00
Love Kumar
f0d6e29f97 test/py: mii: Add tests for mii command
Add below test cases for mii commands:
mii_info -To display MII PHY info
mii_list - To list MII devices
mii_set_device - To set MII device
mii_read - To reads register from MII PHY address
mii_dump - To display data from MII PHY address

Signed-off-by: Love Kumar <love.kumar@amd.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2024-01-16 17:05:29 -05:00
Love Kumar
53157bfa99 test/py: mdio: Add tests for mdio command
Add below test cases for mdio commands:
mdio_list - To list MDIO buses
mdio_read - To read PHY's register at <devad>.<reg>
mdio_write - To write PHY's register at <devad>.<reg>

Signed-off-by: Love Kumar <love.kumar@amd.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2024-01-16 12:00:05 -05:00
Love Kumar
d836473862 test/py: net: Add dhcp abort test
Abort the dhcp request in the middle by pressing ctrl + c on u-boot
prompt and validate the abort status.

Signed-off-by: Love Kumar <love.kumar@amd.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2024-01-16 12:00:05 -05:00
Caleb Connolly
4d6d25be5f
test: spmi: fix tests
With the recent changes to the Qualcomm PMIC GPIO driver the sandbox
tests for it no longer pass, update the DTS and tests to work with the
changes.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-01-16 12:26:54 +00:00
Peter Robinson
bbd6618fb5 test: fs: fs-test: Move the tests to use sha256sum
Move the use of md5s for recording filesystem file integrity
checks to sha256 hashes as they're preferred due to being
less likely to produce clashing hashes. In the process
generalise some of the wording to use the more generic
hash term.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2024-01-11 21:19:25 -05:00
Heinrich Schuchardt
6e75ae1a39 test: CONFIG_UT_BOOTSTD must depend on CONFIG_BOOTSTD
Building sandbox_defconfig with

    CONFIG_BOOTSTD=n
    CONFIG_UT_BOOTSTD=y

leads to an error

    /usr/bin/ld: test/cmd_ut.o:(.data.rel.cmd_ut_sub+0xc0):
    undefined reference to `do_ut_bootstd'

Add the missing dependency.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2024-01-11 21:19:25 -05:00
Heinrich Schuchardt
6a8a23ccfb test: build test/boot for CONFIG_UT_BOOTSTD=n
Building sandbox_defconfig with

    CONFIG_UT_BOOTSTD=n
    CONFIG_MEASURMENT=y

results in an error:

    /usr/bin/ld: test/cmd_ut.o:(.data.rel.cmd_ut_sub+0x408):
    undefined reference to `do_ut_measurement'

Fixes: 5999ea20fa ("test: Add sandbox TPM boot measurement")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-01-11 21:19:25 -05:00
Tom Rini
2ee7a8ec6f Merge patch series "net fixes prior lwip"
Maxim Uvarov <maxim.uvarov@linaro.org> says:

Add small net fixes prior lwip patches.
2024-01-11 11:25:07 -05:00
Maxim Uvarov
e6163467a3 test_net: print out net list
Printing net list is useful in CI log files.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2024-01-11 11:24:58 -05:00
Ion Agorria
6c2f753f4a test: hush: dollar: fix bugous behavior
The dollar test was merged with bugous console behavior, and
instead of fixing it, this behavior was just workarounded.

It seems like without the fix the ut_assert_skipline(); didn't clear
console and running ut_assert_skipline(); many times would give always
OK. With

lib: membuff: fix readline not returning line in case of overflow

the line is cleared correctly and next assert fails because now there
is nothing to clean which is correct if we look the this a bit above
the failing assert:

    if (gd->flags & GD_FLG_HUSH_MODERN_PARSER) {
         /*
          * For some strange reasons, the console is not empty after
          * running above command.
          * So, we reset it to not have side effects for other tests.
          */
         console_record_reset_enable();
    } else if (gd->flags & GD_FLG_HUSH_OLD_PARSER) {
         ut_assert_console_end();
    }

Which further confirms that tests workaround the old problem and now
that problem is fixed we can remove the whole if blocks and simply
place ut_assert_console_end() right after ut_assert_skipline() without
any conditional and will pass green.

So this part of code goes from:
    ut_assert_skipline();
    ut_assert_skipline();

    if (gd->flags & GD_FLG_HUSH_MODERN_PARSER) {
        /* See above comments. */
        console_record_reset_enable();
    } else if (gd->flags & GD_FLG_HUSH_OLD_PARSER) {
        ut_assert_console_end();
    }

to become:
    ut_assert_skipline();
    ut_assert_console_end();

Same thing should be done with the if block mentioned above that calls
console_record_reset_enable().

Signed-off-by: Ion Agorria <ion@agorria.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20240105072212.6615-8-clamor95@gmail.com
[mkorpershoek: reworded commit title]
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2024-01-09 15:31:59 +01:00