...
The Blueprint Validation Framework offers a set of tools that can be used to test Akraino deployments on different layers (hardware, os, k8s, openstack, etc).
The framework provides tests at different layers of the stack, like hardware, operating system, cloud infrastructure, security, etc. Since the project is constantly evolving, the full list of available tests can be found in the projects repo, where the tests are located under their respective layer. Each layer has its own container image built by the validation project. The full list of images provided can be found in the project’s DockerHub repo.
Topology
General Requirements
...
Some of the tests need to install the testing tools directly on the SUT, so the SUT needs to have access to Internet.
Using
...
blucon to run the tests
The containers are ran from a Jumpserver with access to the SUT. Some tests use ssh to connect to the cluster, some use other tools (e.g the k8s layer uses the kubeclt client). The input needed from user is specified in this guide. Each layer has an individual container from which the tests run.
The tests run using the bluval tool. The tool takes as parameters the layer and the blueprint for which to run the tests. A base blueprint is given as an example here.
The blucon script can be used to both start the container and run the tests. The steps to do that are:
Clone the validation repo
Code Block ubuntu@ubuntu:~$ git clone http://gerrit.akraino.org/r/validation
Customize the blueprint - Optional step
In case your blueprint yaml file is not already in the validation repo inside the bluval folder, or you want to run a subset of the tests, you can create your own bluval yaml file and mount it later in the container. Below is an example of a demo blueprint that will call just the k8s conformance tests.
Code Block ubuntu@ubuntu:~$ cat validation/bluval/bluval-demo.yaml blueprint: name: demo layers: - k8s k8s: &k8s - name: conformance what: conformance optional: "False"
Fill in volumes.yaml file
Fill in the file validation/bluval/volume.yaml with the data that applies to your setup. The volumes that don’t have a local value set will be ignored. In the example below, only the following volumes are set:
- Location to the kube config files needed for access to the cluster
- Location to the customized blueprint file
- Location to where to store the results
Code Block ubuntu@ubuntu:~$ cat validation/bluval/volumes.yaml |tail -n +23 volumes: # location of the ssh key to access the cluster ssh_key_file: local: '' target: '/root/.ssh' # location of the k8s access files (config file, certificates, keys) kube_config_dir: local: '/home/ubuntu/kube' target: '/root/.kube/' # location of the customized variables.yaml custom_variables_file: local: '' target: '/opt/akraino/validation/tests/variables.yaml' # location of the bluval-<blueprint>.yaml file blueprint_dir: local: '/home/ubuntu/validation/bluval' target: '/opt/akraino/validation/bluval' # location on where to store the resulst on the local jumpserver results_dir: local: '/home/ubuntu/results' target: '/opt/akraino/results'
Depending on which tool is used for connecting to the cluster (ssh, kubectl, etc), the corresponding volume needs to be mounted inside the container. To see which are the specific containers for each layer, check the second section in the same volumes.yaml file
Code Block ubuntu@ubuntu:~$ cat validation/bluval/volumes.yaml |tail -n +45 # parameters that will be passed to the container at each layer layers: # volumes mounted at all layers; volumes specific for a different layer are below common: - custom_variables_file - blueprint_dir - results_dir hardware: - ssh_key_file os: - ssh_key_file networking: - ssh_key_file k8s: - ssh_key_file - kube_config_dir k8s_networking: - ssh_key_File - kube_config_dir
- Run the tests
Code Block |
---|
ubuntu@ubuntu:~$ python3 validation/bluval/blucon.py <blueprint_name> [-l <layer>] |
Getting the results
The results are stored inside the container in the /opt/akraino/results folder. If a volume was mounted to this folder (e.g. /home/ubuntu/results) then they can be viewed from the host where the test was ran. The results can be viewed with a browser, using the report.html file that the robot framework provides. In case of failures, the sonobuoy archive can be used to inspect all the logs
Code Block |
---|
ubuntu@ubuntu:~$ ls results/k8s/conformance/
201909110859_sonobuoy_376a4ddc-4498-49fc-af2e-999242c4c245.tar.gz Conformance.Conformance.log log.html output.xml report.html |
The OS layer
TBD
The Hardware layer
...