On Thu, 27 May 2021 at 10:11, Vinay Kumar <vinay.m.engg@gmail.com> wrote:
+                       # To kill remote-test-server executing through background ssh
+                       killcommand = "kill -9 \$(ps | grep remote-test-server |  grep -v \"grep\" | awk '{print \$1}')"
+                       cmd = cmd + "ssh %s root@%s \"%s\";" % (sshargs, qemu.ip, killcommand)

I don't think you actually need to kill the remote test server. As qemu will be stopped anyway, and with it, all the processes that run inside qemu.

Also, it's better to use cmd only to execute the tests. Starting the server is better done through SSHControl.run(), and copying the binary via SSHControl.copy_to() - see examples in selfttest's imagefeatures.py or runtime_test.py.

Alex