

def test_management_network_has_gw(self):
    net_meta = self.env.get_default_networks_metadata().copy()
    mgmt = filter((lambda n: (n['name'] == 'management')), net_meta['neutron']['networks'])[0]
    mgmt['use_gateway'] = True
    cluster = self.env.create(cluster_kwargs={
        'net_provider': 'neutron',
        'net_segment_type': 'gre',
    }, release_kwargs={
        'networks_metadata': net_meta,
        'api': False,
    }, nodes_kwargs=[{
        'pending_addition': True,
    }])
    resp = self.env.neutron_networks_get(cluster['id'])
    data = resp.json_body
    mgmt = filter((lambda n: (n['name'] == 'management')), data['networks'])[0]
    self.assertEqual(mgmt['gateway'], '192.168.0.1')
    strg = filter((lambda n: (n['name'] == 'storage')), data['networks'])[0]
    self.assertIsNone(strg['gateway'])

dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/test/integration/test_network_configuration.py TestNeutronNetworkConfigurationHandler.test_management_network_has_gw/original