280 likes | 449 Views
Prerequisite Scanner Team Sprint Demo. Prerequisite Scanner Sprint 12 Demo. IBM Prerequisite Scanner Team December 12, 2012. Key Accomplishments. PRS 1.2.0.2 Release published to FixCentral(34095) Windows 2012 support enhancement (30218, 34043)
E N D
Prerequisite Scanner Team Sprint Demo Prerequisite Scanner Sprint 12 Demo IBM Prerequisite Scanner Team December 12, 2012
Key Accomplishments • PRS 1.2.0.2 Release published to FixCentral(34095) • Windows 2012 support enhancement (30218, 34043) • As PRS adopter, I would like PRS to support number of logical processor check (34094) • As PRS tester, we want to implement test automation for remote execution to achieve 50% test regression coverage (34047) • Story: Delivery PRS driver to JazzSM in support of sprint 19, 20 and milestone 8 (33982) • PRS GO training preparation (33989) Demo Demo Demo
Demo 1 Windows Server 2012 support enhancement (30218, 34043)
Demo 1 – what’s changed and enhanced • Removed .NET Framework 3.5 prerequisite for Windows Server 2012 • Removed .NET Framework 1.0 + prerequisite for Windows • Windows Server 2012 as supported value for OSType section data category For example: [OSType:Windows Server 2012] os.versionNumber=6.2+ .NET Framework is NOT a PRS windows prerequisite anymore!
Demo 2 As PRS adopter, I would like PRS to support number of logical processor check (34094)
Demo 2 – requirement and overview • Requester JazzSM, OMEGAMON • Request Description • PRS’ existingnumCPU property checks on the number of physical processors available to the operating system. • JazzSM and OMEGAMON team have requested PRS to provide a new capability to check for number of logical processors, to support their installation prerequisite scenario. • Property Name: numLogicalCPU • Supported Value: positive integer For example: numLogicalCPU=2
Demo 2 – Windows overview • Implementation Calculated by add up number of logical processors per physical processor, reported by win32_processor class • Requirements for Windows XP, Windows 2003 and limitation for Windows 2000 ** As a known Windows limitation, WMI class win32_processor does not support attribute NumberOfLogicalProcessors. • Windows XP • Required hotfix: http://support.microsoft.com/kb/936235 • Required SP level: SP3 + (which includes the hotfix) • Windows 2003 • Required hotfix: http://support.microsoft.com/kb/932370 • Windows 2000 NOT supported Microsoft ended Windows 2000 support at July 13, 2010 Tips – how to check for hotfix Use this command to get all hotfix installed on the system: wmic qfe list
Demo 2 – UNIX overview • Implementation UNIX collector executes the following commands to get the set of Logical processors available in different flavors of UNIX. RHEL and SUSE platforms : cat /proc/cpuinfo AIX platform : bindprocessor -q HP-UX platform : machinfo SunOS platform : uname -X
Demo 2 – UNIX Error message Precheck.log file
Demo 3 As PRS tester, we want to implement test automation for remote execution to achieve 50% test regression coverage (34047)
Demo 3 – Benefits of Test Automation • Regression Testing can be close to fully automated • previously would run regression tests manually on every platform • less error prone • Increased test and platform coverage • would previously run a subset of the product cfg files and test cases on a subset of platforms • can now run the full set of ootb product cfg files and additional test cases • Reduce the amount of time spent on regression testing by at least 50% • with every sprint and new added function we observed the amount of time required for regression increase • previously spending average of 3 days on manual regression testing per release, now I can kick off regression tests to run overnight and review logs the next day • benefits apply to regression testing performed not just per release but on every sprint • We can react more quickly to changing customer deliverables and unscheduled requests
Demo 3 – Test automation framework based on: Ant : • generate the test build • invoke the Java classes which run STAF commands • invoke Junit tests • copy reports and result logs to report server STAF: • run tests on remote target machines • collect logs Java/Junit: • run STAF commands • perform verification of actual test results
Demo 3 – Test project in RTC – directory structure: Project Name: com.ibm.prc.test
Demo 3 – Running Test builds and tests ... • Test builds are kicked off from RTC similar to dev builds • Dedicated test build machine: aclinux6223Z • Jazz build engine running on the test build machine waiting for build requests • Build engine and Test build definitions are defined in RTC • Test project can be loaded and should be viewable by anyone who has access to the Prerequisite Scanner Team in RTC
Demo 3 – Running Test builds and tests ... Running a test build is as simple as selecting: Prerequisite Scanner Test Team Build → Request Build Tests are automatically run once the test build has completed...
Demo 3 – Developing the framework ... Multi-stage approach: • Stage 1: develop the basic Ant scripts and manually run tests using Ant on each of the test machines, limited to a few basic tests on Linux and Windows • Stage 2: allocate and configure the Jazz build engine and RTC build definitions, update the Ant scripts to run tests locally on the build machine, added a few additional tests • Stage 3: include STAF into the framework and provide the ability to run on several remote targets, include tests for all out-of-the-box/latest product cfg files, updates to CVT cfg files as well as new section support tests.
Demo 3 – STAF – a bit of background info ... • Software Testing Automation Framework • “Peer-to-peer pluggable framework geared toward test automation” • “Open source automation framework designed around the idea of reusable components, called services” • Easy to install and configure • Supports many different platforms • All services are available from the command line • Supports many languages, provides flexibility: • Java, C/C++ • Perl, Python, Rexx, Shell scripts • Ant • Command line
Demo 3 – STAF services we mostly make use of these three services
Demo 3 – Common tasks performed by STAF commands • Create a unique work directory on the remote target • Copy the PRS build image to the remote target machine • Set file permissions if required • Untar/Unzip the PRS build image • If tests will be run as non-root then change file ownership to the non-root user • Run PRS scripts on the remote target • Collect the result files and logs • Delete the unique work directory on the remote target
Demo 3 – Submitting STAF requests through Java • Submitting STAF requests via Java requires a STAF handle object. The STAF handle allows you to register with STAF, submit requests, and then unregister. • STAFHandle handle = new STAFHandle("RunCVTTest"); • Once a STAF handle is acquired it's used to submit requests to STAF • STAFResult result = handle.submit2(machine, service, request); • Here is an example of a method call which submits a STAF request to a remote target to run PRS – the submitSTAFRequest method is my own internal method that invokes the STAF submit2 method: • String prsCVTCommand = "prereq_checker.bat CVT detail xmlResult"; • String prsCVTSTAFRequest = "START SHELL COMMAND " + STAFUtil.wrapData(prsCVTCommand) + " USERNAME " + userid + " PASSWORD " + password + " WORKDIR " + workDir + " WAIT STDERRTOSTDOUT RETURNSTDOUT"; • submitSTAFRequest(handle, machine, "PROCESS", prsCVTSTAFRequest);
Completed sprint 12 stories • Story: PRS 1.2.0.2 external publish (34095) • Story: as PRS test, we want to implement test automation for remote execution to achieve 50% test regression coverage (34047) • Feature request: Windows - section OSType support should include check for Windows 2012 (34043) • Story: Delivery PRS driver to JazzSM in support of sprint 19 and milestone 8 and sprint 20 (33982) • Story: Add Windows 2012 into test suite when GAs and regression PRS on Win 2012 in September 2012 (30218) • Feature request: As PRS adopter, I would like PRS to support number of logical processor check (34094)Story: as support team, I would like PRS to finish GO training preparation and send the material for review (33989) • Feature request: PRS needs to support Firefox 10 Extended Service Release (ESR) support (27978)
What is PRS A lightweight and easy-to-usescanning tool to automate prerequisite checks for single or multiple products in a solution • Automated and standardized prerequisite checking solution across products and deployment types • Simplicity of use and lightweight solution • Improve TTV, with ready-to-use out-of-the-box predefined checks • Extensibility to expand coverage easily in the field IBM Prerequisite Scanner Key Benefits & Differentiator
Demo 3 – Sample STAF Commands to Linux target • Create a work directory on the remote target: aclinux14 • staf aclinux14 FS CREATE DIRECTORY /tmp/prctest/root/20121123-0933 FULLPATH • Copy the PRS image to the remote target machine: aclinux14 • staf LOCAL FS COPY FILE /prcbuild/fetched/com.ibm.prc.test/dev/build/latest/image/unixlinux/precheck_unix_20121123.tar TODIRECTORY /tmp/prctest/root/20121123-0933 TOMACHINE aclinux14 • Set file permissions on the PRS image tar file on the remote machine • staf aclinux14 PROCESS START SHELL COMMAND "chmod 755 /tmp/prctest/root/20121123-0933/precheck_unix_20121123.tar" WAIT STDERRTOSTDOUT RETURNSTDOUT • Uncompress the PRS image on the remote target machine: • staf aclinux14 PROCESS START SHELL COMMAND "tar -xvf precheck_unix_20121123.tar" WORKDIR /tmp/prctest/root/20121123-0933 WAIT STDERRTOSTDOUT RETURNSTDOUT • If tests will be run as non-root then change file ownership to the non-root user • staf aclinux14 PROCESS START SHELL COMMAND "chown -R prsadmin:users /tmp/prctest/prsadmin" WAIT STDERRTOSTDOUT RETURNSTDOUT • Run Prerequisite Scanner script on the remote target: • staf aclinux14 PROCESS START SHELL COMMAND "./prereq_checker.sh DMO detail xmlResult" USERNAME prsadmin WORKDIR /tmp/prctest/prsadmin/20121123-0933 WAIT STDERRTOSTDOUT RETURNSTDOUT
Demo 3 – Sample STAF Commands to Windows target • Create a work directory on the remote target: acwinx226a • staf acwinx226a FS CREATE DIRECTORY {STAF/Env/SystemDrive}/prctest/prsadmin/20121123-0933 FULLPATH • Copy the PRS image to the remote target machine: aclinux14 • staf LOCAL FS COPY FILE /prcbuild/fetched/com.ibm.prc.test/dev/build/latest/image/windows/precheck_windows_20121123.zip TODIRECTORY {STAF/Env/SystemDrive}/prctest/prsadmin/20121123-0933 TOMACHINE acwinx226a • Unzip the PRS image on the remote target: • staf acwinx226a ZIP UNZIP ZIPFILE {STAF/Env/SystemDrive}/prctest/prsadmin/20121123-0933/precheck_windows_20121123.zip TODIRECTORY {STAF/Env/SystemDrive}/prctest/prsadmin/20121123-0933 • Copy a .bat script to the remote target: • staf LOCAL FS COPY FILE /prcbuild/fetched/com.ibm.prc.test/tools/run_prereq_checker.bat TODIRECTORY {STAF/Env/SystemDrive}/prctest/prsadmin/20121123-0933 TOMACHINE acwinx226a TEXT FORMAT Native • Run the .bat script on the remote target as user prsadmin: • staf acwinx226a PROCESS START SHELL COMMAND "run_prereq_checker.bat 20121123-0933" USERNAME prsadmin PASSWORD passw0rd WORKDIR {STAF/Env/SystemDrive}/prctest/prsadmin/20121123-0933 WAIT STDERRTOSTDOUT RETURNSTDOUT