Skip to content
This repository has been archived by the owner on Oct 1, 2021. It is now read-only.

OpenNMS-Archives/minion-system-tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minion System Tests

End-to-end tests for Minion/OpenNMS that leverage Docker for managing services.

1. Preface

These tests we’re built to automate the validation of application-layer functionality in Minion/OpenNMS, also referred to herein as the Minion System.

The framework provides the ability to instantiate a Minion System on the local, or a remote host using a collection of linked Docker containers. Once instantiated, references to the various hosts and ports for all of the services (i.e. OpenNMS HTTP, Minion Karaf Shell) are available, and control is passed to the test suite.

2. Setup

2.1. Requirements

  • Docker v1.10.x (tested with 1.10.3, build 20f81dd)

  • Maven v3.3.x (tested with 3.3.3)

  • Java 8 (tested with Oracle JDK 1.8.0_45-b14)

2.2. Setup the Docker daemon

We use the Spotify Docker Client to communicate with the Docker daemon.

The location of the Docker daemon can be controlled with the DOCKER_HOST environment variable. If the Docker daemon is running on the localhost, no extra configuration should be required.

2.3. Build the OpenNMS RPMs

The Docker images depend on the .rpms generated by the build.

After obtaining the sources, run the following to build the RPMs:

Note
You currently need to checkout the develop branch.
./makerpm.sh
export OPENNMS_BUILD=$(pwd)

2.4. Build the Docker images

Build the Docker images with:

pushd docker
./copy-rpms.sh
./build-docker-images.sh
popd
Note
The OPENNMS_BUILD environment variable is used by the copy-rpms.sh script to find the .rpms.
Note
You can also use the OPENNMS_RPM_ROOT environment variable to point to the directory containing RPMs for the copy-rpms.sh script.

3. Running the tests

Once the Docker images are built, you can invoke the test suite with:

mvn test

4. Developing tests

When developing tests you can disable the automatic tear down of the containers after the test using:

@ClassRule
public static MinionSystem minionSystem = MinionSystem.builder().skipTearDown(true).build();

You can also run the tests against an existing environment using:

@ClassRule
public static MinionSystem minionSystem = MinionSystem.builder().useExisting(true).build();

If you want to destroy an existing environment you can kill and remove ALL of your containers using:

docker kill $(docker ps -q)
docker rm $(docker ps -a -q)

About

End-to-end tests for Minion

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published