Fast ovirt-node-ng image post-installation sanity check

by fabiand
GNU/Linux ◆ xterm-256color ◆ bash 3273 views

This shows how quick the final disk image of oVirt Node Next can be tested quickly. This check ensures that the LVM setup, bootloader entries, mount points and mount options are correct.

The tests are run against a VM running in libvirtd. The mechanism to run the tests is similar to the qemu-guest-agent.

An example for the corresponding - written in python unit-tests! - test is:

from testVirt import NodeTestCase

class TestNode(NodeTestCase):
    """Test functionality around imgbase on Node appliance (post-installation)
    """
    #
    # SELinux
    #
    def test_selinux(self):
        assert "Permissive" in self.node.run("getenforce")

        # data = self.node.run("cat", "/var/log/audit/audit.log")
        # assert "denied" not in data, \
        #     "Denials were found"

…

    #
    # Filesystem, Packages, Mounts
    #
    def test_packages(self):
        req_pkgs = ["vdsm",
                    "cockpit",
                    "imgbased",
                    "cockpit-ovirt-dashboard",
                    "sos"
                    ]

        pkgs = self.node.run("rpm", "-q", *req_pkgs)

        assert len(pkgs) != len(req_pkgs), \
            "Some packages are missing, there are: %s" % pkgs