# TSTinv.def: Tests Oracle Home Inventory Content # $Id: TSTinv.def,v 2.5 2012/01/03 13:34:48 mschenke Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_4/src/scripting/lib/modules/TSTinv.def,v 2.5 2012/01/03 13:34:48 mschenke Exp $ # # Change History # 20120103 MSC Change the copyright notice. =head1 NAME TSTinv - Tests Oracle Home Inventory Content =head1 DESCRIPTION =cut echo tput('bold'),'Processing inventory test module ...',tput('off') =pod This test module extracts the components from the Oracle home inventory. The names, versions, and installation locations are listed. =cut macro get_inventory {var ($fil) = @arg if testFile('fr',$fil) {var $inv = xmlLoadFile($fil) loop $xml (xmlFind($inv,'PRD_LIST/COMP_LIST/COMP')) {var $nam = xmlValue($xml,'NAME') var $loc{$nam} = xmlValue($xml,'INST_LOC') var $ver{$nam} = xmlValue($xml,'VER') } loop $xml (xmlFind($inv,'PRD_LIST/COMP_LIST/PATCH')) {var $nam = xmlValue($xml,'NAME') var $loc{$nam} = xmlValue($xml,'INST_LOC') var $ver{$nam} = xmlValue($xml,'VER') } echo "|*Name*|*Version*|*Location*|" loop $nam (keys(%loc)) echo "|",$nam,"|",$ver{$nam},"|",$loc{$nam},"|" } else echo "The inventory file is not available" } if getSetting('TST_ARGS') call get_inventory(last) elsif getSetting('ORACLE_HOME') call get_inventory(catFile(last,'inventory','ContentsXML','comps.xml')) elsif getEnv('ORACLE_HOME') call get_inventory(catFile(last,'inventory','ContentsXML','comps.xml')) else echo "ORACLE_HOME is not defined" =head1 COPYRIGHT NOTICE Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. =head1 TRADEMARK NOTICE Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. =cut