Xtesting framework has been developed in OPNFV which deals with dockerization of test suites and can thus be integrated in different CI systems. For more about XTesting and how to start with it please check it out here.
Our goal here is to demonstrate a work flow that deploy the OSC RIC platform and afterwards does a health check, which gives a pretty good idea on how it can be applied to other OSC projects. Hopefully this can be used as a CI/CD pipeline in OSC and can also help automated test and integration.
For this workflow to work one needs to prepare 2 instances (physical server or VM) with fresh Ubuntu 20.04. One is to be used as the XTesting control node, and the other one to be the system under test, on which OSC release F RIC platform is to be deployed (including the initial Kubernetes setup, and all the helm charts deployed). Then a XTesting test case on RIC Platform health check will be run from the control node against the SUT prepared.
- On the XTesting control node, some dependencies are to be installed which include:
- Openssl-server if it doesn’t come with the instance provisioned
- XTesting dependencies (ansible etc.)
- All above are incorporated into a shell script called install-dependencies for your convenience
- On the SUT node:
- Install authorized key for remote ssh access (especially for root as it needs to copy over the .kube/config file). Otherwise one may have to configure user/password credentials to be used in the workflow.
It's a 3-step process in the workflow:
- Deploy a kubernetes cluster via a customized Kubespray container, that takes all necessary configuration parameters (such as IP, username/password, etc.):
- git clone https://github.com/pekwatch746/kubespray.git
- Update the sample_env file to point to the IP address of the SUT node and other user/password settings etc. (ANSIBLE_HOST_IP= SUT's IP). With an instance created on the POWDER testbed, it may look like:
- Add a private key to the inventory/sample folder if a private key is used for ssh access.
- Build docker image: docker build -t kubespray .
- Run once it’s built successfully: sudo docker run -v ~/.kube:/kubespray/config kubespray // this will copy over the Kubernetes config file to the home directory
- Build a 2nd alpine/k8s container to complete the remaining steps for RIC platform deployment:
- Run a health check test case against the SUT that's supposed to have the RIC platform successfully deployed. Below a simple robot script for health check:
- name: Shell module example
- name: Check system information
"curl -v http://220.127.116.11:32080/appmgr/ric/v1/health/ready 2>&1"
Happy XTesting and hope your test automation can be as easy as above 1-2-3.