HomePhabricator

Firewall.py: Add function to kill process by its port number

Description

Firewall.py: Add function to kill process by its port number

This framework uses remote execution module's kill_job function to
kill the netcat listen process. But kill_job does not kill the
remote process instantly. This patch implements two new function
kill_process and find_pid for futrure use in the Firewall class.
kill_process is to make an instant kill for the port-using-process
and find_pid is to find the PID associated with a port number.

This patch uses fuser utility to find the PID associated with a port.

Bug: T252950
Change-Id: Ib662bc4975df2758c3c402587133150d85051437

Details

Provenance
PrivacybatmAuthored on May 25 2020, 5:57 PM
Parents
rOSTP7a7aaa237f15: transfer.py: Modularize option_parse function
Branches
Unknown
Tags
Unknown
ChangeId
Ib662bc4975df2758c3c402587133150d85051437