def test_snat_pool_subnet_deletion(self):
        self._mock_external_dict([('supported', '192.168.0.2/24')])
        self.driver.apic_manager.ext_net_dict[
                'supported']['host_pool_cidr'] = '192.168.200.1/24'
        es = self.create_external_segment(name='supported',
            cidr='192.168.0.2/24',
            expected_res_status=201, shared=False)['external_segment']
        admin_ctx = context.get_admin_context()
        ext_net_id = self._db_plugin.get_subnet(
                admin_ctx, es['subnet_id'])['network_id']

        l3p = self.create_l3_policy(name='myl3',
            external_segments={es['id']: ['']})['l3_policy']
        l2p = self.create_l2_policy(name='myl2',
                                    l3_policy_id=l3p['id'])['l2_policy']
        ptg = self.create_policy_target_group(
            name="ptg1", l2_policy_id=l2p['id'])['policy_target_group']
        pt1 = self.create_policy_target(
            policy_target_group_id=ptg['id'])['policy_target']
        self._bind_port_to_host(pt1['port_id'], 'h1')

        mapping = self.driver.get_gbp_details(context.get_admin_context(),
            device=pt1['port_id'] % 'tap%s', host='h1')
        self.assertEqual(pt1['port_id'], mapping['port_id'])
        self.assertEqual(1, len(mapping['host_snat_ips']))
        self.assertEqual(es['name'],
            mapping['host_snat_ips'][0]['external_segment_name'])
        self.assertEqual("192.168.200.1",
            mapping['host_snat_ips'][0]['gateway_ip'])
        self.assertEqual("192.168.200.2",
            mapping['host_snat_ips'][0]['host_snat_ip'])
        self.assertEqual(24, mapping['host_snat_ips'][0]['prefixlen'])
        self.update_l3_policy(l3p['id'], external_segments={},
                expected_res_status=200)
        subnet_filter = {'name': [amap.HOST_SNAT_POOL],
                         'network_id': [ext_net_id]}
        internal_subnets = self._db_plugin.get_subnets(
                admin_ctx, filters=subnet_filter)
        self.assertEqual(1, len(internal_subnets))
        self.delete_external_segment(es['id'],
            expected_res_status=webob.exc.HTTPNoContent.code)
        internal_subnets = self._db_plugin.get_subnets(
                admin_ctx, filters=subnet_filter)
        self.assertEqual(0, len(internal_subnets))
dataset/ETHPy150Open openstack/group-based-policy/gbpservice/neutron/tests/unit/services/grouppolicy/test_apic_mapping.py/TestPolicyTarget.test_snat_pool_subnet_deletion/swapped operands of `%`