* Miscellaneous fixes to scripts.
Signed-off-by: Suchi Raman <suchi.raman@plexxi.com>
// Lookup output port on this node for this destination.
// Using L2agent
- Output output = getOutputPort(node, wp);
+ Output output = getOutputPortL2Agent(node, wp);
if (output != null) {
fwdactions.add(output);
}
// Add a new rule with original destination + tap destinations.
for (InetAddress tapip: taplist) {
log.info("tap information = {}", tapip);
- Output output1 = getOutputPort(node, tapip);
+ Output output1 = getOutputPortL2Agent(node, tapip);
if (output1 != null) {
fwdactions = merge(fwdactions, output1);
}
}
- Output output2 = getOutputPort(node, dst);
+ Output output2 = getOutputPortL2Agent(node, dst);
if (output2 != null) {
fwdactions = merge(fwdactions, output2);
}
rest_method(put_url, "PUT")
print "create link A -> B"
- put_url = 'http://localhost:8080/affinity/nb/v2/affinity/default/create/link/a_to_b/from/a/to/b'
+ put_url = 'http://localhost:8080/affinity/nb/v2/affinity/default/create/link/a_to_b/from/b/to/a'
rest_method(put_url, "PUT")
print "add ip addresses to A"
put_url = 'http://localhost:8080/affinity/nb/v2/affinity/default/group/a/add/ip/10.0.0.1'
rest_method(put_url, "PUT")
- put_url = 'http://localhost:8080/affinity/nb/v2/affinity/default/group/a/add/ip/10.0.0.2'
- rest_method(put_url, "PUT")
+# put_url = 'http://localhost:8080/affinity/nb/v2/affinity/default/group/a/add/ip/10.0.0.2'
+# rest_method(put_url, "PUT")
print "add ip addresses to B"
put_url = 'http://localhost:8080/affinity/nb/v2/affinity/default/group/b/add/ip/10.0.0.3'
rest_method(put_url, "PUT")
+
def repeat_add_link():
print "create link inflows"
put_url = 'http://localhost:8080/affinity/nb/v2/affinity/default/create/link/inflows/from/clients/to/webservers'
set_waypoint_address('inflows', '10.0.0.2')
# Add tap servers.
-def test_tap():
+def test_tap_1():
tap_example()
set_tap('a_to_b', '10.0.0.4')
add_static_host_tap('a_to_b', '10.0.0.20')
get_affinity_link('a_to_b')
enable_affinity() # Tap to '10.0.0.4'.
+# Add tap servers.
+def test_tap_2():
+ tap_example()
+ set_tap('a_to_b', '10.0.0.2')
+ get_affinity_link('a_to_b')
+ enable_affinity() # Tap to '10.0.0.2'.
+
def add_isolate():
set_path_isolate()
get_affinity_link('inflows')
print "get_all_affinity_links..."
get_all_affinity_links()
- test_tap()
+ test_tap_2()
list_all_hosts()
return
return
print "Isolate successfully set for link %s" % (link_name)
+ # Remove isolate to the link.
+ def remove_isolate(self, link_name):
+ resp, content = self.http.request(self.url_prefix + "link/%s/unsetisolate" % (link_name), "PUT")
+ if (resp.status != 201):
+ print "Isolate could not be removed for link %s" % (link_name)
+ return
+ print "Isolate successfully removed for link %s" % (link_name)
+
+
# Add waypoint
def add_waypoint(self, link_name, ip):
resp, content = self.http.request(self.url_prefix + "link/%s/setwaypoint/%s" % (link_name, ip), "PUT")
name = "flow" + str(i)
flow.set_priority(2)
flow.set_protocol(1)
- flow_success = add_flow(flow, name)
+ try:
+ flow_success = add_flow(flow, name)
+ except Exception as e:
+ continue;
if (flow_success != 201):
success = False
return success
for item in data['flowStatistics']:
n = item['node']
for item in item['flowStatistic']:
- f = Flow(n, item['flow'])
+ try:
+ f = Flow(n, item['flow'])
+ except Exception, e:
+ continue
flows.append(f)
return flows
# Default subnet is required for the host tracker to work.
subnet_control = SubnetControl()
+ subnet_control.list()
subnet_control.add_subnet("defaultSubnet", "10.0.0.254/8")
raw_input("[Press enter when mininet is ready] ")
print "Subnet", subnet, "added"
else:
print "Subnet", subnet, "could not be added"
+
+ def list(self):
+ resp, content = self.http.request(self.url_prefix + "subnets", "GET")
+ if (resp.status != 200):
+ print "Error could not get subnets"
+ data = json.loads(content)
+ print data