Infrastructure integration testing for a redborder manager machine. The idea is to run the tests in a machine that is the validator local machine, so the target machine is affected by the tests.
First, clone this repository on your workstation. Then install the gemes by executing this:
bundle installSometimes you need to make sure that you share your public ssh key to target machine:
ssh-copy-id root@<target_ip>To run all tests, use the following command:
rake specOptional parameters:
- TARGET_HOST: Machine where the tests will run via SSH.
- LOGIN_USERNAME: Username for SSH connection to the test machine.
- LOGIN_PASSWORD: Password for SSH connection to the test machine.
- IS_CLUSTER: Boolean to indicate if the target machine is a cluster.
- -j 10 -m: To run tests in pararell Example with optional parameters:
IS_CLUSTER="false" TARGET_HOST="10.1.209.50" LOGIN_USERNAME="root" LOGIN_PASSWORD="redborder" rake specTo run a specific test type, use the following command:
rake spec:configurationTo run a specific test in a spec file, better use tags:
rspec --tag tag_nameTo run a specific script test, use the following command:
rspec spec/services/cgroup_spec.rbList of Available Rake Tasks:
rake -TWhen creating a new test, it is important to follow the directory structure outlined in the Rakefile. This structure helps maintain organization and clarity within the test suite.
Directory structure:
spec/
├── spec_helper.rb
├── services/
│ ├── ... # Place your service-related tests here
├── configuration/
│ ├── ... # Place your configuration-related tests here
├── modules/
│ ├── monitor/
│ ├── ... # Place your module-related tests here
└── helpers/
├── ... # Place your helper-related tests here