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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
Core Image Tester
#################
A micro-service uses adt-run to boot an ubuntu-core image and run some tests.
Get the Source
==============
Branch the code::
$ bzr branch lp:core-image-tester
Install the Service
===================
Build and activate a virtualenv with python3::
$ virtualenv -p python3 --system-site-packages ve
$ . ve/bin/activate
Install dependencies from pypi::
$ pip install -r requirements.txt
...and install some dependencies from phablet-tools PPA::
$ sudo add-apt-repository ppa:canonical-ci-engineering/u-services
$ sudo apt-get update
$ sudo apt-get install autopkgtest
...and install bzr, which is needed to get the test branch::
$ sudo apt-get install bzr
Install the service itself::
$ python setup.py install
...you may want to install it in 'development mode', which symlinks files,
so you can edit/re-run without having to re-install the service. In that
case, run::
$ python setup.py develop
uci-nova
++++++++
This service includes a custom adt-run ssh setup script called 'uci-nova'. This
is a shell script that exists in the root of the branch, and is called by the
core-image-tester service.
You can run adt-run manually yourself, in order to replicate what the service
does. For example::
$ adt-run --built-tree <test_dir> \
--output-dir <result_dir> \
--- ssh -s ./uci-nova -- \
--flavor <nova_flavour> \
--image <nova_image>
Run the tests!
==============
Install dependencies::
$ pip install -r test_requirements.txt
Run those tests - with vigour!::
$ python setup.py test
Also with elegance in mind::
$ python setup.py flake8
The config file
===============
The sample configuration file in 'core-service.conf'::
[amqp]
uris = amqp://guest:guest@localhost:5672//
[nova]
os_username = foo
os_password = <redacted>
os_tenant_name = foo_project
os_auth_url = http://172.20.161.138:5000/v2.0/
[adt]
image_flavor = m1.smaller
test_branch = lp:snappy/selftest
os_username = bar
os_password = <redacted>
os_tenant_name = bar_project
os_auth_url = http://172.20.161.138:5000/v2.0/
extra_args = --net-id=415a0839-eb05-4e7a-907c-413c657f4bf5
...optionally, add a logstash section, which will turn on the logstash handler::
[logstash]
host = 127.0.0.1
port = 1234
version = 1
|