Esempio n. 1
0
    def test_200_run_openstack_upgrade(self):
        """Run openstack upgrade, but work out what to do.

        TODO: This is really inefficient at the moment, and doesn't (yet)
        determine which ubuntu version to work from.  Don't use until we can
        make it better.
        """
        # get the tests_options / openstack-upgrade.detect-using-charm so that
        # the ubuntu version and OpenStack version can be detected.
        try:
            detect_charm = (
                zaza.global_options.get_options()
                .openstack_upgrade.detect_using_charm)
        except KeyError:
            raise exceptions.InvalidTestConfig(
                "Missing tests_options.openstack-upgrade.detect-charm config.")

        unit = zaza.model.get_lead_unit(detect_charm)
        ubuntu_version = generic.get_series(unit)
        logging.info("Current version detected from {} is {}"
                     .format(detect_charm, ubuntu_version))

        logging.info(
            "Getting OpenStack version from %s ..." % detect_charm)
        current_versions = openstack_utils.get_current_os_versions(
            [detect_charm])
        if not current_versions:
            raise exceptions.ApplicationNotFound(
                "No version found for {}?".format(detect_charm))

        logging.info("current version: %s" % current_versions[detect_charm])
        # Find the lowest value openstack release across all services and make
        # sure all servcies are upgraded to one release higher than the lowest
        from_version = upgrade_utils.get_lowest_openstack_version(
            current_versions)
        logging.info("from version: %s" % from_version)
        to_version = upgrade_utils.determine_next_openstack_release(
            from_version)[1]
        logging.info("to version: %s" % to_version)
        target_source = upgrade_utils.determine_new_source(
            ubuntu_version, from_version, to_version, single_increment=True)
        logging.info("target source: %s" % target_source)
        assert target_source is not None
        openstack_upgrade.run_upgrade_tests(target_source)
Esempio n. 2
0
    def test_408_rmq_amqp_messages_all_units_ssl_on(self):
        """Send (and check) amqp messages to every rmq unit (ssl enabled).

        Sends amqp messages to every rmq unit, and check every rmq
        unit for messages. Uses Standard ssl tcp port.

        """
        units = zaza.model.get_units(self.application_name)

        # http://pad.lv/1625044
        if CompareHostReleases(get_series(units[0])) <= 'trusty':
            logging.info('SKIP')
            logging.info('Skipping SSL tests due to client'
                         ' compatibility issues')
            return
        logging.info('Checking amqp message publish/get on all units '
                     '(ssl on)...')

        self._test_rmq_amqp_messages_all_units(units, ssl=True, port=5671)
        logging.info('OK')
Esempio n. 3
0
    def test_410_rmq_amqp_messages_all_units_ssl_alt_port(self):
        """Send (and check) amqp messages to every rmq unit (alt ssl port).

        Send amqp messages with ssl on, to every rmq unit and check
        every rmq unit for messages.  Custom ssl tcp port.

        """
        units = zaza.model.get_units(self.application_name)

        # http://pad.lv/1625044
        if CompareHostReleases(get_series(units[0])) <= 'trusty':
            logging.info('SKIP')
            logging.info('Skipping SSL tests due to client'
                         ' compatibility issues')
            return
        logging.debug('Checking amqp message publish/get on all units '
                      '(ssl on)...')

        units = zaza.model.get_units(self.application_name)
        self._test_rmq_amqp_messages_all_units(units, ssl=True, port=5999)
        logging.info('OK')