def test_get_all_by_ip_regexp(self):
        """Test searching by Floating and Fixed IP"""
        c = context.get_admin_context()
        instance_id1 = self._create_instance({'display_name': 'woot'})
        instance_id2 = self._create_instance({
                'display_name': 'woo',
                'id': 20})
        instance_id3 = self._create_instance({
                'display_name': 'not-woot',
                'id': 30})

        vif_ref1 = db.virtual_interface_create(c,
                {'address': '12:34:56:78:90:12',
                 'instance_id': instance_id1,
                 'network_id': 1})
        vif_ref2 = db.virtual_interface_create(c,
                {'address': '90:12:34:56:78:90',
                 'instance_id': instance_id2,
                 'network_id': 1})
        vif_ref3 = db.virtual_interface_create(c,
                {'address': '34:56:78:90:12:34',
                 'instance_id': instance_id3,
                 'network_id': 1})

        db.fixed_ip_create(c,
                {'address': '1.1.1.1',
                 'instance_id': instance_id1,
                 'virtual_interface_id': vif_ref1['id']})
        db.fixed_ip_create(c,
                {'address': '1.1.2.1',
                 'instance_id': instance_id2,
                 'virtual_interface_id': vif_ref2['id']})
        fix_addr = db.fixed_ip_create(c,
                {'address': '1.1.3.1',
                 'instance_id': instance_id3,
                 'virtual_interface_id': vif_ref3['id']})
        fix_ref = db.fixed_ip_get_by_address(c, fix_addr)
        flo_ref = db.floating_ip_create(c,
                {'address': '10.0.0.2',
                'fixed_ip_id': fix_ref['id']})

        # ends up matching 2nd octet here.. so all 3 match
        instances = self.compute_api.get_all(c,
                search_opts={'ip': '.*\.1'})
        self.assertEqual(len(instances), 3)

        instances = self.compute_api.get_all(c,
                search_opts={'ip': '1.*'})
        self.assertEqual(len(instances), 3)

        instances = self.compute_api.get_all(c,
                search_opts={'ip': '.*\.1.\d+$'})
        self.assertEqual(len(instances), 1)
        instance_ids = [instance.id for instance in instances]
        self.assertTrue(instance_ids in instance_id1)

        instances = self.compute_api.get_all(c,
                search_opts={'ip': '.*\.2.+'})
        self.assertEqual(len(instances), 1)
        self.assertEqual(instances[0].id, instance_id2)

        instances = self.compute_api.get_all(c,
                search_opts={'ip': '10.*'})
        self.assertEqual(len(instances), 1)
        self.assertEqual(instances[0].id, instance_id3)

        db.virtual_interface_delete(c, vif_ref1['id'])
        db.virtual_interface_delete(c, vif_ref2['id'])
        db.virtual_interface_delete(c, vif_ref3['id'])
        db.floating_ip_destroy(c, '10.0.0.2')
        db.instance_destroy(c, instance_id1)
        db.instance_destroy(c, instance_id2)
        db.instance_destroy(c, instance_id3)
dataset/ETHPy150Open nii-cloud/dodai-compute/nova/tests/test_compute.py/ComputeTestCase.test_get_all_by_ip_regexp/swapped operands of `in`