aboutsummaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2024-03-04bootstd: fix build error when CONFIG_MMC is disabledDan Carpenter
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: 66e3dce78750 ("bootstd: Allow hunting for a bootdev by label") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
2024-03-04bootflow: Fix build error when BOOTMETH_CROS is disabledDan Carpenter
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: d08db02d2d3d ("bootstd: Add a test for bootmeth_cros") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
2024-03-02cmd: setexpr: fix no matching string in gsub return empty valueMassimiliano Minella
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-02test: cmd: mbr: Fix Smatch static checker warningAlexander Gendin
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-01test/py: net: Add dhcp abort testLove Kumar
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-02-29Merge patch series "Handoff bloblist from previous boot stage"Tom Rini
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-29bloblist: refactor of bloblist_reloc()Raymond Mao
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-29bloblist: check bloblist with specified buffer sizeRaymond Mao
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-15avb: move SPDX license identifiers to the first lineIgor Opaniuk
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-01-29clk: Remove rfreeSean Anderson
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-29test/py: scsi: Add test for scsi commandsLove Kumar
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-29test/py: usb: Add tests for USB deviceLove Kumar
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-29test/py: mmc: Add tests for MMC deviceLove Kumar
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-29test/py: secure: Add secure tests for Zynq & ZynqMPLove Kumar
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-29test/py: gpio: Add gpio pins generic testLove Kumar
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-29test/py: zynqmp_rpu: Add test for loading RPU appsLove Kumar
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-29pytest: update requirements.txtCaleb Connolly
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-26test: unit test for smbios commandHeinrich Schuchardt
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-24test: enhance unicode_test_utf8_to_utf32_stream()Heinrich Schuchardt
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-18test/py: bootstage: Add test for bootstage commandLove Kumar
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-18test: Skip cleanup test if not built out of treeTobias Deiminger
With commit 42c0e5bb054d ("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-18Revert "test: hush: dollar: fix bugous behavior"Tom Rini
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 6c2f753f4ad3dcee60190949d1286736a6d51d17. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-01-18Revert "test/py: net: Add dhcp abort test"Tom Rini
In practice, as this test defaults to enabled rather than disabled, too many platforms now fail. This reverts commit d8364738623ff47dd2321dd68da310abb58fe861. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-01-18test: test_trace.py: Have trace-cmd report always use -lTom Rini
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-17test/py/requirements.txt: Update packaging requirementTom Rini
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-17Merge tag 'efi-2024-04-rc1-2' of ↵Tom Rini
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-17test.py: Update pycryptodomex to address CVE-2023-52323Tom Rini
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-17test: add test of "cp" shell commandRasmus Villemoes
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2024-01-17efi_loader: rename BOOTEFI_BOOTMGR to EFI_BOOTMGRAKASHI Takahiro
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-16test/py: memtest: Add tests for mtest commandLove Kumar
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-16test/py: i2c: Add tests for i2c commandLove Kumar
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-16test/py: mii: Add tests for mii commandLove Kumar
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-16test/py: mdio: Add tests for mdio commandLove Kumar
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-16test/py: net: Add dhcp abort testLove Kumar
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-16test: spmi: fix testsCaleb Connolly
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-11test: fs: fs-test: Move the tests to use sha256sumPeter Robinson
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-11test: CONFIG_UT_BOOTSTD must depend on CONFIG_BOOTSTDHeinrich Schuchardt
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-11test: build test/boot for CONFIG_UT_BOOTSTD=nHeinrich Schuchardt
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: 5999ea20fa42 ("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-11Merge patch series "net fixes prior lwip"Tom Rini
Maxim Uvarov <maxim.uvarov@linaro.org> says: Add small net fixes prior lwip patches.
2024-01-11test_net: print out net listMaxim Uvarov
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-09test: hush: dollar: fix bugous behaviorIon Agorria
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-07acpi: Write pointers to tables instead of addressesSimon Glass
Sandbox uses an API to map between addresses and pointers. This allows it to have (emulated) memory at zero and avoid arch-specific addressing details. It also allows memory-mapped peripherals to work. As an example, on many machines sandbox maps address 100 to pointer value 10000000. However this is not correct for ACPI, if sandbox starts another program (e.g EFI app) and passes it the tables. That app has no knowledge of sandbox's address mapping. So to make this work we want to store 10000000 as the value in the table. Add two new 'nomap' functions which clearly make this exeption to how sandbox works. This should allow EFI apps to access ACPI tables with sandbox, e.g. for testing purposes. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2024-01-07acpi: Rename test dm_test_setup_ctx_and_base_tables()Simon Glass
Use the word 'acpi' in this test so that it runs along with all the other ACPI tests. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2023-12-31bloblist: Add alignment to bloblist_new()Simon Glass
Allow the alignment to be specified when creating a bloblist. Signed-off-by: Simon Glass <sjg@chromium.org> Co-developed-by: Raymond Mao <raymond.mao@linaro.org> Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-12-31bloblist: Adjust the bloblist headerSimon Glass
The v0.9 spec provides for a 24-byte header. Update the implementation to match this. Rename the fields of the bloblist header to align to the spec. Adds an alignment field into the bloblist header. Update the related bloblist APIs and UT testcases. Signed-off-by: Simon Glass <sjg@chromium.org> Co-developed-by: Raymond Mao <raymond.mao@linaro.org> Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-12-31bloblist: Reduce blob-header sizeSimon Glass
The v0.9 spec provides for an 8-byte header for each blob, with fewer fields. The blob data start address should be aligned to the alignment specified by the bloblist header. Update the implementation to match this. Signed-off-by: Simon Glass <sjg@chromium.org> Co-developed-by: Raymond Mao <raymond.mao@linaro.org> Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
2023-12-31bloblist: Checksum the entire bloblistSimon Glass
Use a sinple 8-bit checksum for bloblist, as specified by the spec version 0.9. Spec v0.9 specifies that the entire bloblist area is checksummed, including unused portions. Update the code to follow this. Signed-off-by: Simon Glass <sjg@chromium.org> Co-developed-by: Raymond Mao <raymond.mao@linaro.org> Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-12-31bloblist: Adjust API to align in powers of 2Simon Glass
The updated bloblist structure stores the alignment as a power-of-two value in its structures. Adjust the API to use this, to avoid needing to calling ilog2(). Update the bloblist alignment from 16 bytes to 8 bytes. Drop a stale comment while we are here. Signed-off-by: Simon Glass <sjg@chromium.org> Co-developed-by: Raymond Mao <raymond.mao@linaro.org> Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-12-31bloblist: Update the tag numberingSimon Glass
Align bloblist tags with the FW handoff spec v0.9. The most common ones are from 0. TF related ones are from 0x100. All non-standard ones from 0xfff000. Added new defined tags: BLOBLISTT_OPTEE_PAGABLE_PART for TF. BLOBLISTT_TPM_EVLOG and BLOBLISTT_TPM_CRB_BASE for TPM. Signed-off-by: Simon Glass <sjg@chromium.org> Co-developed-by: Raymond Mao <raymond.mao@linaro.org> Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-12-28Merge patch series "Modernize U-Boot shell"Tom Rini
Francis Laniel <francis.laniel@amarulasolutions.com> says: During 2021 summer, Sean Anderson wrote a contribution to add a new shell, based on LIL, to U-Boot [1, 2]. While one of the goals of this contribution was to address the fact actual U-Boot shell, which is based on Busybox hush, is old there was a discussion about adding a new shell versus updating the actual one [3, 4]. So, in this series, with Harald Seiler, we updated the actual U-Boot shell to reflect what is currently in Busybox source code. Basically, this contribution is about taking a snapshot of Busybox shell/hush.c file (as it exists in commit 37460f5da) and adapt it to suit U-Boot needs. This contribution was written to be as backward-compatible as possible to avoid breaking the existing. So, the modern hush flavor offers the same as the actual, that is to say: 1. Variable expansion. 2. Instruction lists (;, && and ||). 3. If, then and else. 4. Loops (for, while and until). No new features offered by Busybox hush were implemented (e.g. functions). It is possible to change the parser at runtime using the "cli" command: => cli print old => cli set modern => cli print modern => cli set old The default parser is the old one. Note that to use both parser, you would need to set both CONFIG_HUSH_MODERN_PARSER and CONFIG_HUSH_OLD_PARSER. In terms of testing, new unit tests were added to ut to ensure the new behavior is the same as the old one and it does not add regression. Nonetheless, if old behavior was buggy and fixed upstream, the fix is then added to U-Boot [5]. In sandbox, all of these tests pass smoothly: => printenv board board=sandbox => ut hush Running 20 hush tests ... Failures: 0 => cli set modern => ut hush Running 20 hush tests ... Failures: 0 Thanks to the effort of Harald Seiler, I was successful booting a board: => printenv fdtfile fdtfile=amlogic/meson-gxl-s905x-libretech-cc.dtb => cli get old => boot ... root@lepotato:~# root@lepotato:~# reboot ... => cli set modern => cli get modern => printenv fdtfile fdtfile=amlogic/meson-gxl-s905x-libretech-cc.dtb => boot ... root@lepotato:~# This contribution indeed adds a lot of code and there were concern about its size [6, 7]. With regard to the amount of code added, the cli_hush_upstream.c is 13030 lines long but it seems a smaller subset is really used: gcc -D__U_BOOT__ -E common/cli_hush_upstream.c | wc -l 2870 Despite this, it is better to still have the whole upstream code for the sake of easing maintenance. With regard to memory size, I conducted some experiments for version 8 of this series and for a subset of arm64 boards and found the worst case to be 4K [8]. Tom Rini conducted more research on this and also found the increase to be acceptable [9]. If you want to review it - your review will really be appreciated - here are some information regarding the commits: * commits marked as "test:" deal with unit tests. * commit "cli: Add Busybox upstream hush.c file." copies Busybox shell/hush.c into U-Boot tree, this explain why this commit contains around 12000 additions. * commit "cli: Port Busybox 2021 hush to U-Boot." modifies previously added file to permit us to use this as new shell. The really good idea of #include'ing Busybox code into a wrapper file to define some particular functions while minimizing modifications to upstream code comes from Harald Seiler. * commit "cmd: Add new parser command" adds a new command which permits selecting parser at runtime. I am not really satisfied with the fact it calls cli_init() and cli_loop() each time the parser is set, so your reviews would be welcomed. * Other commits focus on enabling features we need (e.g. if).