~cprov/core-image-tester/refix-revno

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
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

.. note::
  Thomi: At the time of writing (16/3/2015), the autopkgtest from the PPA is not
  enough to make this work. You also need to manually branch 
  lp:~canonical-ci-engineering/adt-cloud-worker/uci-nova and follow the instructions
  there.

...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

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/
  extra_args = --net-id=415a0839-eb05-4e7a-907c-413c657f4bf5

  [adt]
  image_flavor = m1.smaller
  test_branch = lp:snappy/selftest

...optionally, add a logstash section, which will turn on the logstash handler::

  [logstash]
  host = 127.0.0.1
  port = 1234
  version = 1