[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qftestJUI] Question - Ref. QftestJUI 1.08.5 / parsing the standard output of a shell command.
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