File: run-integration-tests

package info (click to toggle)
python-pylxd 2.2.10-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 820 kB
  • sloc: python: 7,258; sh: 104; makefile: 21
file content (33 lines) | stat: -rwxr-xr-x 1,093 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
set -ex

_dir="$( cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)"
_release=$(lsb_release -cs)

sudo apt-get update
sudo apt-get install -y tox python3-dev libssl-dev libffi-dev build-essential

lxc config set core.trust_password password
lxc config set core.https_address [::]

if [[ "${_release}" == "bionic" ]]; then
	# force generation of client certificate to an address that doesn't work (http)
	# generate an openssl certificate and key for the remote not verified test
	mkdir -p $HOME/.config/lxc
	openssl genrsa 1024 > $HOME/.config/lxc/client.key
	chmod 400 $HOME/.config/lxc/client.key

	openssl req -new -x509 -nodes -sha1 -days 365 \
		-key $HOME/.config/lxc/client.key -out $HOME/.config/lxc/client.crt \
		-subj="/C=UK/ST=London/L=London/O=OrgName/OU=Test/CN=example.com"

	# create a default dir storage pool for bionic
	lxc storage create default dir
	lxc profile device add default root disk path=/ pool=default
	echo "Run 18.04 (bionic) integration tests"
else
	echo "Run 16.04 (xenial) integration tests"
fi

# finally run the integration tests
tox -e integration