-
- @staticmethod
- def start_the_tcpdump_on_the_node(from_node, from_port, filter_ip):
- """
- Start the tcpdump on the frome_node.
-
- :param from_node: Will execute the tcpdump on this node.
- :param from_port: Will capture the packets on this interface.
- :param filter_ip: filter the dest ip.
- :type from_node: dict
- :type from_port: str
- :type filter_ip: str
- :returns: none
- :raises RuntimeError: If the script "start_tcpdump.sh" fails.
- """
-
- interface_name = Topology.get_interface_name(from_node, from_port)
-
- ssh = SSH()
- ssh.connect(from_node)
-
- cmd = 'cd {0}/nsh_sfc_tests/sfc_scripts/ && sudo ./start_tcpdump.sh ' \
- '{1} {2}'.format(con.REMOTE_FW_DIR, interface_name, filter_ip)
-
- (ret_code, _, _) = ssh.exec_command(cmd, timeout=600)
- if ret_code != 0:
- raise RuntimeError('Failed to exec start_tcpdump.sh at node {0}'.
- format(from_node['host']))