Setting up SDNC, RAN-sim controller and Honeycomb simulator locally:
...
Running CSIT tests locally within CPS
If using Windows, first install WSL using the following command within Powershell as an administrator and restart your machine (If using a Linux environment, these steps can be skipped)
Code Block | ||||
---|---|---|---|---|
| ||||
wsl --install |
Enable WSL 2 and run the following command within Powershell as an administrator and restart your machine.
Code Block | ||||
---|---|---|---|---|
| ||||
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart |
Download and install the Linux kernel update package
Set WSL 2 as the default Linux distribution
Code Block | ||||
---|---|---|---|---|
| ||||
wsl --set-default-version 2 |
Install Ubuntu 20.04 for Windows from the Microsoft store
Once this is launched, it will then install the Ubuntu Machine, this may take a few minutes.
You will need to set your Unix Username and Password.
- Remember your password, you will need it for SUDO commands!
Next step is to setup docker desktop with WSL2
Download and install docker desktop at
Once docker desktop is installed go to Settings>General and check 'Use the WSL 2 based engine'. Click apply and restart
Once restated, go to Settings>Resources>WSL Integration and check 'Enable Integration with my default WSL distro' and enable your integration
Click Apply & Restart
From your Linux/WSL terminal
Update package index
Code Block | ||
---|---|---|
| ||
sudo apt update |
Install Python3
Code Block | ||
---|---|---|
| ||
sudo apt install python3 |
Install pip
Code Block | ||
---|---|---|
| ||
sudo apt install python3-pip |
Upgrade pip
Code Block | ||
---|---|---|
| ||
sudo pip3 install --upgrade pip |
Install Robot Framework
Code Block | ||
---|---|---|
| ||
pip3 install robotframework |
Install git
Code Block | ||
---|---|---|
| ||
sudo apt install git |
Install maven
Code Block | ||
---|---|---|
| ||
sudo apt install maven |
Clone CPS and Dmi Plugin repos to home directory
Note - You will need to set up your ssh key as outlined here Setting Up Your Development Environment
Copy the settings.xml file from the oparent repo to your .m2 folder located within your home directory
Note - This folder will be hidden, but it should exist once you have maven installed!
Verify the docker daemon is accepting connections.
Code Block | ||
---|---|---|
| ||
docker ps |
If you see this error
Code Block | ||
---|---|---|
| ||
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json": dial unix /var/run/docker.sock: connect: permission denied |
Issue the following command
Code Block | ||
---|---|---|
| ||
sudo chmod 666 /var/run/docker.sock |
Do a mvn clean install on both directories to pull down the necessary libraries from the POM.
Navigate to csit directory.
Run the following script
Code Block | ||
---|---|---|
| ||
sudo bash run-project-csit.sh |
Note - The first time this runs it will download all the libraries defined in the CSTI scripts. This may take awhile be patient
Once the scripts have run, the output should look like the following
As part of this process docker containers are created for cps-and-ncmp, dbpostgresql, ncmp-dmi-plugin, mariadb and sdnc, once the testing is finished these docker containers are stopped and removed.
To prevent these docker containers from being stopped as part of this process for any reason, within the teardown.sh script located in cps/csit/plans/cps comment out the following line.
Potential issues
This issue may also appear when running the scripts from a windows WSL environment
Code Block | ||
---|---|---|
| ||
Error response from daemon: invalid IP address in add-host: "" |
To resolve this, do the following:
Issue the following command
Code Block | ||
---|---|---|
| ||
sudo apt install net-tools |
Code Block | ||
---|---|---|
| ||
ifconfig |
From the eth0 configuration take the inet address
And manually add this address to the LOCAL_IP variable within the setup.sh script located in the following directory cps/csit/plans/cps
Save this configuration.
Run scripts again.
If your tests don't run after doing this, as seen above check for this error.
Code Block | ||
---|---|---|
| ||
/tmp/tmp.rgIeMxiRCGrobot_venv/bin/python: Error while finding module specification for 'robot.run' (ModuleNotFoundError: No module named 'robot') |
In the file run-csit.sh located within the cps/csit directory
Look for the following line.
Code Block | ||
---|---|---|
| ||
python -m robot.run -N ${TESTPLAN} -v WORKSPACE:/tmp ${ROBOT_VARIABLES} ${TESTOPTIONS} ${SUITES} |
Change this to
Code Block | ||
---|---|---|
| ||
python3 -m robot.run -N ${TESTPLAN} -v WORKSPACE:/tmp ${ROBOT_VARIABLES} ${TESTOPTIONS} ${SUITES} |
Run scripts again
If there is further issues downloading libraries due to the system date being out of sync with windows issue the following command and run the scripts again.
...
language | bash |
---|
...
FAQ
How to fix "Error: could not open `{argLine}'
when running unit tests from Intellij IDE ?
...