'Check that netutils properly decides whether to inject based on
whether the supplied subnet is static or dynamic.'

def _setup_injected_network_scenario(self, should_inject=True, use_ipv4=True, use_ipv6=False, gateway=True, dns=True, two_interfaces=False, libvirt_virt_type=None):

    network = fake_network_cache_model.new_network({'subnets': []})
    subnet_dict = {}
    if (not gateway):
        subnet_dict['gateway'] = None
    if (not dns):
        subnet_dict['dns'] = None
    if (not should_inject):
        subnet_dict['dhcp_server'] = '10.10.0.1'
    if use_ipv4:
        network.add_subnet(fake_network_cache_model.new_subnet(subnet_dict))
    if (should_inject and use_ipv6):
        gateway_ip = fake_network_cache_model.new_ip(dict(address='1234:567::1'))
        ip = fake_network_cache_model.new_ip(dict(address='1234:567::2'))
        ipv6_subnet_dict = dict(cidr='1234:567::/48', gateway=gateway_ip, dns=[fake_network_cache_model.new_ip(dict(address='2001:4860:4860::8888')), fake_network_cache_model.new_ip(dict(address='2001:4860:4860::8844'))], ips=[ip])
        if (not gateway):
            ipv6_subnet_dict['gateway'] = None
        network.add_subnet(fake_network_cache_model.new_subnet(ipv6_subnet_dict))
    network['meta']['injected'] = True
    vif = fake_network_cache_model.new_vif({'network': network})
    vifs = [vif]
    if two_interfaces:
        vifs.append(vif)
    nwinfo = model.NetworkInfo(vifs)
    return netutils.get_injected_network_template(nwinfo, libvirt_virt_type=libvirt_virt_type)
