summary refs log tree commit diff stats
path: root/tests/avocado/netdev-ethtool.py
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2024-08-30 15:38:11 +0200
committerThomas Huth <thuth@redhat.com>2024-09-04 11:11:31 +0200
commit4c0a2df81c9166a3a84293501008a85dfbe8a3a6 (patch)
tree0ba4dfd5535a493bdcee139cc6c5b8f7ed6eaed7 /tests/avocado/netdev-ethtool.py
parent34b17c0a6564833ae8eb9846ec9faedb212d80ac (diff)
downloadfocaccia-qemu-4c0a2df81c9166a3a84293501008a85dfbe8a3a6.tar.gz
focaccia-qemu-4c0a2df81c9166a3a84293501008a85dfbe8a3a6.zip
tests/functional: Convert some tests that download files via fetch_asset()
Now that we've got the Asset class with pre-caching, we can convert
some Avocado tests that use fetch_asset() for downloading their
required files.

Message-ID: <20240830133841.142644-18-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/avocado/netdev-ethtool.py')
-rw-r--r--tests/avocado/netdev-ethtool.py101
1 files changed, 0 insertions, 101 deletions
diff --git a/tests/avocado/netdev-ethtool.py b/tests/avocado/netdev-ethtool.py
deleted file mode 100644
index 5f33288f81..0000000000
--- a/tests/avocado/netdev-ethtool.py
+++ /dev/null
@@ -1,101 +0,0 @@
-# ethtool tests for emulated network devices
-#
-# This test leverages ethtool's --test sequence to validate network
-# device behaviour.
-#
-# SPDX-License-Identifier: GPL-2.0-or-late
-
-from avocado import skip
-from avocado_qemu import QemuSystemTest
-from avocado_qemu import wait_for_console_pattern
-
-class NetDevEthtool(QemuSystemTest):
-    """
-    :avocado: tags=arch:x86_64
-    :avocado: tags=machine:q35
-    """
-
-    # Runs in about 17s under KVM, 19s under TCG, 25s under GCOV
-    timeout = 45
-
-    # Fetch assets from the netdev-ethtool subdir of my shared test
-    # images directory on fileserver.linaro.org.
-    def get_asset(self, name, sha1):
-        base_url = ('https://fileserver.linaro.org/s/'
-                    'kE4nCFLdQcoBF9t/download?'
-                    'path=%2Fnetdev-ethtool&files=' )
-        url = base_url + name
-        # use explicit name rather than failing to neatly parse the
-        # URL into a unique one
-        return self.fetch_asset(name=name, locations=(url), asset_hash=sha1)
-
-    def common_test_code(self, netdev, extra_args=None):
-
-        # This custom kernel has drivers for all the supported network
-        # devices we can emulate in QEMU
-        kernel = self.get_asset("bzImage",
-                                "33469d7802732d5815226166581442395cb289e2")
-
-        rootfs = self.get_asset("rootfs.squashfs",
-                                "9793cea7021414ae844bda51f558bd6565b50cdc")
-
-        append = 'printk.time=0 console=ttyS0 '
-        append += 'root=/dev/sr0 rootfstype=squashfs '
-
-        # any additional kernel tweaks for the test
-        if extra_args:
-            append += extra_args
-
-        # finally invoke ethtool directly
-        append += ' init=/usr/sbin/ethtool -- -t eth1 offline'
-
-        # add the rootfs via a readonly cdrom image
-        drive = f"file={rootfs},if=ide,index=0,media=cdrom"
-
-        self.vm.add_args('-kernel', kernel,
-                         '-append', append,
-                         '-drive', drive,
-                         '-device', netdev)
-
-        self.vm.set_console(console_index=0)
-        self.vm.launch()
-
-        wait_for_console_pattern(self,
-                                 "The test result is PASS",
-                                 "The test result is FAIL",
-                                 vm=None)
-        # no need to gracefully shutdown, just finish
-        self.vm.kill()
-
-    def test_igb(self):
-        """
-        :avocado: tags=device:igb
-        """
-        self.common_test_code("igb")
-
-    def test_igb_nomsi(self):
-        """
-        :avocado: tags=device:igb
-        """
-        self.common_test_code("igb", "pci=nomsi")
-
-    # It seems the other popular cards we model in QEMU currently fail
-    # the pattern test with:
-    #
-    #   pattern test failed (reg 0x00178): got 0x00000000 expected 0x00005A5A
-    #
-    # So for now we skip them.
-
-    @skip("Incomplete reg 0x00178 support")
-    def test_e1000(self):
-        """
-        :avocado: tags=device:e1000
-        """
-        self.common_test_code("e1000")
-
-    @skip("Incomplete reg 0x00178 support")
-    def test_i82550(self):
-        """
-        :avocado: tags=device:i82550
-        """
-        self.common_test_code("i82550")