fuel-web ci failure: test_orchestrator_serializer.py:1604: IndexError

Bug #1431881 reported by Aleksandra Fedorova
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Released
Critical
Evgeniy L
6.0.x
Invalid
Undecided
Evgeniy L

Bug Description

current fuel-master doesn't pass the CI:

https://fuel-jenkins.mirantis.com/job/verify-fuel-web/6323/

nailgun.test.integration.test_orchestrator_serializer.TestNeutronOrchestratorSerializer.test_node_list

Stacktrace

self = <nailgun.test.integration.test_orchestrator_serializer.TestNeutronOrchestratorSerializer testMethod=test_node_list>

    def test_node_list(self):
        assign_public_options = (False, True)
        for assign in assign_public_options:
            self.set_assign_public_to_all_nodes(self.cluster, assign)

            # Clear IPs
            for ip in self.db.query(models.IPAddr):
                self.db.delete(ip)
            self.db.flush()

            objects.NodeCollection.prepare_for_deployment(self.cluster.nodes)
            node_list = self.serializer.get_common_attrs(self.cluster)['nodes']

            roles_w_public_count = 0

            # Check right nodes count with right roles
            self.assert_roles_flattened(node_list)

            # Check common attrs
            for node in node_list:
                node_db = self.db.query(Node).get(int(node['uid']))
                is_public = objects.Node.should_have_public(node_db)
                if is_public:
                    self.assertEqual(node['public_netmask'], '255.255.255.0')
                    roles_w_public_count += 1
                else:
                    self.assertFalse('public_netmask' in node)
                self.assertEqual(node['internal_netmask'], '255.255.255.0')
                self.assertEqual(node['storage_netmask'], '255.255.255.0')
                self.assertEqual(node['uid'], str(node_db.id))
                self.assertEqual(node['name'], 'node-%d' % node_db.id)
                self.assertEqual(
                    node['fqdn'],
                    'node-%d.%s' % (node_db.id, settings.DNS_DOMAIN))

            # We have 6 roles on 4 nodes summarily.
            # Only 1 node w 2 roles (controller+cinder) will have public
            # when 'assign_to_all_nodes' option is switched off
            self.assertEqual(roles_w_public_count, 6 if assign else 2)

            # Check uncommon attrs
            node_uids = sorted(set([n['uid'] for n in node_list]))
            man_ip = [str(ip) for ip in IPRange('192.168.0.1', '192.168.0.4')]
            pub_ip = [str(ip) for ip in IPRange('172.16.0.2', '172.16.0.5')]
            sto_ip = [str(ip) for ip in IPRange('192.168.1.1', '192.168.1.4')]
            expected_list = [
                {'roles': ['controller', 'cinder']},
                {'roles': ['compute', 'cinder']},
                {'roles': ['compute']},
                {'roles': ['cinder']}]
            for i in range(len(expected_list)):
                expected_list[i]['attrs'] = {'uid': node_uids[i]}
                if assign:
                    expected_list[i]['attrs']['public_address'] = pub_ip[i]
            if not assign:
                expected_list[0]['attrs']['public_address'] = pub_ip[0]

            # Check if ips are unique for node and
            # they are the same for all nodes roles
            used_man_ip, used_pub_ip, used_sto_ip = [], [], []
            for expected in expected_list:
                attrs = expected['attrs']

                ref_node = self.filter_by_uid(node_list, attrs['uid'])[0]
                is_public = objects.Node.should_have_public(
                    objects.Node.get_by_mac_or_uid(node_uid=attrs['uid']))
                self.assertTrue(ref_node['internal_address'] in man_ip)
                self.assertTrue(ref_node['storage_address'] in sto_ip)
                self.assertFalse(ref_node['internal_address'] in used_man_ip)
                self.assertFalse(ref_node['storage_address'] in used_sto_ip)
                used_man_ip.append(ref_node['internal_address'])
                used_sto_ip.append(ref_node['storage_address'])
                # Check if pubclic ip field exists
                if is_public:
                    self.assertTrue(ref_node['public_address'] in pub_ip)
                    self.assertFalse(ref_node['public_address'] in used_pub_ip)
                    used_pub_ip.append(ref_node['public_address'])

                for role in expected['roles']:
                    nodes = self.filter_by_role(node_list, role)
> node = self.filter_by_uid(nodes, attrs['uid'])[0]
E IndexError: list index out of range

nailgun/test/integration/test_orchestrator_serializer.py:1604: IndexError

Evgeniy L (rustyrobot)
Changed in fuel:
assignee: Fuel Python Team (fuel-python) → Evgeniy L (rustyrobot)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (master)

Fix proposed to branch: master
Review: https://review.openstack.org/164192

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (master)

Reviewed: https://review.openstack.org/164192
Committed: https://git.openstack.org/cgit/stackforge/fuel-web/commit/?id=f421b8d535ad3d5862e0979728fa2d25e486769c
Submitter: Jenkins
Branch: master

commit f421b8d535ad3d5862e0979728fa2d25e486769c
Author: Evgeniy L <email address hidden>
Date: Fri Mar 13 17:21:15 2015 +0300

    Fix "99" > "100" sotring problem in serializer test

    Change-Id: Ib25ae4befd5120c88a87c1787a131c5f0abf76f6
    Closes-bug: #1431881

Changed in fuel:
status: In Progress → Fix Committed
Changed in fuel:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.