Installer Dev Tests Automation framework

Author: Sathyan Catari(Sathyan.Catari@oracle.com)

Date: 11/22/2010.

1. Introduction

This document details the testing infrastructure created for 3.1 GlassFish installer using Abbott tools. The intention of this document is not to introduce the GlassFish installer, Junit and automated test infrastructure, abbott. The reader is assumed to have a good understanding of GlassFish 3.1 installer and knowledge of Junit and abbott are required to develop test cases.

2. Purpose/Objective of this framework

Automate the process of installing GlassFish 3.1 installation programs(covering all bundles) in Graphical user interface mode by capturing the user input as abbott scripts and later running them.

3. Out of scope

Using the procedure explained in this doc, one should be able to run the installers in various scenarios(covering different use-cases) without any intervention. This procedure replaces existing install procedure in the overall test suite. It does not substitute the pre-install test related environment setup and post-install validations.

4. How do I run these tests?

Follow these steps

4.1. cvs :pserver:<userid>@jescvs.sfbay.sun.com:/m/jws get appserver-sqe/pe/installer/gui

4.2. Update appserver-sqe/pe/installer/gui/glassfish.properties. Refer to the table below for details on the properties stored in this file.

glassfish.properties

Property Name Value Comments
installprogram.location
Path where the GlassFish 3.1 installer executable(.exe|.sh) is available This installer will be used by the framework during runtime.
installprogram.name Name of the .exe | .sh file.(Do not include path)
install.dir Path to GlassFish 3.x installer. Should be an empty directory to perform a fresh installation or a valid GlassFish install directory to be used for "Configure Existing installation" mode.
domain.name Name of the domain Domain to be created or an existing one in case of scenarios that create a stand-alone or a clustered instance to an existing domain.
cluster.name Name of the cluster Domain to be created or an existing one in case of scenarios that create a clustered instance.
admin.password Password Can be left blank for anonymous logins when "admin" is used as "admin.user".
admin.port Valid Port in the range(1-65535) Do not use reserved port 6666 to be used by OSGI container. Do not duplicate port values of http.port.
http.port Valid Port in the range(1-65535) Do not use reserved port 6666 to be used by OSGI container. Do not duplicate port values of admin.port.
instance.name Name of the instance. Instance name to be created(standalone or clustered)
host.name Fully qualified hostname or "localhost" Name of the DAS host.
admin.user
Administration username. Use "admin" and leave password empty for anonymous logins.

4.3. Use the appropriate test script available under appserver-sqe/pe/installer/gui/src/test/xml. Refer to the table below for the scenarios supported by the currently checked in scripts.

NOTE: These scripts read GlassFish specific properties from appserver-sqe/pe/installer/gui/glassfish.properties.

Available Testing scenarios.

Script Name Scenario
Configure_Existing_domain.xml Create a Domain using "Configure existing installation" mode.
Configure_Existing_skipconfiguration.xml Skip configuration after validating existing install directory in "Configure existing installation" mode.
Configure_Existing_standaloneinstance.xml Create a stand-alone instance in "Configure existing installation" mode.
Install_Config_domain.xml Perform a fresh installation on the given directory and create a domain.
Install_Config_skipconfiguration.xml Perform a fresh installation in "Install and Config" mode and skip configuation.
Install_Config_standaloneinstance.xml Perform a fresh installation in "Install and Config" mode and skip create a stand-alone instance.
Install_Only.xml Perform a fresh installation in "Install Only" mode. No configuration happens in this mode.
Configure_Existing_clusteredinstance.xml Create a clustered instance in "Configure existing installation" mode.
Typical_Install.xml Perform a typical install that always creates a domain.

4.4. Run test here refers to running a single scenario from the table above. Running for each scenario involves three steps.

Step 1). Make sure that you update appserver-sqe/pe/installer/gui/glassfish.properties with appropriate values

Step 2). setup the pre-installed environment for the tests to run by running the following command from "appserver-sqe/pe/installer/gui" directory

ant -Dtmpdir=<Provide any writable directory as a temporary directory> -Dtest.script=<Pick a script that matches your scenario from the table above> setuptest

Ex: ant -Dtmpdir=/tmp -Dtest.script=Typical_Install.xml setuptest

Step 3). Run the actual test scenario by running the following command from "appserver-sqe/pe/installer/gui" directory

ant -Dtmpdir=<Provide any writable directory as a temporary directory> -Dtest.script=<Pick a script that matches your scenario from the table above> runtest

Ex: ant -Dtmpdir=/tmp -Dtest.script=Typical_Install.xml runtest

5. Filelayout of Testing infrastructure

The source code is rooted under CVS as :pserver:<userid>@jescvs.sfbay.sun.com:/m/jws appserver-sqe/pe/installer/gui

5.1 Files/Directories of significance

appserver-sqe/pe/installer/gui/build.xml(Top level build.xml that contains various build/test related ant targets)

appserver-sqe/pe/installer/gui/build/glassfish.properties (Properties file that contains both environment and GlassFish related properties to be set by user as a pre-run step)

appserver-sqe/pe/installer/gui/openinstaller.properties(Generated by the build scripts, overwritten for every use, internal use only, not to be edited by users)

appserver-sqe/pe/installer/gui/src/java/com/oracle/glassfish/installer/test(Test framework entry point)

appserver-sqe/pe/installer/gui/src/test/xml(Location where abbott test scripts, *.xml are searched for by framework)

appserver-sqe/pe/installer/gui/lib(Libraries used by the framework including abbott specific ones)

appserver-sqe/pe/installer/gui/build(Output of Java compilation)

appserver-sqe/pe/installer/gui/util(Framework utilities)

appserver-sqe/pe/installer/gui/results(Results of the run are recorded here, to be extended to have meaningful results in future releases of GlassFish)

6. References

Abbott Test framework: http://abbot.sourceforge.net/doc/overview.shtml