Commit 600562cf authored by pfandzelter's avatar pfandzelter
Browse files

make using system tests easier

parent 96edcba0
Pipeline #45066 passed with stages
in 14 minutes and 36 seconds
......@@ -540,21 +540,22 @@ To get a coverage report, you can use `make coverage` and `make coverhtml`, depe
There are two system tests to test functionality of a FReD deployment as a whole.
This is part of a TDD approach where tests can be defined first and the software is refined until it completes all tests.
All system tests can be found in `./tests`.
All tests require Docker and Docker Compose to work.
##### 3 Node Test
The "3 node test" starts a FReD deployment of three FReD nodes and runs a client against the FReD cluster that validates different functionalities.
It can be found in `./tests/3NodeTest`.
It uses Docker compose and can thus easily be started with `make 3n-all`.
The deployment comprises a single `etcd` Docker container as a NaSe, a simple trigger node, two FReD nodes that each comprise only a single machine (node _B_ and _C_) with a storage server, and a distributed FReD node _A_ that comprises three individual FReD machines behind a `fredproxy` sharing a single storage server.
All machines are connected over a Docker network.
The test client runs a number of operations against the FReD deployment and outputs a list of errors.
The complete code for the test client can be found in `./tests/3NodeTest/cmd/main/main.go`.
The complete code for the test client can be found in `./tests/3NodeTest`.
When the debug log output of the individual nodes is not enough to debug an issue, it is also possible to connect a `dlv` debugger directly to FReD node _B_ to set breakpoints or step through code.
This is currently configured to use the included debugger in the GoLang IDE.
This is currently configured to use the included debugger in the GoLand IDE.
Further information can be found in the 3 node test documentation.
##### Failing Node Test
......@@ -566,6 +567,17 @@ It uses the Docker API to destroy and start the corresponding containers.
The code can be found in `./tests/FailingNodeTest` but can be started with `make failtest` in `./tests/3NodeTest/` after a deployment has been created with `make fred`.
##### ALExANDRA Test
The ALExANDRA test tests a limited amount of middleware functionality.
Use `make alexandratest` to run it.
The complete code can be found and extended in `./tests/AlexandraTest`.
##### Consistency Test
The consistency test tests consistency guarantees provided by the middleware.
In `./tests/consistency` run `bash ./ [NUM_NODES] [NUM_CLIENTS]` and specify the number of FReD nodes and clients.
#### Cluster
You can easily set up a cluster of FReD nodes by using the `` script in the `cluster/` folder.
//go:build !race
// +build !race
package etcdnase
......@@ -21,7 +22,7 @@ import (
const (
certBasePath = "../../tests/runner/certificates/"
certBasePath = "../../tests/certificates/"
etcdDir = ".default.etcd"
nodeID = "A"
host = "localhost:8000"
......@@ -20,7 +20,7 @@ import (
const (
certBasePath = "../../tests/runner/certificates/"
certBasePath = "../../tests/certificates/"
etcdDir = ".default.etcd"
nodeID = fred.NodeID("X")
......@@ -3,7 +3,7 @@ version: "3.7"
context: ../../
context: ..
dockerfile: tests/3NodeTest/Dockerfile
image: fred/tester:local
container_name: tester
......@@ -5,7 +5,7 @@ services:
- alexandra
context: ../../
context: ..
dockerfile: tests/AlexandraTest/Dockerfile
image: fred/alexandra-tester:local
container_name: alexandra-tester
......@@ -8,7 +8,7 @@ services:
- nodeB
- nodeC
context: ../../
context: ..
dockerfile: alexandra.Dockerfile
image: fred/alexandra:local
container_name: alexandra
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment