예제 #1
0
    def spawn_three_vms_across_three_virt_nodes(self):
        """Spawn three vm nodes across three slave nodes

        Scenario:
            1. Create cluster
            2. Assign compute and virt roles to three slave nodes
            3. Upload VM configuration for one VM to each slave node
            4. Spawn VMs
            5. Wait till VMs become available for allocation

        Duration: 60m
        """

        self.env.revert_snapshot("ready_with_3_slaves")

        with self.env.d_env.get_admin_remote() as remote:
            checkers.enable_advanced_mode(remote, '/etc/fuel/version.yaml')
            checkers.restart_nailgun(remote)

        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=settings.DEPLOYMENT_MODE_HA,
            settings={
                'net_provider': 'neutron',
                'net_segment_type': settings.NEUTRON_SEGMENT['tun']
            })

        asserts.assert_true(settings.HARDWARE['slave_node_memory'] >= 1024,
                            "Wrong SLAVE_NODE_MEMORY value: {0}."
                            "Please allocate more than 1024Mb.".
                            format(settings.HARDWARE['slave_node_memory']))

        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['compute', 'virt'],
                'slave-02': ['compute', 'virt'],
                'slave-03': ['compute', 'virt']
            })

        hw_nodes = self.fuel_web.client.list_cluster_nodes(cluster_id)
        for node in hw_nodes:
            self.fuel_web.client.create_vm_nodes(
                node['id'],
                [
                    {
                        "id": 1,
                        "mem": 1,
                        "cpu": 1
                    }
                ])

        self.fuel_web.spawn_vms_wait(cluster_id)
        wait(lambda: len(self.fuel_web.client.list_nodes()) == 6,
             timeout=60 * 60,
             timeout_msg=("Timeout waiting 6 available nodes, "
                          "current nodes: \n{0}" + '\n'.join(
                              ['Name: {0}, status: {1}, online: {2}'.
                               format(i['name'], i['status'], i['online'])
                               for i in self.fuel_web.client.list_nodes()])))
예제 #2
0
    def deploy_ha_one_controller_zabbix(self):
        """Deploy cluster in ha mode 1 controller with zabbix-server

        Scenario:
            1. Setup master node
            2. Enable 'experimental' in Nailgun
            3. Restart Nailgun
            4. Create cluster in ha mode with 1 controller
            5. Add 1 node with controller role
            6. Add 1 node with compute role
            7. Add 1 node with zabbix role
            8. Deploy the cluster
            9. Verify networks
            10. Check that zabbix server is running on the node
            11. Run OSTF
            12. Login in zabbix dashboard

        Duration 30m
        Snapshot: deploy_ha_one_controller_zabbix
        """
        self.env.revert_snapshot("ready_with_3_slaves")

        with self.env.d_env.get_admin_remote() as admin_remote:
            # Turn on experimental mode
            checkers.check_enable_experimental_mode(
                admin_remote, '/etc/fuel/version.yaml')

            # restart nailgun
            checkers.restart_nailgun(admin_remote)

        # check if zabbix role appears
        self.fuel_web.assert_release_role_present(
            release_name=hlp.OPENSTACK_RELEASE,
            role_name='zabbix-server')

        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=hlp.DEPLOYMENT_MODE,
            settings={
                'tenant': 'admin',
                'user': '******',
                'password': '******',
                'net_provider': 'neutron',
                'net_segment_type': hlp.NEUTRON_SEGMENT_TYPE,
            }
        )
        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['controller'],
                'slave-02': ['compute'],
                'slave-03': ['zabbix-server']
            }
        )
        self.fuel_web.deploy_cluster_wait(cluster_id)

        self.fuel_web.verify_network(cluster_id)
        self.fuel_web.run_ostf(cluster_id=cluster_id)

        # login in dashboard
        node_ip = self.fuel_web.get_nailgun_node_by_devops_node(
            self.env.d_env.get_node(name='slave-03'))['ip']

        dashboard_url = 'http://{0}/zabbix/'.format(node_ip)

        logger.debug("Zabbix dashboard {0}".format(dashboard_url))

        login_data = {'username': '******', 'password': '******'}

        zab_client = http.HTTPClientZabbix(url=dashboard_url)
        login_resp = zab_client.post(endpoint='index.php', data=login_data)
        assert_equals(login_resp.code, 200)
        assert_equals(login_resp.msg, 'OK')
        event_resp = zab_client.get(
            endpoint='events.php',
            cookie=login_resp.headers.get('Set-Cookie'))
        assert_equals(event_resp.code, 200)

        self.env.make_snapshot("deploy_ha_one_controller_zabbix")
예제 #3
0
    def deploy_ha_one_controller_zabbix(self):
        """Deploy cluster in ha mode 1 controller with zabbix-server

        Scenario:
            1. Setup master node
            2. Enable 'experimental' in Nailgun
            3. Restart Nailgun
            4. Create cluster in ha mode with 1 controller
            5. Add 1 node with controller role
            6. Add 1 node with compute role
            7. Add 1 node with zabbix role
            8. Deploy the cluster
            9. Verify networks
            10. Check that zabbix server is running on the node
            11. Run OSTF
            12. Login in zabbix dashboard

        Duration 30m
        Snapshot: deploy_ha_one_controller_zabbix
        """
        self.env.revert_snapshot("ready_with_3_slaves")

        with self.env.d_env.get_admin_remote() as admin_remote:
            # Turn on experimental mode
            checkers.check_enable_experimental_mode(
                admin_remote, '/etc/fuel/version.yaml')

            # restart nailgun
            checkers.restart_nailgun(admin_remote)

        # check if zabbix role appears
        self.fuel_web.assert_release_role_present(
            release_name=hlp.OPENSTACK_RELEASE,
            role_name='zabbix-server')

        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=hlp.DEPLOYMENT_MODE,
            settings={
                'tenant': 'admin',
                'user': '******',
                'password': '******',
            }
        )
        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['controller'],
                'slave-02': ['compute'],
                'slave-03': ['zabbix-server']
            }
        )
        self.fuel_web.deploy_cluster_wait(cluster_id)

        self.fuel_web.verify_network(cluster_id)
        self.fuel_web.run_ostf(cluster_id=cluster_id)

        # login in dashboard
        node_ip = self.fuel_web.get_nailgun_node_by_devops_node(
            self.env.d_env.get_node(name='slave-03'))['ip']

        dashboard_url = 'http://{0}/zabbix/'.format(node_ip)

        logger.debug("Zabbix dashboard {0}".format(dashboard_url))

        login_data = {'username': '******', 'password': '******'}

        zab_client = http.HTTPClientZabbix(url=dashboard_url)
        login_resp = zab_client.post(endpoint='index.php', data=login_data)
        assert_equals(login_resp.code, 200)
        assert_equals(login_resp.msg, 'OK')
        event_resp = zab_client.get(
            endpoint='events.php',
            cookie=login_resp.headers.get('Set-Cookie'))
        assert_equals(event_resp.code, 200)

        self.env.make_snapshot("deploy_ha_one_controller_zabbix")
예제 #4
0
    def deploy_simple_zabbix(self):
        """Deploy cluster in simple mode with zabbix-server

        Scenario:
            1. Setup master node
            2. Enable 'experimental' in Nailgun
            3. Restart Nailgun
            4. Create cluster
            5. Add 1 node with controller role
            6. Add 1 node with compute role
            7. Add 1 node with zabbix role
            8. Deploy the cluster
            9. Verify networks
            10. Check that zabbix server is running on the node
            11. Run OSTF
            12. Login in zabbix dashboard

        Snapshot: deploy_simple_zabbix

        """
        self.env.revert_snapshot("ready_with_3_slaves")

        node_ssh = self.env.get_ssh_to_remote(self.fuel_web.admin_node_ip)

        # Turn on experimental mode
        checkers.check_enable_experimental_mode(node_ssh,
                                                '/etc/fuel/version.yaml')

        # restart nailgun

        checkers.restart_nailgun(node_ssh)

        # check if zabbix role appears

        self.fuel_web.assert_release_role_present(
            release_name=hlp.OPENSTACK_RELEASE, role_name='zabbix-server')

        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=hlp.DEPLOYMENT_MODE_SIMPLE,
            settings={
                'tenant': 'admin',
                'user': '******',
                'password': '******'
            })
        self.fuel_web.update_nodes(
            cluster_id, {
                'slave-01': ['controller'],
                'slave-02': ['compute'],
                'slave-03': ['zabbix-server']
            })
        self.fuel_web.deploy_cluster_wait(cluster_id)
        os_conn = os_actions.OpenStackActions(
            self.fuel_web.get_nailgun_node_by_name('slave-01')['ip'])
        self.fuel_web.assert_cluster_ready(os_conn,
                                           smiles_count=6,
                                           networks_count=1,
                                           timeout=300)

        self.fuel_web.verify_network(cluster_id)

        self.fuel_web.run_ostf(cluster_id=cluster_id)

        # login in dashboard
        node_ip = self.fuel_web.get_nailgun_node_by_devops_node(
            self.env.get_virtual_environment().node_by_name('slave-03'))['ip']

        dashboard_url = 'http://{0}/zabbix/'.format(node_ip)

        logger.debug("Zabbix dashboard {0}".format(dashboard_url))

        login_data = {'username': '******', 'password': '******'}

        zab_client = http.HTTPClientZabbix(url=dashboard_url)
        login_resp = zab_client.post(endpoint='index.php', data=login_data)
        assert_equals(login_resp.code, 200)
        assert_equals(login_resp.msg, 'OK')
        event_resp = zab_client.get(
            endpoint='events.php', cookie=login_resp.headers.get('Set-Cookie'))
        assert_equals(event_resp.code, 200)

        self.env.make_snapshot("deploy_simple_zabbix")