diff options
author | jose.lausuch <jose.lausuch@ericsson.com> | 2015-06-02 01:29:03 +0200 |
---|---|---|
committer | jose.lausuch <jose.lausuch@ericsson.com> | 2015-06-02 01:29:03 +0200 |
commit | 0864734872d93db29e6fb66ca6d3451e37e09588 (patch) | |
tree | 3ba283470daf36b0c68b850c21961f8cdbdf1073 /testcases/functest_utils.py | |
parent | 80b9920c73677cf5ec85bcf65a0609b7e39ec2a8 (diff) |
vPing.py: Fixed IPs for VMs, Not DHCP
JIRA: FUNCTEST-3
Change-Id: Ib921262cfe153e47b88ba268199a66bc47950893
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
Diffstat (limited to 'testcases/functest_utils.py')
-rw-r--r-- | testcases/functest_utils.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/testcases/functest_utils.py b/testcases/functest_utils.py index 7b61198d..f879a1a9 100644 --- a/testcases/functest_utils.py +++ b/testcases/functest_utils.py @@ -163,6 +163,20 @@ def remove_interface_router(neutron_client, router_id, subnet_id): print "Error:", sys.exc_info()[0] return False +def create_neutron_port(neutron_client, name, network_id, ip): + json_body = {'port': { + 'admin_state_up': True, + 'name': name, + 'network_id': network_id, + 'fixed_ips': [{"ip_address": ip}] + }} + try: + port = neutron_client.create_port(body=json_body) + return port['port']['id'] + except: + print "Error:", sys.exc_info()[0] + return False + def get_network_id(neutron_client, network_name): networks = neutron_client.list_networks()['networks'] |