Preface

This document describes the functionality provided by the Test plugin.

See the Deployit Reference Manual for background information on Deployit and deployment concepts.

Overview

The tests-plugin is a Deployit plugin that supports execution of post-deployment application tests. These post deployment tests may includes tests such as testing whether the deployed application is accessible or whether the created datasource is functioning properly or not. The tests-plugin is intended to provide such functionality to the Deployit server.

Features

Requirements

Usage in Deployment Packages

The plugin works with the standard deployment package of DAR format. Please see the Packaging Manual for more details about the DAR format and the ways to compose one.

The following is a MANIFEST.MF file snippet that shows how a tester can be included in the deployment package which can be used to run a sanity check to verify that the petclinic application is accessible after the deployment


Manifest-Version: 1.0
Deployit-Package-Format-Version: 1.3
CI-Application: PetClinic-ear
CI-Version: 2.0

Name: PetClinic-2.0.ear
CI-Type: jee.Ear
CI-Name: PetClinic

Name: PetclinicTest
CI-Type: test.HttpRequestTest
CI-url: http://jboss-51:8080/petclinic
CI-expectedResponseText: Display all veterinarians
CI-startDelay: 10
CI-noOfRetries: 5
CI-retryWaitInterval: 3

Using the deployables and deployeds

The following table describes which deployable/container combinations are possible.

Deployable vs. Container table

Deployable Container Generated deployed
test.HttpRequestTest tests.TestStation test.HttpRequestTester

The following table describes the effect a deployed has on it's container

Deployed Actions Table

Deployed Actions performed for operations
  Create Destroy Modify
test.HttpRequestTester
  • invoke the application URL to check if application is running
  • no action
    • invoke the application URL to check if application is running

Test Station

A test station is a generic.Container type on which a particular test is run. For the httpRequestTest, the type of Host used for creating the test station determines which version of the test should be run. There are two kind of tests possible for http request test.

Using a HttpRequestTester

Let's say if petclinic application is deployed on the server production-host, and the http request test has to be tested from host test-host (that has access to the petclinic application), then the following steps can be followed to add this application testing feature as part of the standard deployment:

CI Reference

Configuration Item Overview

Deployable Configuration Items

CIDescription
tests.HttpRequestTestThe http request test that has to be performed

Deployed Configuration Items

CIDescription
tests.HttpRequestTesterThe http request tester

Topology Configuration Items

CIDescription
tests.TestStationContainer from where the http request test is to be performed

Virtual Deployed Configuration Items

CIDescription
tests.BaseHttpRequestTesterBase class for the http request testers

Configuration Item Details

tests.BaseHttpRequestTester

Hierarchygeneric.ExecutedScript >> generic.AbstractDeployed >> udm.BaseDeployed >> udm.BaseConfigurationItem
Interfacesudm.Deployed, udm.ConfigurationItem

Base class for the http request testers

Public Properties
container* : CI<udm.Container>

The container on which this deployed runs.

expectedResponseText* : STRING

Text that is expected to be contained in the HTTP response body, if the response code is in the 200 range. A non-2xx response code will cause the test to fail irrespective of the response body

url* : STRING

The URL to test

deployable : CI<udm.Deployable>

The deployable that this deployed is derived from.

showPageInConsole : BOOLEAN

Show the page retrieved from the url

Hidden Properties
createOrder* : INTEGER = 50

The order of the step in the step list for the create operation.

createScript* : STRING

Classpath to the script that is uploaded and executed on the generic container for the create operation.

createVerb* : STRING = Create

Create Verb

destroyOrder* : INTEGER = 40

The order of the step in the step list for the destroy operation.

destroyVerb* : STRING = Destroy

Destroy Verb

modifyOrder* : INTEGER = 50

The order of the step in the step list for the modify operation.

modifyVerb* : STRING = Modify

Modify Verb

noopOrder* : INTEGER = 50

The order of the step in the step list for the noop operation.

noopVerb* : STRING = Modify

Noop Verb

destroyScript : STRING

Classpath to the script that is uploaded and executed on the generic container for the destroy operation.

modifyScript : STRING

Classpath to the script that is uploaded and executed on the generic container for the modify operation.

noOfRetries : INTEGER

Number of times to attempt executing the step, incase it fails

noopScript : STRING

Classpath to the script that is uploaded and executed on the generic container for the noop operation.

restartRequired : BOOLEAN = false

The generic container requires a restart for the action performed by this deployed.

restartRequiredForNoop : BOOLEAN = false

The generic container requires a restart for the NOOP action performed by this deployed.

retryWaitInterval : INTEGER

Time in seconds to wait before next retry

startDelay : INTEGER

Time in seconds to wait before starting the execution of step


tests.HttpRequestTest

Hierarchygeneric.Resource >> udm.BaseDeployable >> udm.BaseConfigurationItem
Interfacesudm.Deployable, udm.ConfigurationItem

The http request test that has to be performed

Public Properties
expectedResponseText : STRING

Text that is expected to be contained in the HTTP response body, if the response code is in the 200 range. A non-2xx response code will cause the test to fail irrespective of the response body

ignoreCertificateWarnings : STRING

If set, certificate warnings when making a connection will be ignored

noOfRetries : STRING

Number of times to attempt executing the step, incase it fails

retryWaitInterval : STRING

Time in seconds to wait before next retry

showPageInConsole : STRING

Show the page retrieved from the url

startDelay : STRING

Time in seconds to wait before starting the execution of step

url : STRING

The URL to test


tests.HttpRequestTester

Hierarchytests.BaseHttpRequestTester >> generic.ExecutedScript >> generic.AbstractDeployed >> udm.BaseDeployed >> udm.BaseConfigurationItem
Interfacesudm.Deployed, udm.ConfigurationItem

The http request tester

Public Properties
container* : CI<udm.Container>

The container on which this deployed runs.

expectedResponseText* : STRING

Text that is expected to be contained in the HTTP response body, if the response code is in the 200 range. A non-2xx response code will cause the test to fail irrespective of the response body

noOfRetries* : INTEGER = 5

Number of times to attempt executing the step, incase it fails

retryWaitInterval* : INTEGER = 5

Time in seconds to wait before next retry

startDelay* : INTEGER = 5

Time in seconds to wait before starting the execution of step

url* : STRING

The URL to test

deployable : CI<udm.Deployable>

The deployable that this deployed is derived from.

ignoreCertificateWarnings : BOOLEAN

If set, certificate warnings when making a connection will be ignored

showPageInConsole : BOOLEAN = false

Show the page retrieved from the url

Hidden Properties
createOrder* : INTEGER = 100

Create Order

createScript* : STRING = tests/execute-http-request

Create Script

createVerb* : STRING = Run test

Create Verb

destroyOrder* : INTEGER = 40

The order of the step in the step list for the destroy operation.

destroyScript* : STRING = DUMMY_VALUE

Destroy Script

destroyVerb* : STRING = Destroy

Destroy Verb

modifyOrder* : INTEGER = 50

The order of the step in the step list for the modify operation.

modifyVerb* : STRING = Modify

Modify Verb

noopOrder* : INTEGER = 50

The order of the step in the step list for the noop operation.

noopVerb* : STRING = Modify

Noop Verb

modifyScript : STRING

Classpath to the script that is uploaded and executed on the generic container for the modify operation.

noopScript : STRING

Classpath to the script that is uploaded and executed on the generic container for the noop operation.

restartRequired : BOOLEAN = false

The generic container requires a restart for the action performed by this deployed.

restartRequiredForNoop : BOOLEAN = false

The generic container requires a restart for the NOOP action performed by this deployed.


tests.TestStation

Hierarchygeneric.Container >> udm.BaseContainer >> udm.BaseConfigurationItem
Interfacesudm.ConfigurationItem, udm.Container

Container from where the http request test is to be performed

Public Properties
host* : CI<overthere.Host>

Host upon which the container resides

Hidden Properties
restartOrder* : INTEGER = 90

The order of the restart container step in the step list.

restartWaitTime* : INTEGER = 0

The time to wait in seconds for a container restart action.

startOrder* : INTEGER = 90

The order of the start container step in the step list.

startWaitTime* : INTEGER = 0

The time to wait in seconds for a container start action.

stopOrder* : INTEGER = 10

The order of the stop container step in the step list.

stopWaitTime* : INTEGER = 0

The time to wait in seconds for a container stop action.

restartScript : STRING

Classpath to the script used to restart the generic container.

startScript : STRING

Classpath to the script used to start the generic container.

stopScript : STRING

Classpath to the script used to stop the generic container.