Mailing list - Entries of 2006

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [qftestJUI] Question - Ref. QftestJUI 1.08.5 / parsing the standard output of a shell command.

  • Subject: Re: [qftestJUI] Question - Ref. QftestJUI 1.08.5 / parsing the standard output of a shell command.
  • From: Gregor Schmid <Gregor.Schmid@?.de>
  • Date: 20 Apr 2006 21:41:05 +0200

Hi Adrian,

use a "Shell command" node to run the swlist command. Set the "Client"
attribute to "swlist" for example. Follow this with a "Wait for
process to terminate" node for client "swlist".

Now you can get the output in a Server script using

rc.lookup("qftestJUI", "client.output.swlist")

Please see manaual chapter 10 "Variables" for details.

Best regards,

"Adrian Chamberlain" <Adrian.Chamberlain@?.com> writes:

> Ref. QftestJUI 1.08.5 / parsing the standard output of a shell command.
> Hi,
> In my test suite I log information about the test environment i.e. home
> directory of the application, the size of the applications relational
> database, JRE/JVM version details, heap usage and lots more...
> I wish to log details of what patches (relating to the application under
> test) are installed.  I may even go the the extent of making the test suite
> check that the correct patches (i.e. P012, P013) are installed - i.e. the
> Setup node would halt and warn the test engineer that they need to install
> the latest SUT application patches.
> The SUT is running on HP-UX and consequently one would normally utilise the
> 'swlist' command (with appropriate parameters) to list the current software
> packages/patches installed on the system.
> As a result I would like to be able to execute the 'swlist' command and use
> the search/match regular expression handling functions on the standard
> output in order to determine (i.e. build up a list/tuple) of what patches
> are installed (obviously the standard 'Execute shell command' node in qfs
> does not provide a way to get at the std o/p of the command executed).
> One way of course would be to re-direct the std output of the command to a
> file and parse the file.  I would rather avoid this if it is at all
> possible !!
> Having looked through the Python library reference I tried the following:
> import os
> from commands import getoutput
> getoutput("swlist")
> ...... etc.
> But this results in the following exception,
> AttributeError:class 'org.python.modules.os' has no attribute 'popen'
> Any advice/suggestions would be much appreciated.
> Thank you in anticipation of your help
> Kind Regards
> Adrian

Gregor Schmid                                Gregor.Schmid@?.de
Quality First Software GmbH           
Tulpenstr. 41                                Tel: +49 8171 919870
DE-82538 Geretsried                          Fax: +49 8171 919876

Videos Downloads Documentation Buy Free Trial