diff options
author | Tom Rini <trini@konsulko.com> | 2025-04-08 13:54:50 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2025-04-08 13:54:50 -0600 |
commit | a30b54462825843a9dcc46a17df6d57099f7b61a (patch) | |
tree | 597b4d3d3c60a6dc05d8386e934b079e66226045 /doc/develop/py_testing.rst | |
parent | d4c3359570a698679058fc4e7d422bfa108fcbfb (diff) | |
parent | eb1b90ec57a43ff4799d9626a1481acd01a4adb4 (diff) |
Merge patch series "Improve pytest runtime"
Tom Rini <trini@konsulko.com> says:
One thing that Simon Glass has noted is that our pytest run time keeps
getting longer. Looking at:
https://source.denx.de/u-boot/u-boot/-/pipelines/25011/test_report?job_name=sandbox%20test.py%3A%20%5Bfast%20amd64%5D
we can see that some of the longest running tests are a little puzzling.
It turns out that we have two ways of making filesystem images without
requiring root access and one of them is significantly slower than the
other. This series changes us from using virt-make-fs to only using the
mk_fs helper that currently resides in test_ut.py which uses standard
userspace tools. The final result can be seen at:
https://source.denx.de/u-boot/u-boot/-/pipelines/25015/test_report?job_name=sandbox%20test.py%3A%20%5Bfast%20amd64%5D
and the tests changed here now run much quicker.
Link: https://lore.kernel.org/r/20250320140030.2052434-1-trini@konsulko.com
Diffstat (limited to 'doc/develop/py_testing.rst')
-rw-r--r-- | doc/develop/py_testing.rst | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/doc/develop/py_testing.rst b/doc/develop/py_testing.rst index 40a85380343..502053f09fc 100644 --- a/doc/develop/py_testing.rst +++ b/doc/develop/py_testing.rst @@ -41,13 +41,11 @@ will be required. The following is an incomplete list: * dfu-util * dtc * openssl -* sudo OR guestmount * e2fsprogs * util-linux * coreutils * dosfstools * efitools -* guestfs-tools * mount * mtools * sbsigntool @@ -64,23 +62,12 @@ The test script supports either: physical board, attach to the board's console stream, and reset the board. Further details are described later. -The usage of command 'sudo' should be avoided in tests. To create disk images -use command virt-make-fs which is provided by package guestfs-tools. This -command creates a virtual machine with QEMU in which the disk image is -generated. - -Command virt-make-fs needs read access to the current kernel. On Ubuntu only -root has this privilege. You can add a script /etc/initramfs-tools/hooks/vmlinuz -with the following content to overcome the problem: - -.. code-block:: bash - - #!/bin/sh - echo "chmod a+r vmlinuz-*" - chmod a+r /boot/vmlinuz-* - -The script should be chmod 755. It will be invoked whenever the initial RAM file -system is updated. +The usage of the command 'sudo' is not allowed in tests. Using elevated +priviledges can lead to security concerns. Furthermore not all users may have +administrator rights. Therefore the command 'sudo' must not be used in tests. +To create disk images we have helper functions located in +`test/py/tests/fs_helper.py` which shall be used in any tests that require +creating disk images. Using `virtualenv` to provide requirements ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |