Bug 851640 - Create integration tests for inventory sync
Create integration tests for inventory sync
Status: NEW
Product: RHQ Project
Classification: Other
Component: Agent, Communications Subsystem, Core Server, Plugin Container (Show other bugs)
Unspecified Unspecified
unspecified Severity medium (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
Mike Foley
Depends On:
Blocks: 851634
  Show dependency treegraph
Reported: 2012-08-24 10:42 EDT by John Sanda
Modified: 2012-08-24 10:42 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description John Sanda 2012-08-24 10:42:11 EDT
Description of problem:
These tests will involve three components - a running server, a running agent, and a test driver. Assume that each runs in its own separate process. The test driver will have two main responsibilities. It will coordinate work flows like starting server and agent, and it will perform verification. Let me illustrate with an example.

Test Scenario: 
Resource exist in server inventory with drift definitions. Agent is started with the --purgedata option.

Test Driver:
* Start RHQ server
* When server is initialized, start agent with --purgedata
* Wait for for agent to initialize and complete inventory sync
* Verify that resource along with drift definitions exist in agent's inventory

There are some subtle details I left out here like how the test will know when the server has initialized or how it will know when the inventory sync has finished. Getting this infrastructure set up will require a good deal of work; however, it provides us with broad test coverage not possible with unit tests. This could also lay the foundation for other integration tests for things like provisioning.

In order for the test driver to orchestrate work flows, we will likely have to do some refactoring to provide test hooks. First, consider the simpler case where everything is in-process and we need to know when the RHQ server is initialized. At the end of StartupServlet.init method, we might want to fire off some sort of event to indicate that server initialization has completed. The test driver would simply listen for that event. Since the test driver will be running in its own separate process, that event listener (i.e., test hook) will need to forward that event to the test driver, possibly via REST or some form of RPC. We will need take a similar approach on the agent.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
Actual results:

Expected results:

Additional info:

Note You need to log in before you can comment on or make changes to this bug.