diff options
author | Juan Vidal <juan.vidal.allende@ericsson.com> | 2017-02-13 14:32:04 +0000 |
---|---|---|
committer | Brady Johnson <brady.allen.johnson@ericsson.com> | 2017-02-17 15:40:39 +0000 |
commit | 72b6571f2b448e27a1d8c50dd8f27e564004d687 (patch) | |
tree | a965201a58eb14bdd36f2aea135686adef1f05c6 /sfc/lib | |
parent | 75ac61401c83253d533983de6e2650f82fc4c427 (diff) |
Introduce new test case: symmetric service chain
JIRA: SFC-53
The goal is to verify that the traffic traverses the service chain, not only
in the uplink (client --> server) direction, but also in the downlink
(client <-- server) direction, which is the part that is not currently being
covered by other test cases.
Change-Id: I198a53e5afe3da1b397cee95627834856498b674
Signed-off-by: Juan Vidal <juan.vidal.allende@ericsson.com>
Diffstat (limited to 'sfc/lib')
-rw-r--r-- | sfc/lib/utils.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/sfc/lib/utils.py b/sfc/lib/utils.py index b1576803..2b01113c 100644 --- a/sfc/lib/utils.py +++ b/sfc/lib/utils.py @@ -237,6 +237,38 @@ def get_floating_ips(nova_client, neutron_client): return server_ip, client_ip, ips[1], ips[0] +# TODO (jvidal): This is pure scaffolding, it needs to be merged with +# get_floating_ips in the future +def get_floating_ips_2(nova_client, neutron_client): + sf_ip = None + client_ip = None + server_ip = None + instances = nova_client.servers.list() + for instance in instances: + floatip_dic = os_utils.create_floating_ip(neutron_client) + floatip = floatip_dic['fip_addr'] + instance.add_floating_ip(floatip) + logger.info("Instance name and ip %s:%s " % (instance.name, floatip)) + logger.info("Waiting for instance %s:%s to come up" % + (instance.name, floatip)) + if not ping(floatip): + logger.info("Instance %s:%s didn't come up" % + (instance.name, floatip)) + return None + + if instance.name == "server": + logger.info("Server:%s is reachable" % floatip) + server_ip = floatip + elif instance.name == "client": + logger.info("Client:%s is reachable" % floatip) + client_ip = floatip + else: + logger.info("SF:%s is reachable" % floatip) + sf_ip = floatip + + return server_ip, client_ip, sf_ip + + def start_http_server(ip): """Start http server on a given machine, Can be VM""" cmd = "\'python -m SimpleHTTPServer 80" |