diff options
Diffstat (limited to 'test/functest/utils.py')
-rw-r--r-- | test/functest/utils.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/functest/utils.py b/test/functest/utils.py index 58155ac..be08572 100644 --- a/test/functest/utils.py +++ b/test/functest/utils.py @@ -26,8 +26,36 @@ DEFAULT_FLAVOR = ft_utils.get_parameter_from_yaml( "defaults.flavor", config_file) +def create_net(neutron_client, name): + logger.debug("Creating network %s", name) + net_id = os_utils.create_neutron_net(neutron_client, name) + if not net_id: + logger.error( + "There has been a problem when creating the neutron network") + sys.exit(-1) + return net_id + + +def create_subnet(neutron_client, name, cidr, net_id): + logger.debug("Creating subnet %s in network %s with cidr %s", + name, net_id, cidr) + subnet_id = os_utils.create_neutron_subnet(neutron_client, + name, + cidr, + net_id) + if not subnet_id: + logger.error( + "There has been a problem when creating the neutron subnet") + sys.exit(-1) + return subnet_id + + def create_network(neutron_client, net, subnet1, cidr1, router, subnet2=None, cidr2=None): + """Network assoc will not work for networks/subnets created by this function. + + It is an ODL limitation due to it handling routers as vpns. + See https://bugs.opendaylight.org/show_bug.cgi?id=6962""" network_dic = os_utils.create_network_full(neutron_client, net, subnet1, |