Skip to content
Snippets Groups Projects
Commit e74c157c authored by Nikolay Stanchev's avatar Nikolay Stanchev
Browse files

Merge remote-tracking branch 'origin' into clmc-service

parents 65e14843 aec67cc2
No related branches found
No related tags found
No related merge requests found
......@@ -43,11 +43,12 @@ Implementation documentation and discussion can be found in the docs directory.
Testing is implemented using pytest using the following convention:
* The testing environment is Vagrant/Virtualbox for a base VM with LXC is installed for specific containers.
* The testing environment is Vagrant/Virtualbox for a base VM with LXD is installed for specific containers.
* Tests are written in python using pytest
* Related tests are stored in a python module `src/test/clmctest/<testmodule>` to create a suite of tests. All tests are stored in files test_*.py, there can be many tests per file, and many files per module
* Tests are executed against a set of LXC containers described in `src/test/clmctest/rspec.json`.
* Tests are executed from the test-runner container on the VM using install python modules
* CI testing is on givry using nested LXD containers
Create a single VM with LXC installed and configured with lxcbr0 configured for the network 172.40.231.0/24
......@@ -121,37 +122,36 @@ pytest -s --pyargs clmctest.monitoring
#### CI Testing
A lxd container is setup on givry called `clmc-ci`. The container is priviledged and allows for nested containers. The container was created using the following commands
A lxd container is setup on givry called `flame-clmc-ci`. The container is priviledged and allows for nested containers. The container was created using the following commands
```
lxc launch ubuntu:18.04 clmc-ci -c security.privileged=true -c security.nesting=true
lxc network attach br_ci clmc-ci eth0
lxc config device set clmc-ci eth0 ipv4.address 10.0.3.15
lxc launch ubuntu:18.04 flame-clmc-ci -c security.privileged=true -c security.nesting=true
```
the container is then started and LXD initialised
```
lxc start clmc-ci
lxc exec clmc-ci -- bash
lxc init
```
lxc exec flame-clmc-ci -- bash
lxd init --auto --storage-backend dir
lxc network create lxcbr0 ipv6.address=none ipv4.address=172.40.231.1/24 ipv4.nat=true
Follow the interactive prompts, use the defaults apart from the storage pool type, use `dir` type
```
Now configure ip table persistence, this is needed for the fixtures script to work but not for CI
```
apt update
echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections
echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections
apt-get -y install iptables-persistent
apt -y install iptables-persistent
```
The install git runner file was just copied to the container from a tmp director
```
cp /tmp/install-git-runner.sh /var/lib/lxd/containers/clmc-ci/rootfs/tmp
chmod 755 /var/lib/lxd/containers/clmc-ci/rootfs/tmp
lxc file push /home/mjb/dev/flame-clmc/scripts/test/install-git-runner.sh flame-clmc-ci/root/
lxc exec flame-clmc-ci -- chmod 755 ./install-git-runner.sh
lxc exec flame-clmc-ci -- ./install-git-runner.sh
```
Note that the branch must be "protected" for the secret repo rc variables to be passed to the CI script
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment