Activity log for bug #1668828

Date Who What changed Old value New value Message
2017-03-01 02:47:03 zhufl bug added bug
2017-03-01 02:49:20 zhufl description 1. Problem: test_list_servers_filtered_by_ip sometimes fails with: Traceback (most recent call last): File "/home/zfl/tempest_m_git_local/tempest/api/compute/servers/test_list_server_filters.py", line 284, in test_list_servers_filtered_by_ip self.assertNotIn(self.s2_name, map(lambda x: x['name'], servers)) File "/usr/lib/python2.7/site-packages/testtools/testcase.py", line 392, in assertNotIn self.assertThat(haystack, matcher, message) File "/usr/lib/python2.7/site-packages/testtools/testcase.py", line 433, in assertThat raise mismatch_error MismatchError: [u'tempest-ListServerFiltersTestJSON-instance-328761420'] matches Contains('tempest-ListServerFiltersTestJSON-instance-328761420') 2. Reason: We can see from nova code that filter by ip is always "regexp match", so if server2' ip happened to be part of server1's ip, then filter by server1's ip will also return server2. https://github.com/openstack/nova/blob/63805735c25a54ad1b9b97e05080c1a6153d8e22/nova/compute/api.py get_all 3. Solution: There are 3 possibles ways, 1) create servers with specified ips, such as 1.1.1.1, 1.1.1.2, 1.1.1.3 2) find the longest ip in servers, and filter it by that ip, then only one server will be returned 3) filter using server1's ip, and using assertIn or assertNotIn according to whether other server ip is part of server1's ip 1. Problem: test_list_servers_filtered_by_ip sometimes fails with: Traceback (most recent call last): File "/home/zfl/tempest_m_git_local/tempest/api/compute/servers/test_list_server_filters.py", line 284, in test_list_servers_filtered_by_ip self.assertNotIn(self.s2_name, map(lambda x: x['name'], servers)) File "/usr/lib/python2.7/site-packages/testtools/testcase.py", line 392, in assertNotIn self.assertThat(haystack, matcher, message) File "/usr/lib/python2.7/site-packages/testtools/testcase.py", line 433, in assertThat raise mismatch_error MismatchError: [u'tempest-ListServerFiltersTestJSON-instance-328761420'] matches Contains('tempest-ListServerFiltersTestJSON-instance-328761420') 2. Reason: We can see from nova code that filter by ip is always "regexp match", so if server2' ip happened to be part of server1's ip, then filter by server1's ip will also return server2. https://github.com/openstack/nova/blob/63805735c25a54ad1b9b97e05080c1a6153d8e22/nova/compute/api.py get_all 3. Solution: There are 3 possibles ways, 1) create servers with specified ips, such as 1.1.1.1, 1.1.1.2, 1.1.1.3 2) find the longest ip in servers, and filter it by that ip, then only one server will be returned 3) filter using server1's ip, and using assertIn or assertNotIn according to whether other server ip is part of server1's ip
2017-03-01 02:49:39 zhufl tempest: assignee zhufl (zhu-fanglei)
2017-03-01 02:49:43 zhufl tempest: status New In Progress
2017-03-01 20:13:49 Matt Riedemann bug task added nova
2017-03-01 20:28:46 Matt Riedemann nova: status New Triaged
2017-03-01 20:28:49 Matt Riedemann nova: importance Undecided Medium
2017-03-01 21:53:34 Matt Riedemann bug task deleted tempest
2017-03-01 22:27:50 Matt Riedemann summary test_list_servers_filtered_by_ip fails ccasionally ip filtering short circuits based on regex
2017-03-02 01:04:19 Matt Riedemann nova: assignee Matt Riedemann (mriedem)
2017-03-02 03:06:21 Matt Riedemann nova: status Triaged Invalid
2017-03-02 03:06:27 Matt Riedemann bug task added tempest
2017-03-02 03:06:34 Matt Riedemann tempest: status New Confirmed
2017-03-02 03:06:39 Matt Riedemann tempest: status Confirmed In Progress
2017-03-02 03:06:49 Matt Riedemann tempest: assignee zhufl (zhu-fanglei)
2017-03-07 06:53:41 OpenStack Infra tempest: status In Progress Fix Released