<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/poky.git/meta/classes/testimage.bbclass, branch yocto-3.1.21</title>
<subtitle>Mirror of git.yoctoproject.org/poky</subtitle>
<id>https://git.enea.com/cgit/linux/poky.git/atom?h=yocto-3.1.21</id>
<link rel='self' href='https://git.enea.com/cgit/linux/poky.git/atom?h=yocto-3.1.21'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/'/>
<updated>2021-11-03T11:18:56+00:00</updated>
<entry>
<title>testimage: fix unclosed testdata file</title>
<updated>2021-11-03T11:18:56+00:00</updated>
<author>
<name>Ross Burton</name>
<email>ross@burtonini.com</email>
</author>
<published>2021-10-15T17:41:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=2de98cf4b997e27c6c48be9e3459b7db03b9e093'/>
<id>urn:sha1:2de98cf4b997e27c6c48be9e3459b7db03b9e093</id>
<content type='text'>
(From OE-Core rev: a1e49456343a2be9adb6c0d1d970c2b0c070f53e)

Signed-off-by: Ross Burton &lt;ross.burton@arm.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
(cherry picked from commit 0c192a97e3e1c015a48667d6903cc07a8b2620e4)
Signed-off-by: Steve Sakoman &lt;steve@sakoman.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>testimage: symlink the task log and qemu console log to tmp/log/oeqa</title>
<updated>2021-09-29T23:02:22+00:00</updated>
<author>
<name>Alexander Kanavin</name>
<email>alex.kanavin@gmail.com</email>
</author>
<published>2021-09-19T16:54:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=5df4fb1fa108bd1cf8cfed098404d43160d30b98'/>
<id>urn:sha1:5df4fb1fa108bd1cf8cfed098404d43160d30b98</id>
<content type='text'>
This makes it easier for the AB scripts (particularly, collect-results)
to access and archive these items, as they can contain useful information
when ptests or other qemu tests fail (and also if they don't fail).

[YOCTO #14518]

(From OE-Core rev: bdad1bdfec7fa86a6550f8aeb4e74029599df6d5)

Signed-off-by: Alexander Kanavin &lt;alex@linutronix.de&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
(cherry picked from commit 1965b344abcff0ba584136f929b4a14645f1585e)
Signed-off-by: Steve Sakoman &lt;steve@sakoman.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>testimage: print results for interrupted runs</title>
<updated>2020-11-20T10:44:34+00:00</updated>
<author>
<name>Konrad Weihmann</name>
<email>kweihmann@outlook.com</email>
</author>
<published>2020-11-10T19:20:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=8148892fee15751e54bcdde0c2972748cd980d76'/>
<id>urn:sha1:8148892fee15751e54bcdde0c2972748cd980d76</id>
<content type='text'>
When a run is ended by overall timeout, print the already executed
testcases, to provide some hints which testcase might made the
test suite reach global timeout.
Nonetheless make the testrun exit with an error

(From OE-Core rev: aca4b863c2878b31c3cb506b05d1e19ef525e4af)

Signed-off-by: Konrad Weihmann &lt;kweihmann@outlook.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
(cherry picked from commit 2bcc643195a3b3c66d698fac8b7af037c08545ac)
Signed-off-by: Steve Sakoman &lt;steve@sakoman.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>testimage: add an overall timeout setting</title>
<updated>2020-08-12T09:53:47+00:00</updated>
<author>
<name>Alexander Kanavin</name>
<email>alex.kanavin@gmail.com</email>
</author>
<published>2020-08-08T10:40:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=d89ffa3af434212be6deba225a5a14d07a1aea9a'/>
<id>urn:sha1:d89ffa3af434212be6deba225a5a14d07a1aea9a</id>
<content type='text'>
This is useful when tests misbehave and get stuck, or when
a significant increase in testing time is undesirable and
needs to be caught automatically.

(From OE-Core rev: d77546e910ad9048f0057f4465716d417b810065)

(From OE-Core rev: eb57207f983b454dbdf2321da330fc1ec8a8bcbf)

Signed-off-by: Alexander Kanavin &lt;alex.kanavin@gmail.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
Signed-off-by: Steve Sakoman &lt;steve@sakoman.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>testimage: enable ovmf support</title>
<updated>2020-07-02T15:12:36+00:00</updated>
<author>
<name>Konrad Weihmann</name>
<email>kweihmann@outlook.com</email>
</author>
<published>2020-04-14T19:19:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=21b666b47b95f2962921243ee054b77f37bffb23'/>
<id>urn:sha1:21b666b47b95f2962921243ee054b77f37bffb23</id>
<content type='text'>
Add support for running wic images with EFI as testimage.
Introduces a variable called QEMU_USE_OVMF for configuration.

(From OE-Core rev: 458a860b45c0fb5bb3162b5a112b518c3339c1dd)

Signed-off-by: Konrad Weihmann &lt;kweihmann@outlook.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
(cherry picked from commit 3af8aaff68ed332d812ea7dc184d392700ad7882)
Signed-off-by: Steve Sakoman &lt;steve@sakoman.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>testimage.bbclass: correctly process SIGTERM</title>
<updated>2020-05-07T12:03:30+00:00</updated>
<author>
<name>Alexander Kanavin</name>
<email>alex.kanavin@gmail.com</email>
</author>
<published>2020-04-17T14:18:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=37d12209851b80b1c86705b1bb510689fd6f8519'/>
<id>urn:sha1:37d12209851b80b1c86705b1bb510689fd6f8519</id>
<content type='text'>
Python's unittest will not propagate exceptions upside
of itself, but rather will just catch and print them.

The working way to make it stop is to send a SIGINT
(e.g. simulate a ctrl-c press), which will make it exit
with a KeyboardInterrupt exception.

This also makes pressing ctrl-c twice from bitbake work
again (previously hanging instances of bitbake and qemu were
left around, and bitbake would no longer start until they
were killed manually).

(From OE-Core rev: 72a19f5f0f4bc4472d13b29e46a5c1673977e37a)

Signed-off-by: Alexander Kanavin &lt;alex.kanavin@gmail.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
Signed-off-by: Steve Sakoman &lt;steve@sakoman.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>fix various, innocuous typos</title>
<updated>2020-02-18T23:53:54+00:00</updated>
<author>
<name>Robert P. J. Day</name>
<email>rpjday@crashcourse.ca</email>
</author>
<published>2020-02-16T13:23:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=e1a2a5a206438e125811c22b25bc271014fc7e76'/>
<id>urn:sha1:e1a2a5a206438e125811c22b25bc271014fc7e76</id>
<content type='text'>
Corrections:

  - environment
  - accommodate
  - conversion
  - compatible

(From OE-Core rev: 9797d3b45b4e1b9d77f0f2ee299c17b48d8d3cf6)

Signed-off-by: Robert P. J. Day &lt;rpjday@crashcourse.ca&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>weston: add a basic runtime test</title>
<updated>2020-02-18T23:53:54+00:00</updated>
<author>
<name>Alexander Kanavin</name>
<email>alex.kanavin@gmail.com</email>
</author>
<published>2020-02-16T15:50:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=ae6ec0b809bdc54b0363216c64f71ef7de5e493c'/>
<id>urn:sha1:ae6ec0b809bdc54b0363216c64f71ef7de5e493c</id>
<content type='text'>
The test is checking that weston is able to start.

(From OE-Core rev: 57700767f90eea8f2b78187c42581aca42d50bbf)

Signed-off-by: Alexander Kanavin &lt;alex.kanavin@gmail.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>testimage: Extend runtime testing infrastructure to allow unconventional booting processes to be tested</title>
<updated>2020-02-13T12:19:14+00:00</updated>
<author>
<name>Alejandro Hernandez Samaniego</name>
<email>alejandro@enedino.org</email>
</author>
<published>2020-02-08T10:32:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=a3416a5933892df940514842a34120658096ca07'/>
<id>urn:sha1:a3416a5933892df940514842a34120658096ca07</id>
<content type='text'>
The current runtime infrastructure contains hardcoded values which Ill refer to
as patterns, these patterns are either searched through or sent via the serial
terminal to communicate between HOST and TARGET.

These patterns are required since they allow us to check when a device has
finished booting, to log in, and to check whether a command sent from our tests
has returned, this way we are able to check both the status of the commands that
were sent along with its output.

The testing process goes somewhat as follows:
1. Launch QEMU and start booting.
2. Check when the device has booted by looking for the pattern login:.
3. Log in as the root user (default for our images).
4. Check that we were able to log in succesfully.
5. Start running the runtime test cases defined by TEST_SUITES.
6. One of such test cases could send a command to the QEMU target.
7. Check whether that command returned.
8. Check its output and status, return whether the test case passed or failed.

This patch allows this set of patterns to be defined instead of being hardcoded,
but it also automatically sets the defaults that we have been using in the past
if they have not been manually defined, for this reason, the patch is less
invasive and should not affect in any way how tests are currently being run.

Cases that can be enabled with this patch:
- A customized image that does not use the root user (or maybe we want to check
what happens if we dont use the root user).
- An image where the PS1 env variable has been modified, and the prompt pattern
wouldnt match the default.
- Baremetal applications, which do not follow the conventional way of booting
Linux and would probably not show a prompt for a user to log in, same applies
for testing bootloaders.
- poky-tiny: Using DISTRO=poky-tiny and an image such as the core-image-tiny
from meta-intel, which boots directly to RAM, and does not show a log in prompt
since it does not contain a conventional init process.

The code itself contains comments that should be self explanatory but here is an
example on how these patterns can be defined in a hypothetical case where we
want to run test cases as the webserver user instead:

TESTIMAGE_BOOT_PATTERNS = "send_login_user search_login_succeeded"
TESTIMAGE_BOOT_PATTERNS[send_login_user] = "webserver\n"
TESTIMAGE_BOOT_PATTERNS[search_login_succeeded] = "webserver@[a-zA-Z0-9\-]+:~#"

The variable TESTIMAGE_BOOT_PATTERNS defines which patterns to override when
used to communicate with the target when booting, anyone familiar with the
PACKAGECONFIG syntax should have no trouble setting these.

Other patterns would still be set up as default, e.g.
search_reached_prompt would still be login:

The accepted flags for TESTIMAGE_BOOT_PATTERNS are the following:
search_reached_prompt, send_login_user, search_login_succeeded,
search_cmd_finished.

They are prefixed with either search/send, to differentiate if the pattern is
meant to be sent or searched to/from the target terminal.

A working example of this code that falls under the baremetal case mentioned
above along with a test case is present on the meta-freertos layer, which tests
an RTOS image built with OpenEmbedded and automatically runs a test case on it
after booting such image:

As usual, INHERIT += "testimage" needs to be present on local.conf
$ bitbake freertos-demo -c testimage

RESULTS:
RESULTS - freertos_echo.FreeRTOSTest.test_freertos_echo: PASSED (2.00s)
SUMMARY:
freertos-demo () - Ran 1 test in 2.006s
freertos-demo - OK - All required tests passed (successes=1, skipped=0,
failures=0, errors=0)

(From OE-Core rev: 3ab2cbfeff371e8791b031a2852eeef80101a831)

Signed-off-by: Alejandro Hernandez Samaniego &lt;aehs29@gmail.com&gt;
Signed-off-by: Alejandro Hernandez Samaniego &lt;alejandro@enedino.org&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>testimage: Allow testing on QEMU machines with a single serial port</title>
<updated>2020-02-13T12:19:14+00:00</updated>
<author>
<name>Alejandro Hernandez Samaniego</name>
<email>alejandro@enedino.org</email>
</author>
<published>2020-02-08T10:30:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=e5978093075fe84ac949b2f4022f92e3f83ec2c0'/>
<id>urn:sha1:e5978093075fe84ac949b2f4022f92e3f83ec2c0</id>
<content type='text'>
commmit 6cde67d0a84 enables the use of qemurunner on machines that
only have a single serial port, but still sets the default value
as serial_ports=2 if not provided.

The testimage class does not call qemurunner with a serial_ports
argument, hence always defaulting to two.

Pass the serial_ports argument from the testimage class to allow
tests to run on QEMU machines with a single serial port.

(From OE-Core rev: a50d0163770f0b405a8de8a8a9cccd48c1de4112)

Signed-off-by: Alejandro Hernandez Samaniego &lt;alejandro@enedino.org&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
</feed>
