Example #1
0
def bug_1964117_workaround():
    """Apply Bug #1964117 if allowed."""
    if openstack.ovn_present():
        # Issue only known to affect ml2 ovs so if do not apply work around
        # to ovn deploys.
        return
    allow_pkg_list = ['2.16.0-0ubuntu2.1~cloud0']
    allow_release_list = ['focal_xena']
    _allow_release_list = [
        openstack.get_os_release(r) for r in allow_release_list
    ]
    current_release = openstack.get_os_release()
    if current_release in _allow_release_list:
        cmd_out = zaza.model.run_on_leader(
            'octavia', """dpkg -l | awk '/openvswitch-switch/ {print $3;}'""")
        pkg_version = cmd_out['Stdout'].strip()
        if pkg_version in allow_pkg_list:
            logging.info('Disabling port security to work around bug #1964117')
            disable_ohm_port_security()
        else:
            msg = (
                "Detected Xena deploy and package version {} is not in the "
                "allow list {}. If you believe that bug #1964117 has been "
                "resolved please remove the call to this function. If the "
                "new package does not resolve bug #1964117 then please add "
                "the new package version to the 'allow_pkg_list' defined at "
                "the start of this function. If changes are required please "
                "raise a PR againt "
                "https://github.com/openstack-charmers/zaza-openstack-tests"
                "".format(pkg_version, allow_pkg_list))
            raise Exception(msg)
Example #2
0
    def test_pause_resume(self):
        """Run pause and resume tests.

        Pause service and check services are stopped, then resume and check
        they are started.
        """
        services = [
            'apache2',
            'octavia-health-manager',
            'octavia-housekeeping',
            'octavia-worker',
        ]
        if openstack_utils.ovn_present():
            services.append('octavia-driver-agent')
        logging.info('Skipping pause resume test LP: #1886202...')
        return
        logging.info('Testing pause resume (services="{}")'.format(services))
        with self.pause_resume(services, pgrep_full=True):
            pass