Skip to content
This repository has been archived by the owner on Jan 12, 2021. It is now read-only.

Add network and efi_loader test coverage to Travis-CI #9

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/travis-ci/conf.qemu-x86_na
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
console_impl=qemu
qemu_machine="pc"
qemu_binary="qemu-system-i386"
qemu_extra_args="-nographic -cpu qemu32 -netdev user,id=net0,tftp=/tftpboot -device e1000,netdev=net0"
qemu_extra_args="-nographic -cpu qemu32 -netdev user,id=net0,tftp=${UBOOT_TRAVIS_BUILD_DIR} -device e1000,netdev=net0"
qemu_kernel_args="-bios ${U_BOOT_BUILD_DIR}/u-boot.rom"
reset_impl=none
flash_impl=none
2 changes: 1 addition & 1 deletion bin/travis-ci/conf.vexpress_ca15_tc2_qemu
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
console_impl=qemu
qemu_machine="vexpress-a15"
qemu_binary="qemu-system-arm"
qemu_extra_args="-nographic -m 1G -tftp /tftpboot"
qemu_extra_args="-nographic -m 1G -tftp ${UBOOT_TRAVIS_BUILD_DIR}"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The x86 script has "-netdev user,id=net0" in qemu_extra_args. Is something similar not needed for the vexpress scripts too, or do they default to having an emulated NIC?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The x86 script creates a new e1000 network device (-device e1000) and user space network as backend for it. The arm ones already have a network device as part of their board definition and the -tftp option modifies properties of the user space netdev that is spawned by the board.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is also another copy/paste example from my local setup. Telling QEMU to add a network device is more along the lines of "Add this type of thing here" rather than "add a sensible network device" sadly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it depends. You can use the old-style -net commands. qemu-system-arm -M vexpress-a15 -net nic -net user,... should give you a similar effect to the -device and -netdev commands, just that device creation happens explicitly in the board file rather than generic bus slot magic.

But this is diverging and going into QEMU internals. All of the variants should work to some extent (except for -device for sysbus devices). It doesn't actually matter which one we use, as long as the guest gets to see the correct network device.

qemu_kernel_args="-kernel ${U_BOOT_BUILD_DIR}/u-boot"
reset_impl=none
flash_impl=none
2 changes: 1 addition & 1 deletion bin/travis-ci/conf.vexpress_ca9x4_qemu
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
console_impl=qemu
qemu_machine="vexpress-a9"
qemu_binary="qemu-system-arm"
qemu_extra_args="-nographic -m 1G -tftp /tftpboot"
qemu_extra_args="-nographic -m 1G -tftp ${UBOOT_TRAVIS_BUILD_DIR}"
qemu_kernel_args="-kernel ${U_BOOT_BUILD_DIR}/u-boot"
reset_impl=none
flash_impl=none
11 changes: 11 additions & 0 deletions py/travis-ci/travis_tftp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import os
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eventually we should move this into some common location that all hosts can share, perhaps even into the U-Boot test/py source tree. However, putting it here is just fine for now.

import binascii

def file2env(file_name):
file_full = os.environ['UBOOT_TRAVIS_BUILD_DIR'] + "/" + file_name

return {
"fn": file_name,
"size": os.path.getsize(file_full),
"crc32": hex(binascii.crc32(open(file_full, 'rb').read()) & 0xffffffff)[2:],
}
10 changes: 10 additions & 0 deletions py/travis-ci/u_boot_boardenv_qemu_x86_na.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import travis_tftp

env__net_uses_pci = True
env__net_dhcp_server = True

env__net_tftp_readable_file = travis_tftp.file2env('u-boot')
env__efi_loader_helloworld_file = travis_tftp.file2env('lib/efi_loader/helloworld.efi')

env__efi_loader_check_smbios = True
env__efi_loader_grub_file = travis_tftp.file2env('grub_x86.efi')
7 changes: 7 additions & 0 deletions py/travis-ci/u_boot_boardenv_vexpress_ca15_tc2_qemu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import travis_tftp

env__net_dhcp_server = True

env__net_tftp_readable_file = travis_tftp.file2env('u-boot')
env__efi_loader_helloworld_file = travis_tftp.file2env('lib/efi_loader/helloworld.efi')
env__efi_loader_grub_file = travis_tftp.file2env('grub_arm.efi')
7 changes: 7 additions & 0 deletions py/travis-ci/u_boot_boardenv_vexpress_ca9x4_qemu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import travis_tftp

env__net_dhcp_server = True

env__net_tftp_readable_file = travis_tftp.file2env('u-boot')
env__efi_loader_helloworld_file = travis_tftp.file2env('lib/efi_loader/helloworld.efi')
env__efi_loader_grub_file = travis_tftp.file2env('grub_arm.efi')