[Avocado-devel] Subprocess termination

Radek Duda rduda at redhat.com
Thu Feb 16 15:38:07 UTC 2017


Dear avocado users and developers,
I have made a testcase in which is executed nc process in run function :
(simplified version):

from avocado.utils import process

def run(vt_test, test_params, env):
  cmd = "nc -l %s" % test_params['some_port']
  nc_process = process.SubProcess(cmd)
  return

after testcase is executed, nc does not terminate and is still present. To
avoid this I have to kill the process e.g. by
process.safe_kill(nc_process_pid, signal.SIGKILL)

It is pretty awkward to close the process manually particularly in case of
complex testcase code
Shouldn't be the subprocess killed automatically after test exits?
After all its called *Sub*Process


regards,

Radek Duda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/avocado-devel/attachments/20170216/643b5838/attachment.htm>


More information about the Avocado-devel mailing list