Diffblue Cover installation instructions

Installation

The Diffblue Cover release tar file contains these files:

  • datasheet.pdf
  • diffblue_check.py
  • diffblue.sha256
  • diffblue.tar.gz
  • install_readme.md
  • install-diffblue.py
  • install_guide.pdf
  • intellij-plugin-xxxx.xx.x.zip (where xxxx.xx.x = version)
  • intellij-plugin-manual.pdf
  • java-demo.jar
  • licenses.txt
  • prerequisites.md
  • prerequisites.pdf
  • README
  • user-manual.pdf

Copy the files to a new directory on the server and open the terminal in that directory. If you want to access the public documentation, copy the relevant pdf file to a GUI-based environment or visit Diffblue web docs. Note that the remaining installation steps assume your working directory is the new directory you created.

We provide both a quick and a detailed version of the installation procedure. The detailed version extends the quick one by describing optional steps, possible customizations, and other features of the install script.

Quick install

By default, the installer generates its own self-signed SSL certificate. When you run Diffblue Cover in a browser, you'll receive an unsigned certificate warning. To proceed, you'll need to trust this certificate. If you prefer to use your own certificate, take a look at the Detailed install section of this guide.

To install Diffblue Cover:

sudo python ./install-diffblue.py

If the installation succeeds you'll see the following messages in the output:

The installation finished SUCCESSFULLY.
Starting Diffblue server.
The server started SUCCESSFULLY.

Detailed install

To provide your own SSL certificate after installation:

  1. Name your certificate CoverCert.crt.

  2. Name your private key CoverCert.key.

  3. Copy those two files to /opt/diffblue/certificates

    If you've run the install before, these two files are already in the directory. It's safe to replace them.

  4. Restart the systemd service:

    sudo systemctl restart diffblue.service

It is best practice to check the integrity of the archive provided:

sha256sum -c diffblue.sha256

You should see the following output. If not, please contact Diffblue:

diffblue.tar.gz: OK
install-diffblue.py: OK

If the integrity check is successful, run the installation:

sudo python ./install-diffblue.py

The installer checks for necessary free space in several locations; /var/lib/docker , /opt/ and $HOME (see Prerequisites). $HOME is checked because, by default, the installer places Diffblue Cover's workspace in this directory. This can be overridden by setting a new workspace directory using the --install-directory command line parameter.

To provide your own workspace directory:

  1. Create the directory you want to use e.g. /opt/diffblue/workspace

  2. Run the installer and provide the --install-directory argument e.g. sudo ./install-diffblue.py --install-directory=/opt/diffblue/workspace

The installation calculates an upper limit to the amount of memory it consumes by checking the amount of system memory available. If you would like to explicitly limit the amount of memory used by the service you can call the installation script with the following option, where N is the amount of memory in GB:

sudo python ./install-diffblue.py --mem-limit N

Both methods for running the installation command perform these actions:

  1. Checks whether platform requirements from the previous section are met - if not, the script terminates with an error message describing the issue.
  2. Extracts all installation packages inside diffblue.tar.gz to a temporary folder ./diffblue.
  3. Loads extracted images into the local Docker registry.
  4. Creates a systemd service.
  5. Reloads the systemd daemon.
  6. Computes the memory limit for the Diffblue service, compares it with the user's limit (if passed to the script), and writes the result into the config file docker-compose.yml.
  7. Saves the configuration files to the directory /opt/diffblue.
  8. Deletes the temporary installation folder.
  9. Starts Diffblue server.

You can also use the install script to check platform requirements without performing the installation with the --check-requirements option:

sudo python ./install-diffblue.py --check-requirements

The script uses the PyYAML Python library for manipulating the YAML file. If the library is already available to Python (for example, installed using pip), the script will use it. Otherwise, the script will use a copy of the library included in the diffblue.tar.gz package. The script will NOT install the library to Python, it will only use the library temporarily during the execution of the script.

If you want to suppress the automated start of the Diffblue server after successful installation, add the option --no-start-service to the installation command.

If the script runs successfully the output should end with:

The installation finished SUCCESSFULLY.
Starting Diffblue server.
The server started SUCCESSFULLY.

The installation is now complete. You can check that the Diffblue service is running:

sudo systemctl status diffblue

The expected output is:

● diffblue.service - DiffBlue Server
   Loaded: loaded (/etc/systemd/system/diffblue.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2019-09-27 14:57:49 BST; 1h 34min ago
 Main PID: 32585 (docker-compose)
    Tasks: 9
   Memory: 47.2M
      CPU: 1min 23.042s
   CGroup: /system.slice/diffblue.service
           └─32585 /usr/bin/python /usr/local/bin/docker-compose -f /opt/diffblue/docker-compose.yml -f /opt/diffblue/docker-compose.override.yml -f /opt/diffblue/docker-compose.custom.yml up

Sep 27 16:32:14 hostname docker-compose[32585]: mongo_1               | 2019-09-27T15:32:14.541+0000 I NETWORK  [conn586] received client metadata from 127.0.0.1:51268 conn586: { application: { name: "MongoDB Shell" }, driver: { name: "MongoDB Internal Client", version: "4.0.1" }, os: { type: "Linux", name: "Ubuntu", architecture: "x86_64", version: "16.04" } }
Sep 27 16:32:14 hostname docker-compose[32585]: mongo_1               | 2019-09-27T15:32:14.543+0000 I NETWORK  [conn586] end connection 127.0.0.1:51268 (38 connections now open)
Sep 27 16:32:15 hostname docker-compose[32585]: application-server_1  | info: Received GET to /users/testing/projects From ::ffff:172.18.0.3
Sep 27 16:32:15 hostname docker-compose[32585]: front-end_1           | 172.18.0.1 - - [27/Sep/2019:15:32:15 +0000] "GET /api/users/testing/projects HTTP/1.1" 304 0 "https://localhost/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:69.0) Gecko/20100101 Firefox/69.0" "-"
Sep 27 16:32:17 hostname docker-compose[32585]: application-server_1  | info: Received GET to /health/ready From ::ffff:172.21.0.5
Sep 27 16:32:17 hostname docker-compose[32585]: keymaker_1            | ::ffff:172.21.0.4 - - [27/Sep/2019:15:32:17 +0000] "GET /health/ready HTTP/1.1" 200 4 "-" "-"
Sep 27 16:32:17 hostname docker-compose[32585]: keymaker_1            | ::ffff:172.21.0.5 - - [27/Sep/2019:15:32:17 +0000] "GET /health/ready HTTP/1.1" 200 4 "-" "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"
Sep 27 16:32:20 hostname docker-compose[32585]: application-server_1  | info: Received GET to /health/ready From ::ffff:127.0.0.1
Sep 27 16:32:20 hostname docker-compose[32585]: keymaker_1            | ::ffff:172.21.0.4 - - [27/Sep/2019:15:32:20 +0000] "GET /health/ready HTTP/1.1" 200 4 "-" "-"
Sep 27 16:32:20 hostname docker-compose[32585]: keymaker_1            | ::ffff:127.0.0.1 - - [27/Sep/2019:15:32:20 +0000] "GET /health/ready HTTP/1.1" 200 4 "-" "curl/7.61.1"

Usage

You can control the Diffblue service.

  • Start the Diffblue service:

    sudo systemctl start diffblue
    
  • Check the status of the Diffblue service:

    sudo systemctl status diffblue
    
  • Stop the Diffblue service:

    sudo systemctl stop diffblue
    
  • Configure the Diffblue service to start automatically at boot time:

    sudo systemctl enable diffblue
    

When running, the Diffblue service is accessible at:

https://SERVER

where SERVER is the ip-address or hostname of the system running Diffblue Cover.

results matching ""

    No results matching ""