@@ -113,7 +113,9 @@ the following types of tests:
ensure we have no single point of failure and can ensure the
different distros work effectively.
-- *eSDK Testing:* Image tests initiated through the following command::
+- *eSDK Testing:* Image tests initiated through the following command:
+
+ .. code-block:: console
$ bitbake image -c testsdkext
@@ -124,7 +126,9 @@ the following types of tests:
:ref:`OpenEmbedded Self test (oe-selftest) <ref-manual/release-process:Testing and Quality Assurance>`. We test oe-selftest on each of the main distributions
we support.
-- *Image Testing:* Image tests initiated through the following command::
+- *Image Testing:* Image tests initiated through the following command:
+
+ .. code-block:: console
$ bitbake image -c testimage
@@ -146,7 +150,9 @@ the following types of tests:
":yocto_wiki:`Ptest </Ptest>`" Wiki page for more
information on Ptest.
-- *SDK Testing:* Image tests initiated through the following command::
+- *SDK Testing:* Image tests initiated through the following command:
+
+ .. code-block:: console
$ bitbake image -c testsdk
@@ -175,21 +181,29 @@ Tests map into the codebase as follows:
Some of these tests run the ``bitbake`` command, so ``bitbake/bin``
must be added to the ``PATH`` before running ``bitbake-selftest``.
- From within the BitBake repository, run the following::
+ From within the BitBake repository, run the following:
+
+ .. code-block:: console
$ export PATH=$PWD/bin:$PATH
- After that, you can run the selftest script::
+ After that, you can run the selftest script:
+
+ .. code-block:: console
$ bitbake-selftest
The default output is quiet and just prints a summary of what was
- run. To see more information, there is a verbose option::
+ run. To see more information, there is a verbose option:
+
+ .. code-block:: console
$ bitbake-selftest -v
To skip tests that access the Internet, use the ``BB_SKIP_NETTESTS``
- variable when running ``bitbake-selftest`` as follows::
+ variable when running ``bitbake-selftest`` as follows:
+
+ .. code-block:: console
$ BB_SKIP_NETTESTS=yes bitbake-selftest
@@ -197,12 +211,16 @@ Tests map into the codebase as follows:
which are mostly necessary to test the fetcher modules. To specify
individual test modules to run, append the test module name to the
``bitbake-selftest`` command. For example, to specify the tests for
- ``bb.tests.data.DataExpansions``, run::
+ ``bb.tests.data.DataExpansions``, run:
+
+ .. code-block:: console
$ bitbake-selftest bb.tests.data.DataExpansions
You can also specify individual tests by defining the full name and module
- plus the class path of the test, for example::
+ plus the class path of the test, for example:
+
+ .. code-block:: console
$ bitbake-selftest bb.tests.data.DataExpansions.test_one_var
@@ -226,23 +244,31 @@ Tests map into the codebase as follows:
- The code for the tests resides in
``meta/lib/oeqa/selftest/cases/``.
- - To run all the tests, enter the following command::
+ - To run all the tests, enter the following command:
+
+ .. code-block:: console
$ oe-selftest -a
- To run a specific test, use the following command form where
- ``testname`` is the name of the specific test::
+ ``testname`` is the name of the specific test:
+
+ .. code-block:: console
$ oe-selftest -r <testname>
For example, the following command would run the ``tinfoil``
- ``getVar`` API test::
+ ``getVar`` API test:
+
+ .. code-block:: console
$ oe-selftest -r tinfoil.TinfoilTests.test_getvar
It is also possible to run a set
of tests. For example the following command will run all of the
- ``tinfoil`` tests::
+ ``tinfoil`` tests:
+
+ .. code-block:: console
$ oe-selftest -r tinfoil
@@ -257,7 +283,9 @@ Tests map into the codebase as follows:
IMAGE_CLASSES += "testimage"
- - Run the tests using the following command form::
+ - Run the tests using the following command form:
+
+ .. code-block:: console
$ bitbake image -c testimage
@@ -268,7 +296,9 @@ Tests map into the codebase as follows:
- The code for these tests resides in ``meta/lib/oeqa/sdk/cases/``.
- - Run the test using the following command form::
+ - Run the test using the following command form:
+
+ .. code-block:: console
$ bitbake image -c testsdk
@@ -279,7 +309,9 @@ Tests map into the codebase as follows:
- The code for these tests resides in ``meta/lib/oeqa/sdkext/cases/``.
- - To run the tests, use the following command form::
+ - To run the tests, use the following command form:
+
+ .. code-block:: console
$ bitbake image -c testsdkext
@@ -290,7 +322,9 @@ Tests map into the codebase as follows:
- The code for these tests resides in ``meta/lib/oeqa/buildperf``.
- - To run the tests, use the following command form::
+ - To run the tests, use the following command form:
+
+ .. code-block:: console
$ oe-build-perf-test <options>
@@ -492,7 +526,9 @@ working correctly. The test would only run if Python3 is installed in the SDK.
The performance tests usually measure how long operations take and the
resource utilization as that happens. An example from
-``meta/lib/oeqa/buildperf/test_basic.py`` contains the following::
+``meta/lib/oeqa/buildperf/test_basic.py`` contains the following:
+
+.. code-block:: python
class Test3(BuildPerfTestCase):
def test3(self):
@@ -13,7 +13,9 @@ hand, the test can be anything from a simple shell script that runs a
binary and checks the output to an elaborate system of test binaries and
data files.
-The test generates output in the format used by Automake::
+The test generates output in the format used by Automake:
+
+.. code-block:: text
result: testname
@@ -117,7 +119,9 @@ test. Here is what you have to do for each recipe:
script where you will refer to it using
:term:`SRC_URI`. Be sure ``run-ptest`` exits with 0 to mark it
as successfully executed otherwise will be marked as fail.
- Here is an example that starts a test for ``dbus``::
+ Here is an example that starts a test for ``dbus``:
+
+ .. code-block:: shell
#!/bin/sh
cd test
@@ -129,7 +133,9 @@ test. Here is what you have to do for each recipe:
- *Make sure the test prints at least one test result*: The execution of the
``run-ptest`` script must result in at least one test result output on the
- console, with the following format::
+ console, with the following format:
+
+ .. code-block:: text
result: testname
@@ -87,7 +87,9 @@ it always depends upon the paths it is built in.
classes, etc.
To run our automated selftest, as we use in our CI on the Autobuilder, you can
-run::
+run:
+
+.. code-block:: console
$ oe-selftest -r reproducible.ReproducibleTests.test_reproducible_builds
@@ -56,7 +56,9 @@ In order to run tests, you need to do the following:
- Ensure that your host has the package ``iptables`` installed.
- The package recipe ``qemu-helper-native`` is required to run
- this script. Build the package using the following command::
+ this script. Build the package using the following command:
+
+ .. code-block:: console
$ bitbake qemu-helper-native
@@ -230,7 +232,9 @@ The final thing you need to do when setting :term:`TEST_TARGET` to
TEST_TARGET = "SystemdbootTarget"
TEST_TARGET_IP = "192.168.2.3"
-#. *Build your test image:* Use BitBake to build the image::
+#. *Build your test image:* Use BitBake to build the image:
+
+ .. code-block:: console
$ bitbake core-image-sato
@@ -324,7 +328,9 @@ You can start the tests automatically or manually:
TESTIMAGE_AUTO = "1"
Next, build your image. If the image successfully builds, the
- tests run::
+ tests run:
+
+ .. code-block:: console
$ bitbake core-image-sato
@@ -334,7 +340,9 @@ You can start the tests automatically or manually:
IMAGE_CLASSES += "testimage"
- Next, use BitBake to run the tests::
+ Next, use BitBake to run the tests:
+
+ .. code-block:: console
$ bitbake -c testimage image
@@ -408,7 +416,9 @@ If your image is already built, make sure the following are set in your
TEST_SERVER_IP = "IP-address-for-the-test-server"
You can then export the tests with the
-following BitBake command form::
+following BitBake command form:
+
+.. code-block:: console
$ bitbake image -c testexport
@@ -416,7 +426,9 @@ Exporting the tests places them in the :term:`Build Directory` in
``tmp/testimage/``\ image, which is controlled by the :term:`TEST_EXPORT_DIR`
variable.
-You can now run the tests outside of the build environment::
+You can now run the tests outside of the build environment:
+
+.. code-block:: console
$ cd tmp/testimage/image
$ ./oe-test runtime
@@ -433,12 +445,16 @@ Here is a complete example that shows IP addresses and uses the
TEST_TARGET_IP = "192.168.7.2"
TEST_SERVER_IP = "192.168.7.1"
-Use BitBake to export the tests::
+Use BitBake to export the tests:
+
+.. code-block:: console
$ bitbake core-image-sato -c testexport
Run the tests outside of
-the build environment using the following::
+the build environment using the following:
+
+.. code-block:: console
$ cd tmp/testimage/core-image-sato
$ ./oe-test runtime
@@ -580,7 +596,9 @@ data:
Here is an example JSON file that handles test "foo" installing
package "bar" and test "foobar" installing packages "foo" and "bar".
-Once the test is complete, the packages are removed from the DUT::
+Once the test is complete, the packages are removed from the DUT:
+
+.. code-block:: json
{
"foo": {
@@ -20,7 +20,9 @@ each of those targets on a separate buildbot worker. To understand the
configuration, you need to look at the entry on ``config.json`` file
within the :yocto_git:`yocto-autobuilder-helper </yocto-autobuilder-helper>`
repository. The targets are defined in the ``overrides`` section, a quick
-example could be ``qemux86-64`` which looks like::
+example could be ``qemux86-64`` which looks like:
+
+.. code-block:: text
"qemux86-64" : {
"MACHINE" : "qemux86-64",
@@ -33,7 +35,9 @@ example could be ``qemux86-64`` which looks like::
},
And to expand that, you need the ``arch-qemu`` entry from
-the ``templates`` section, which looks like::
+the ``templates`` section, which looks like:
+
+.. code-block:: text
"arch-qemu" : {
"BUILDINFO" : true,
@@ -276,18 +280,24 @@ The standard ``config.json`` minimally attempts to allow substitution of
the paths. The Helper script repository includes a
``local-example.json`` file to show how you could override these from a
separate configuration file. Pass the following into the environment of
-the Autobuilder::
+the Autobuilder:
+
+.. code-block:: console
$ ABHELPER_JSON="config.json local-example.json"
As another example, you could also pass the following into the
-environment::
+environment:
+
+.. code-block:: console
$ ABHELPER_JSON="config.json /some/location/local.json"
One issue users often run into is validation of the ``config.json`` files. A
tip for minimizing issues from invalid JSON files is to use a Git
``pre-commit-hook.sh`` script to verify the JSON file before committing
-it. Create a symbolic link as follows::
+it. Create a symbolic link as follows:
+
+.. code-block:: console
$ ln -s ../../scripts/pre-commit-hook.sh .git/hooks/pre-commit
The manuals are moving to a default of bitbake for code blocks, so a BitBake block needs no language and every other block needs one. This gives the blocks in this manual that are not BitBake their language. AI-Generated: codex/claude-opus 5.5 (xhigh) Signed-off-by: Trevor Woerner <twoerner@gmail.com> --- documentation/test-manual/intro.rst | 72 ++++++++++++++----- documentation/test-manual/ptest.rst | 12 +++- .../test-manual/reproducible-builds.rst | 4 +- documentation/test-manual/runtime-testing.rst | 36 +++++++--- .../test-manual/understand-autobuilder.rst | 20 ++++-- 5 files changed, 108 insertions(+), 36 deletions(-)