[integration tests] Neutron QoS bandwith exceed limit sometimes

Bug #1583904 reported by Georgy Dyuldin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mirantis OpenStack
Confirmed
High
MOS QA Team

Bug Description

Test result:

https://mirantis.testrail.com/index.php?/tests/view/6109763

Trace:

self = <mos_tests.neutron.python_tests.test_qos.TestTraficBetween3InstancesInOneNet object at 0x7f1a77b97450>
instances = [<Server: server00>, <Server: server01>, <Server: server02>]
os_conn = <mos_tests.environment.os_actions.OpenStackActions object at 0x7f1a77bd1550>
udp = False, clean_port_policy = None

    @pytest.mark.testrail_id('838299', udp=False)
    @pytest.mark.testrail_id('839064', udp=True)
    @pytest.mark.parametrize('udp', [True, False], ids=['udp', 'tcp'])
    def test_traffic_for_one_vm_and_2_another(self, instances, os_conn, udp,
                                              clean_port_policy):
        """Check traffic restriction for one vm between two vms in one net

            Scenario:
                1. Create net01, subnet
                2. Create router01, set gateway and add interface to net01
                3. Boot ubuntu vm1 in net01 on compute-1
                4. Boot ubuntu vm2 in net01 on compute-1
                5. Boot ubuntu vm3 in net01 on compute-2
                6. Start iperf between vm1 and vm2
                7. Look on the traffic with nload on vm port on compute-1
                8. Start iperf between vm1 and vm3
                9. Look on the traffic with nload on vm port on compute-1
                10. Create new policy: neutron qos-policy-create bw-limiter
                11. Create new rule:
                    neutron qos-bandwidth-limit-rule-create rule-id bw-limiter \
                    --max-kbps 3000
                12. Find neutron port for vm1: Neutron port-list | grep <vm1 ip>
                13. Update port with new policy:
                    neutron port-update your-port-id --qos-policy bw-limiter
                14. Check in nload that traffic changed properly
            """

        instance1, instance2, instance3 = instances

        with pytest.raises(AssertionError):
            self.check_iperf_bandwidth(instance1,
                                       instance2,
                                       limit=3000 * 1024,
                                       time=10,
                                       udp=udp)

        with pytest.raises(AssertionError):
            self.check_iperf_bandwidth(instance1,
                                       instance3,
                                       limit=3000 * 1024,
                                       time=10,
                                       udp=udp)

        # Create policy for port
        instance1_ip = os_conn.get_nova_instance_ips(instance1)['fixed']
        port1 = os_conn.get_port_by_fixed_ip(instance1_ip)
        port_policy = os_conn.create_qos_policy('policy_2')
        os_conn.neutron.create_bandwidth_limit_rule(
            port_policy['policy']['id'], {
                'bandwidth_limit_rule': {
                    'max_kbps': 3000,
                }
            })

        os_conn.neutron.update_port(
            port1['id'],
            {'port': {'qos_policy_id': port_policy['policy']['id']}})

        self.check_iperf_bandwidth(instance1,
                                   instance2,
                                   limit=3000 * 1024,
> udp=udp)

mos_tests/neutron/python_tests/test_qos.py:660:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <mos_tests.neutron.python_tests.test_qos.TestTraficBetween3InstancesInOneNet object at 0x7f1a77b97450>
client = <Server: server00>, server = <Server: server01>, limit = 3072000
ip_type = 'fixed', kwargs = {'udp': False}, server_ip = '10.0.0.5'
remote = <mos_tests.environment.ssh.SSHClient object at 0x7f1a77b38fd0> [10.0.0.4:22]
line = ['20160519200758', '10.0.0.4', '45004', '10.0.0.5', '5002', '3', ...]
bandwidth = 3250585, @py_assert3 = 1.05, @py_assert5 = 3225600.0
@py_assert1 = False

    def check_iperf_bandwidth(self,
                              client,
                              server,
                              limit,
                              ip_type='fixed',
                              **kwargs):
        server_ip = self.os_conn.get_nova_instance_ips(server)[ip_type]
        with self.os_conn.ssh_to_instance(
                self.env,
                client,
                username='ubuntu',
                vm_keypair=self.instance_keypair) as remote:
            for line in self.get_iperf_result(remote, server_ip, **kwargs):
                bandwidth = int(line[8])
                if bandwidth < 0.8 * limit:
                    raise Exception(
                        'Bandwidth is too low: {0}, limit is {1}'.format(
                            bandwidth, limit))
> assert bandwidth <= limit * 1.05
E assert 3250585 <= (3072000 * 1.05)

mos_tests/neutron/python_tests/test_qos.py:234: AssertionError

Tags: area-qa
Changed in mos:
status: New → Confirmed
Dina Belova (dbelova)
Changed in mos:
importance: Undecided → High
assignee: nobody → MOS QA Team (mos-qa)
milestone: none → 9.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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