diff options
author | Thomas Huth <thuth@redhat.com> | 2025-02-27 11:39:11 +0100 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2025-03-07 07:50:19 +0100 |
commit | 7b7f98efa7628a58fae594d3aa51b3c8a10293b3 (patch) | |
tree | 604a6841648c507d4d1af9b0de80ca52ab4df1f3 | |
parent | 2c92ecb678cddf4bf3ced98f94acd2f3691c21bc (diff) | |
download | qemu-7b7f98efa7628a58fae594d3aa51b3c8a10293b3.zip qemu-7b7f98efa7628a58fae594d3aa51b3c8a10293b3.tar.gz qemu-7b7f98efa7628a58fae594d3aa51b3c8a10293b3.tar.bz2 |
tests/functional/test_mips_malta: Add a network test via the pcnet NIC
The kernel has a driver for the pcnet NIC included, and the initrd has
a "tftp" command, so we can test a simple network transfer here, too.
Message-ID: <20250227103915.19795-3-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
-rwxr-xr-x | tests/functional/test_mips_malta.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/functional/test_mips_malta.py b/tests/functional/test_mips_malta.py index eaf3722..9697c7d 100755 --- a/tests/functional/test_mips_malta.py +++ b/tests/functional/test_mips_malta.py @@ -45,12 +45,15 @@ class MaltaMachineConsole(LinuxKernelTest): 'dcfe3a7fe3200da3a00d176b95caaa086495eb158f2bff64afc67d7e1eb2cddc') def test_mips_malta_cpio(self): + self.require_netdev('user') + self.set_machine('malta') + self.require_device('pcnet') + kernel_path = self.archive_extract( self.ASSET_KERNEL_4_5_0, member='boot/vmlinux-4.5.0-2-4kc-malta') initrd_path = self.uncompress(self.ASSET_INITRD) - self.set_machine('malta') self.vm.set_console() kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0 console=tty ' @@ -58,6 +61,8 @@ class MaltaMachineConsole(LinuxKernelTest): self.vm.add_args('-kernel', kernel_path, '-initrd', initrd_path, '-append', kernel_command_line, + '-netdev', 'user,id=n1,tftp=' + self.scratch_file('boot'), + '-device', 'pcnet,netdev=n1', '-no-reboot') self.vm.launch() self.wait_for_console_pattern('Boot successful.') @@ -66,6 +71,19 @@ class MaltaMachineConsole(LinuxKernelTest): 'BogoMIPS') exec_command_and_wait_for_pattern(self, 'uname -a', 'Debian') + + exec_command_and_wait_for_pattern(self, 'ip link set eth0 up', + 'eth0: link up') + exec_command_and_wait_for_pattern(self, + 'ip addr add 10.0.2.15 dev eth0', + '#') + exec_command_and_wait_for_pattern(self, 'route add default eth0', '#') + exec_command_and_wait_for_pattern(self, + 'tftp -g -r vmlinux-4.5.0-2-4kc-malta 10.0.2.2', '#') + exec_command_and_wait_for_pattern(self, + 'md5sum vmlinux-4.5.0-2-4kc-malta', + 'a98218a7efbdefb2dfdf9ecd08c98318') + exec_command_and_wait_for_pattern(self, 'reboot', 'reboot: Restarting system') # Wait for VM to shut down gracefully |