Skip to main content

4. Project Configuration

Creating a Project is the final step of the test configuration. The purpose of a project is to define the target(s) to be tested, what transport mechanism to use to deliver the test cases, and, optionally, how to monitor the target for unexpected/unintended behaviour. Additionally, the Project allows configuring specific run-time options to fine-tune test execution.

Let's start by configuring the basic Project settings. Click the Create button on the Test Assets page and select the New Project option.

General Configuration

The Project configuration is organized under multiple tabs. The first tab, the General tab, allows setting up the essentials. Follow the steps below to set up the basics of your Project.

  1. There are currently two Project Types: Custom and Web Service. In this case, we need the default: Custom, so make sure that is the one selected for the Project Type.
  2. Select the Test Flow Template you have created earlier from the Test Flow dropdown menu. Once selected, additional fields will appear.
  3. Enter the name of your Project using the Project Name text field.
  4. (Optional) Provide a description for the Project using the Description text field.
  5. Select an Engine from the Select Engine dropdown menu. Make sure to select the Engine you have deployed earlier.
  6. Finally, select the Driver to be used to interact with the test target. For this tutorial, you will need the one called Network / TCP, because our target will be accessible on a TCP port (1883).

Once you are done you should have a basic configuration similar to what is shown in the picture below.

General Settings

It is now time to set up the test target related configuration on the Test Targets tab.

Test Target Setup

You can register one or more test targets by clicking on the Add New Target button. In the pop-up window, name your target using the Test Target Name text field and click the Add button.

New Target Name

The target configuration options become visible once the target is registered. You will be presented with two configuration sections; these are Connection Settings and Target Monitoring. You can expand these sections by clicking on their Expand button.

Let's continue with setting up the connections settings.

Connection Settings

The configuration options presented under the Connection Settings section depend on the Driver selected. With our current Driver, we have three options configurable. Let's set these up.

  1. The TCP driver can operate both in client and server mode. In client mode, it initiates a connection to the target. In server mode, it binds to a specific port to listen on. In this scenario, GUARDARA will act as a client (we are testing a server). Therefore, make sure the Driver Mode is set to client.
  2. When the Driver is in client mode, we have to provide the IP address or hostname of the target service. Provide the IP address of the system you have deployed the Docker container during the Environment Setup phase of this tutorial.
  3. Finally, provide the port number the target service will be listening on. In this case, it is 1883, the default port.

You may have noticed when you started the Docker container that instead of the MQTT broker, it was the GDB server started and listening on port 19999. The MQTT message broker is not yet running. As you will see, when configuring the target monitoring, we will tell GUARDARA to instruct the GDB server to start up our target automatically at the beginning of the test run.

Having performed the above configuration you should see something similar to what is shown in the picture below.

Connection Settings

Target Monitoring

Monitors are GUARDARA extensions that allow monitoring the state of the target(s) under test to detect anomalous behaviour in ways not possible with previously discussed methods.

As mentioned earlier, in this tutorial, we will use a single Monitor to detect issues related to the target. More specifically, we will use the GDB Monitor extension.

tip

Once you have completed this tutorial, you may want to alter the test configuration to solely use connection-based detection without any monitors configured to see how that changes things.

Before continuing with the next steps, make sure to download the Monitor extension by clicking on the link above.

Installing the Monitor

While still on the Target configuration screen:

  1. Expand the Target Monitoring section
  2. Click on the Add More button
  3. Open the Select Monitor dropdown menu

The dropdown menu will be empty if you haven't installed any Monitor extensions earlier. To continue, we have to install the Monitor extension first.

Make sure to save your project by clicking the Save button at the bottom of the screen, as we will leave the Project configuration page to install the extension. Follow the instructions below to deploy the extension.

  1. Go to the Settings page and activate the Inventory tab.
  2. Click on the Add button (+ sign)
  3. In the file selector, locate and open the Monitor extension downloaded previously

Once the extension is uploaded, the Engine you have deployed will automatically start installing it. The process may take a few seconds.

Extension Deployed

If you are interested, you can check the extension deployment process on the Engines tab of the Settings page:

  1. Select the Engine you registered earlier. Its status should be Active. If it is not active, start your Engine.
  2. Click on the View Details button in the list of actions on top of the list of Engines.

If your extension is still being installed, the State will show up as Updating. The Engine's Event Log will also tell you about the current status. The picture below shows what a successful extension installation looks like.

Engine Updating

If you scroll a bit further down and open the Monitors panel of the Modules section, you should see the GDB extension listed there.

From this point on, the GDB Monitor will be available to use with any Projects.

Setting up the Monitor

Let's head back to the Test Assets page to continue configuring our Project. Click on the Edit (pencil) button to open the Project configuration. Once the Project is open:

  1. Go straight to the Test Targets tab to finish setting up the target configuration.
  2. Using the dropdown menu on the top-right corner of the screen, select your previously created target.
  3. Expand the Target Monitoring section.
  4. Click the Add More button.
  5. Open the Select Monitor dropdown menu.

As you can see, the GDB extension we deployed a minute ago is now available in the list. Select the GDB monitor in the list to start configuring it.

Monitor Configuration

The GDB monitor comes with some default values that you may have to update depending on your environment:

  1. Update the GDB Server Address field to point to the IP address the Docker container was started on. If this happens to be your local host where the Engine is running, you can leave the field's value as it is.
  2. The GDB server in our Docker container listens on port 19999. Update the GDB Server Port field to have this value.
  3. Enter /demo/nanomq in the Executable field. This is the location of the MQTT message broker executable inside the Docker container.
  4. Enter broker start -conf /etc/nanomq.conf in the Arguments field. These are the command-line options of the nanomq executable required to start the message broker.

No other fields require updating. Click on the Save button right at the end of the form to save the monitor configuration.

Runtime Options

This tutorial does not discuss the configuration options under the Runtime Options tab. However, you may want to quickly enable Target Performance Monitoring by expanding the Analysis Options section and activating the Switch next to "Enable target performance baselining and monitoring". You may want to set the Baseline Iterations for now to a smaller value, such as 10.

We are going to discuss this specific feature in a bit more detail when our test is running.

Click on the Update button at the bottom of the screen to update the Project configuration with the latest changes.

(Optional) Organize Assets

After saving your Project, move back to the Test Assets page. If your test assets are all around the place, you may want to organize them. It is best to have related assets grouped. In this specific case, you can move all assets under the Project, as shown in the picture below.

Organizing Assets

Assets can be dragged and dropped under both Groups and Projects to organize your test configurations.

What's Next

It is now time to start our test. Click on the link to the next section below to learn how to run tests, monitor real-time test status and access the findings in the report.