Skip to content

Commit e18034f

Browse files
committed
test: add VxWorks boot test for sabrelite board
Add a functional test that boots VxWorks on the QEMU sabrelite (i.MX6Q) machine and waits for the shell prompt. The test images are fetched from a private repo (hungmtruong/vxworks-images) during CI. Changes: - Add tests/functional/arm/test_sabrelite_vxworks.py - Register in tests/functional/arm/meson.build (quick + 120s timeout) - Update CI to build arm-softmmu, clone vxworks-images, and set SDK path
1 parent 12a000d commit e18034f

3 files changed

Lines changed: 70 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,23 @@ jobs:
116116
working-directory: qemu
117117
run: |
118118
export PATH="/usr/lib/ccache:$PATH"
119-
./configure --target-list="aarch64-softmmu,x86_64-softmmu" --enable-fdt --enable-plugins --enable-slirp --enable-capstone --disable-vhost-net --disable-vhost-user --enable-gnutls
119+
./configure --target-list="arm-softmmu,aarch64-softmmu,x86_64-softmmu" --enable-fdt --enable-plugins --enable-slirp --enable-capstone --disable-vhost-net --disable-vhost-user --enable-gnutls
120120
make -j$(nproc)
121121
make plugins
122122
make check-build
123123
124124
- name: Print ccache stats
125125
run: ccache --show-stats
126126

127+
- name: Set up VxWorks Sabrelite SDK
128+
run: |
129+
git clone https://${{ secrets.VXWORKS_IMAGES_TOKEN }}@github.com/hungmtruong/vxworks-images.git \
130+
${{ github.workspace }}/vxworks-images
131+
127132
- name: Run QEMU tests
128133
working-directory: qemu
134+
env:
135+
QEMU_TEST_VXWORKS_SABRELITE_SDK: ${{ github.workspace }}/vxworks-images
129136
run: |
130137
V=1 make check
131138

tests/functional/arm/meson.build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ test_arm_timeouts = {
2323
'quanta_gsj' : 240,
2424
'raspi2' : 120,
2525
'replay' : 240,
26+
'sabrelite_vxworks' : 120,
2627
'tuxrun' : 240,
2728
'sx1' : 360,
2829
}
2930

3031
tests_arm_system_quick = [
3132
'migration',
33+
'sabrelite_vxworks',
3234
]
3335

3436
tests_arm_system_thorough = [
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/usr/bin/env python3
2+
#
3+
# Functional test that boots VxWorks on the QEMU Sabrelite (i.MX6Q) machine
4+
# and checks the console for a successful boot.
5+
#
6+
# Copyright (c) 2026 Wind River Systems, Inc.
7+
#
8+
# SPDX-License-Identifier: GPL-2.0-or-later
9+
10+
import os
11+
12+
from qemu_test import QemuSystemTest, wait_for_console_pattern
13+
14+
VXWORKS_SDK_PATH = os.environ.get(
15+
'QEMU_TEST_VXWORKS_SABRELITE_SDK',
16+
'/opt/wrsdk/vxworks-images'
17+
)
18+
19+
BSP_DIR = os.path.join(VXWORKS_SDK_PATH, 'sabrelite')
20+
21+
22+
class SabreliteVxWorksTest(QemuSystemTest):
23+
"""Boot VxWorks on the QEMU sabrelite (i.MX6Q) machine."""
24+
25+
def test_vxworks_boot(self):
26+
"""
27+
Boot VxWorks on sabrelite and wait for the shell prompt.
28+
29+
The VxWorks image and DTB are expected at a path defined by the
30+
QEMU_TEST_VXWORKS_SABRELITE_SDK environment variable
31+
(default: /opt/wrsdk/vxworks-images).
32+
33+
Expected layout:
34+
<SDK_PATH>/sabrelite/uVxWorks
35+
<SDK_PATH>/sabrelite/imx6q-sabrelite.dtb
36+
"""
37+
kernel = os.path.join(BSP_DIR, 'uVxWorks')
38+
dtb = os.path.join(BSP_DIR, 'imx6q-sabrelite.dtb')
39+
40+
if not os.path.exists(kernel):
41+
self.skipTest(f'VxWorks kernel image not found: {kernel}')
42+
if not os.path.exists(dtb):
43+
self.skipTest(f'VxWorks DTB not found: {dtb}')
44+
45+
self.set_machine('sabrelite')
46+
# The sabrelite board uses the second UART as serial console,
47+
# so we set console_index=1 and add -serial null for the first.
48+
self.vm.set_console(console_index=1)
49+
self.vm.add_args('-smp', '4')
50+
self.vm.add_args('-m', '1G')
51+
self.vm.add_args('-serial', 'null')
52+
self.vm.add_args('-kernel', kernel)
53+
self.vm.add_args('-dtb', dtb)
54+
self.vm.launch()
55+
56+
wait_for_console_pattern(self, '->')
57+
58+
59+
if __name__ == '__main__':
60+
QemuSystemTest.main()

0 commit comments

Comments
 (0)