[qmtest] sudo?

eichin at metacarta.com eichin at metacarta.com
Fri Mar 7 16:12:53 UTC 2003


> Anyway, interactively invoking Python and then execing sudo didn't do
>>> os.execvp( "/usr/bin/sudo", ["ls"] )

Standard unix: execvp *isn't* spawn - it actually replaces the current
process.  If you're going to use it explicitly, you need to fork, as
well.  Consider instead using pyexpect, and "expect.popen2"; I've
found it works fine for writing tests that ssh out to other machines...



More information about the qmtest mailing list