blob: f5b17c24905f110761d2e22dc0d3525855a7a3e1 [file] [log] [blame]
andrewonlaba57a3042015-01-23 13:53:05 -05001
2def __init__(self):
3 self_ = self
4
5def printLog(main):
6 main.log.info("Print log success")
7
8def iptablesDropAllNodes(main, MN_ip, sw_port):
9 #INPUT RULES
10 main.ONOS1.handle.sendline(
11 "sudo iptables -A INPUT -p tcp -s "+
12 MN_ip+" --dport "+sw_port+" -j DROP")
13 main.ONOS2.handle.sendline(
14 "sudo iptables -A INPUT -p tcp -s "+
15 MN_ip+" --dport "+sw_port+" -j DROP")
16 main.ONOS3.handle.sendline(
17 "sudo iptables -A INPUT -p tcp -s "+
18 MN_ip+" --dport "+sw_port+" -j DROP")
19 main.ONOS4.handle.sendline(
20 "sudo iptables -A INPUT -p tcp -s "+
21 MN_ip+" --dport "+sw_port+" -j DROP")
22 main.ONOS5.handle.sendline(
23 "sudo iptables -A INPUT -p tcp -s "+
24 MN_ip+" --dport "+sw_port+" -j DROP")
25 main.ONOS6.handle.sendline(
26 "sudo iptables -A INPUT -p tcp -s "+
27 MN_ip+" --dport "+sw_port+" -j DROP")
28 main.ONOS7.handle.sendline(
29 "sudo iptables -A INPUT -p tcp -s "+
30 MN_ip+" --dport "+sw_port+" -j DROP")
31
32 main.ONOS1.handle.sendline(
33 "sudo iptables -A OUTPUT -p tcp -s "+
34 MN_ip+" --dport "+sw_port+" -j DROP")
35 main.ONOS2.handle.sendline(
36 "sudo iptables -A OUTPUT -p tcp -s "+
37 MN_ip+" --dport "+sw_port+" -j DROP")
38 main.ONOS3.handle.sendline(
39 "sudo iptables -A OUTPUT -p tcp -s "+
40 MN_ip+" --dport "+sw_port+" -j DROP")
41 main.ONOS4.handle.sendline(
42 "sudo iptables -A OUTPUT -p tcp -s "+
43 MN_ip+" --dport "+sw_port+" -j DROP")
44 main.ONOS5.handle.sendline(
45 "sudo iptables -A OUTPUT -p tcp -s "+
46 MN_ip+" --dport "+sw_port+" -j DROP")
47 main.ONOS6.handle.sendline(
48 "sudo iptables -A OUTPUT -p tcp -s "+
49 MN_ip+" --dport "+sw_port+" -j DROP")
50 main.ONOS7.handle.sendline(
51 "sudo iptables -A OUTPUT -p tcp -s "+
52 MN_ip+" --dport "+sw_port+" -j DROP")
53
54def uninstallAllNodes(main, node_ip_list):
55 for node in node_ip_list:
56 main.ONOSbench.onos_uninstall(node_ip = node)