os.system0 use in resource SetUp methods

Steve Byan smb at egenera.com
Fri Nov 21 21:54:02 UTC 2003


I've written a couple of test extension classes modeled on 
ShellCommandTest and ShellScriptTest which use a remote shell to 
execute the tests on a remote host specified by a "node" resource 
extension class, which selects one host from those provided in the 
context by a target extension class.

I'd like to check the state of the selected host in the resource SetUp 
method. I've tried using code like this:

         # test that pServer is up and running
         if os.system("ping -c 3 " + remote_host + " >/dev/null") != 0:
             cause = "Can't ping " + blade + " at hostname " + 
remote_host
             result.Fail(cause=cause)
             return

Unfortunately, this breaks QMTest in such as way that the tests execute 
perfectly from the command-line, but the GUI hangs in the "All tests 
have not yet been run.  These  results will be updated every few 
seconds." state.

If I remove the os.system call, all is fine.

I'm a total newbie to zope-dhtml, so I'd rather not go there if I don't 
have to. Is there some basic assumption in Zope or in QMTest which 
prevents one from using os.system() calls in the guts of the html 
server?

Regards,
-Steve
--------
Steve Byan <smb at egenera.com>
Software Architect
Egenera, Inc.
165 Forest Street
Marlboro, MA 01752
(508) 858-3125




More information about the qmtest mailing list