Merge lp:~barry/ubuntu-system-image/lp1373467 into lp:~registry/ubuntu-system-image/client

Proposed by Barry Warsaw
Status: Merged
Merged at revision: 296
Proposed branch: lp:~barry/ubuntu-system-image/lp1373467
Merge into: lp:~registry/ubuntu-system-image/client
Diff against target: 8905 lines (+4167/-1538)
90 files modified
.bzrignore (+2/-0)
cli-manpage.rst (+13/-14)
dbus-manpage.rst (+14/-14)
ini-manpage.rst (+25/-24)
systemimage/api.py (+0/-5)
systemimage/config.py (+141/-99)
systemimage/data/client.ini (+0/-35)
systemimage/dbus.py (+2/-2)
systemimage/helpers.py (+34/-24)
systemimage/keyring.py (+2/-2)
systemimage/main.py (+5/-13)
systemimage/scores.py (+1/-0)
systemimage/service.py (+5/-11)
systemimage/state.py (+18/-15)
systemimage/testing/controller.py (+7/-6)
systemimage/testing/dbus.py (+1/-0)
systemimage/testing/helpers.py (+109/-52)
systemimage/testing/nose.py (+6/-1)
systemimage/tests/data/00.ini (+0/-1)
systemimage/tests/data/01.ini (+0/-1)
systemimage/tests/data/api.channels_01.json (+13/-0)
systemimage/tests/data/api.index_01.json (+36/-0)
systemimage/tests/data/api.index_02.json (+251/-0)
systemimage/tests/data/candidates.index_01.json (+6/-0)
systemimage/tests/data/candidates.index_02.json (+23/-0)
systemimage/tests/data/candidates.index_08.json (+244/-0)
systemimage/tests/data/candidates.index_10.json (+36/-0)
systemimage/tests/data/candidates.index_11.json (+37/-0)
systemimage/tests/data/candidates.index_13.json (+244/-0)
systemimage/tests/data/channel.channels_01.json (+23/-0)
systemimage/tests/data/channel.channels_02.json (+38/-0)
systemimage/tests/data/channel.channels_03.json (+70/-0)
systemimage/tests/data/channel.channels_04.json (+56/-0)
systemimage/tests/data/channel.channels_05.json (+23/-0)
systemimage/tests/data/channel_06.ini (+0/-8)
systemimage/tests/data/channel_07.ini (+0/-8)
systemimage/tests/data/config.config_01.ini (+34/-0)
systemimage/tests/data/config.config_02.ini (+2/-3)
systemimage/tests/data/config.config_03.ini (+2/-3)
systemimage/tests/data/config.config_04.ini (+36/-0)
systemimage/tests/data/config.config_05.ini (+2/-3)
systemimage/tests/data/config.config_06.ini (+2/-3)
systemimage/tests/data/config.config_07.ini (+0/-1)
systemimage/tests/data/config.config_08.ini (+0/-1)
systemimage/tests/data/config.config_09.ini (+0/-3)
systemimage/tests/data/config.config_10.ini (+2/-2)
systemimage/tests/data/config_04.ini (+0/-36)
systemimage/tests/data/dbus.index_03.json (+36/-0)
systemimage/tests/data/download.index_01.json (+6/-0)
systemimage/tests/data/gpg.channels_01.json (+23/-0)
systemimage/tests/data/helpers.config_01.ini (+7/-0)
systemimage/tests/data/helpers.config_02.ini (+6/-0)
systemimage/tests/data/index.channels_01.json (+9/-0)
systemimage/tests/data/index.channels_02.json (+13/-0)
systemimage/tests/data/index.channels_05.json (+9/-0)
systemimage/tests/data/index.index_01.json (+251/-0)
systemimage/tests/data/index.index_04.json (+244/-0)
systemimage/tests/data/index_26.json (+0/-245)
systemimage/tests/data/main.channels_01.json (+13/-0)
systemimage/tests/data/main.channels_03.json (+13/-0)
systemimage/tests/data/main.config_01.ini (+3/-4)
systemimage/tests/data/main.config_05.ini (+7/-0)
systemimage/tests/data/main.config_07.ini (+1/-1)
systemimage/tests/data/main.index_04.json (+36/-0)
systemimage/tests/data/main.index_05.json (+36/-0)
systemimage/tests/data/scores.index_01.json (+245/-0)
systemimage/tests/data/scores.index_05.json (+245/-0)
systemimage/tests/data/state.channel_01.ini (+6/-0)
systemimage/tests/data/state.channels_01.json (+64/-0)
systemimage/tests/data/state.channels_02.json (+13/-0)
systemimage/tests/data/state.index_01.json (+244/-0)
systemimage/tests/data/state.index_02.json (+245/-0)
systemimage/tests/data/state.index_03.json (+36/-0)
systemimage/tests/data/state.index_04.json (+37/-0)
systemimage/tests/test_api.py (+20/-13)
systemimage/tests/test_candidates.py (+20/-20)
systemimage/tests/test_channel.py (+18/-18)
systemimage/tests/test_config.py (+117/-170)
systemimage/tests/test_dbus.py (+88/-121)
systemimage/tests/test_download.py (+31/-32)
systemimage/tests/test_gpg.py (+12/-12)
systemimage/tests/test_helpers.py (+110/-128)
systemimage/tests/test_index.py (+31/-25)
systemimage/tests/test_main.py (+203/-267)
systemimage/tests/test_scores.py (+10/-10)
systemimage/tests/test_settings.py (+2/-5)
systemimage/tests/test_state.py (+71/-58)
systemimage/tests/test_winner.py (+21/-17)
tools/demo.ini (+0/-1)
tools/mkvenv.py (+0/-1)
To merge this branch: bzr merge lp:~barry/ubuntu-system-image/lp1373467
Reviewer Review Type Date Requested Status
Registry Administrators Pending
Review via email: mp+246660@code.launchpad.net

Description of the change

This finally passes all tests and I think is ready for merging to trunk. I predict the diff will be enormous and conflicty ;).

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2014-11-03 21:36:27 +0000
+++ .bzrignore 2015-01-15 22:43:25 +0000
@@ -12,3 +12,5 @@
12coverage.xml12coverage.xml
13htmlcov13htmlcov
14coverage-*14coverage-*
15py34-curl
16py34-udm
1517
=== modified file 'cli-manpage.rst'
--- cli-manpage.rst 2014-10-25 01:12:08 +0000
+++ cli-manpage.rst 2015-01-15 22:43:25 +0000
@@ -7,9 +7,9 @@
7------------------------------------------------7------------------------------------------------
88
9:Author: Barry Warsaw <barry@ubuntu.com>9:Author: Barry Warsaw <barry@ubuntu.com>
10:Date: 2014-10-2310:Date: 2015-01-15
11:Copyright: 2013-2014 Canonical Ltd.11:Copyright: 2013-2015 Canonical Ltd.
12:Version: 2.5.112:Version: 3.0
13:Manual section: 113:Manual section: 1
1414
1515
@@ -84,10 +84,13 @@
84 enabled. With two ``-v`` (or ``-vv``), logging both to the console and to84 enabled. With two ``-v`` (or ``-vv``), logging both to the console and to
85 the log file are output at ``DEBUG`` level.85 the log file are output at ``DEBUG`` level.
8686
87-C FILE, --config FILE87-C DIR, --config DIR
88 Use the given configuration file, otherwise use the default. The program88 Use the given configuration directory, otherwise use the system default.
89 will optionally also read a ``channel.ini`` file in the same directory as89 The program will read all the files in this directory that begin with a
90 ``FILE``.90 number, followed by an underscore, and ending in ``.ini``
91 (e.g. ``03_myconfig.ini``). The files are read in sorted numerical order
92 from lowest prefix number to highest, with later configuration files able
93 to override any variable in any section.
9194
92--factory-reset95--factory-reset
93 Wipes the data partition and issues a reboot into recovery. This96 Wipes the data partition and issues a reboot into recovery. This
@@ -112,15 +115,11 @@
112FILES115FILES
113=====116=====
114117
115/etc/system-image/client.ini118/etc/system-image/[0-9]+*.ini
116 Default configuration file.119 Default configuration files.
117
118/etc/system-image/channel.ini
119 Optional configuration file overrides (for the ``[service]`` section
120 only).
121120
122121
123SEE ALSO122SEE ALSO
124========123========
125124
126client.ini(5), system-image-dbus(8)125system-image.ini(5), system-image-dbus(8)
127126
=== modified file 'dbus-manpage.rst'
--- dbus-manpage.rst 2014-11-10 16:17:36 +0000
+++ dbus-manpage.rst 2015-01-15 22:43:25 +0000
@@ -7,9 +7,9 @@
7-----------------------------------------7-----------------------------------------
88
9:Author: Barry Warsaw <barry@ubuntu.com>9:Author: Barry Warsaw <barry@ubuntu.com>
10:Date: 2014-09-2910:Date: 2015-01-15
11:Copyright: 2013-2014 Canonical Ltd.11:Copyright: 2013-2015 Canonical Ltd.
12:Version: 2.512:Version: 3.0
13:Manual section: 813:Manual section: 8
1414
1515
@@ -42,10 +42,13 @@
42 enabled. With two ``-v`` (or ``-vv``), logging both to the console and to42 enabled. With two ``-v`` (or ``-vv``), logging both to the console and to
43 the log file are output at ``DEBUG`` level.43 the log file are output at ``DEBUG`` level.
4444
45-C FILE, --config FILE45-C DIR, --config DIR
46 Use the given configuration file, otherwise use the default. The program46 Use the given configuration directory, otherwise use the system default.
47 will optionally also read a ``channel.ini`` file in the same directory as47 The program will read all the files in this directory that begin with a
48 ``FILE``.48 number, followed by an underscore, and ending in ``.ini``
49 (e.g. ``03_myconfig.ini``). The files are read in sorted numerical order
50 from lowest prefix number to highest, with later configuration files able
51 to override any variable in any section.
4952
5053
51D-BUS API54D-BUS API
@@ -311,12 +314,8 @@
311FILES314FILES
312=====315=====
313316
314/etc/system-image/client.ini317/etc/system-image/[0-9]+*.ini
315 Default configuration file.318 Default configuration files.
316
317/etc/system-image/channel.ini
318 Optional configuration file overrides (for the ``[service]`` section
319 only).
320319
321/etc/dbus-1/system.d/com.canonical.SystemImage.conf320/etc/dbus-1/system.d/com.canonical.SystemImage.conf
322 DBus service permissions file.321 DBus service permissions file.
@@ -328,6 +327,7 @@
328SEE ALSO327SEE ALSO
329========328========
330329
331client.ini(5), system-image-cli(1)330system-image.ini(5), system-image-cli(1)
331
332332
333.. _`ISO 8601`: http://en.wikipedia.org/wiki/ISO_8601333.. _`ISO 8601`: http://en.wikipedia.org/wiki/ISO_8601
334334
=== modified file 'ini-manpage.rst'
--- ini-manpage.rst 2014-09-29 14:05:29 +0000
+++ ini-manpage.rst 2015-01-15 22:43:25 +0000
@@ -1,39 +1,43 @@
1==========1================
2client.ini2system-image.ini
3==========3================
44
55
6-----------------------------------------------6------------------------------------------------
7Ubuntu System Image Upgrader configuration file7Ubuntu System Image Upgrader configuration files
8-----------------------------------------------8------------------------------------------------
99
10:Author: Barry Warsaw <barry@ubuntu.com>10:Author: Barry Warsaw <barry@ubuntu.com>
11:Date: 2014-09-2911:Date: 2015-01-15
12:Copyright: 2013-2014 Canonical Ltd.12:Copyright: 2013-2015 Canonical Ltd.
13:Version: 2.513:Version: 3.0
14:Manual section: 514:Manual section: 5
1515
1616
17DESCRIPTION17DESCRIPTION
18===========18===========
1919
20``/etc/system-image/client.ini`` is the configuration file for the system20``/etc/system-image/`` is the default configuration directory for the system
21image upgrader. It is an ini-style configuration file with sections that21image upgrader. It contains ini-style configuration files with sections that
22define the service to connect to, as well as local system resources.22define the service to connect to, as well as local system resources.
23Generally, the options never need to be changed.23Generally, the options never need to be changed.
2424
25The system image upgrader will also optionally read a25The system image upgrader will read a all files in this directory that start
26``/etc/system-image/channel.ini`` file with the same format as ``client.ini``.26with a numeric prefix, followed by an underscore, and then any alphanumeric
27This file should only contain a ``[service]`` section for overriding in the27suffix, ending in ``.ini``. E.g. ``07_myconfig.ini``.
28``client.ini`` file. All other sections are ignored.28
29The files are read in sorted numerical order, from lowest prefix number to
30highest, with later configuration files able to override any variable in any
31section.
2932
3033
31SYNTAX34SYNTAX
32======35======
3336
34Sections are delimited by square brackets, e.g. ``[service]``. Variables37Sections in the ``.ini`` files are delimited by square brackets,
35inside the service separate the variable name and value by a colon. Blank38e.g. ``[service]``. Variables inside the service separate the variable name
36lines and lines that start with a ``#`` are ignored.39and value by a colon. Blank lines and lines that start with a ``#`` are
40ignored.
3741
3842
39THE SERVICE SECTION43THE SERVICE SECTION
@@ -82,10 +86,6 @@
8286
83This section contains the following variables:87This section contains the following variables:
8488
85build_file
86 The file on the local file system containing the system's current build
87 number.
88
89tempdir89tempdir
90 The base temporary directory on the local file system. When any of the90 The base temporary directory on the local file system. When any of the
91 system-image processes run, a secure subdirectory inside `tempdir` will be91 system-image processes run, a secure subdirectory inside `tempdir` will be
@@ -204,6 +204,7 @@
204204
205system-image-cli(1)205system-image-cli(1)
206206
207
207[1]: https://wiki.ubuntu.com/ImageBasedUpgrades/Server208[1]: https://wiki.ubuntu.com/ImageBasedUpgrades/Server
208209
209[2]: https://wiki.ubuntu.com/ImageBasedUpgrades/GPG210[2]: https://wiki.ubuntu.com/ImageBasedUpgrades/GPG
210211
=== modified file 'systemimage/api.py'
--- systemimage/api.py 2014-08-08 19:06:47 +0000
+++ systemimage/api.py 2015-01-15 22:43:25 +0000
@@ -24,7 +24,6 @@
2424
25import logging25import logging
2626
27from systemimage.helpers import last_update_date
28from systemimage.reboot import factory_reset27from systemimage.reboot import factory_reset
29from systemimage.state import State28from systemimage.state import State
30from unittest.mock import patch29from unittest.mock import patch
@@ -62,10 +61,6 @@
62 # No winners.61 # No winners.
63 return ''62 return ''
6463
65 @property
66 def last_update_date(self):
67 return last_update_date()
68
6964
70class Mediator:65class Mediator:
71 """This is the DBus API mediator.66 """This is the DBus API mediator.
7267
=== modified file 'systemimage/config.py'
--- systemimage/config.py 2014-10-29 15:26:04 +0000
+++ systemimage/config.py 2015-01-15 22:43:25 +0000
@@ -17,7 +17,6 @@
1717
18__all__ = [18__all__ = [
19 'Configuration',19 'Configuration',
20 'DISABLED',
21 'config',20 'config',
22 ]21 ]
2322
@@ -27,82 +26,175 @@
2726
28from configparser import ConfigParser27from configparser import ConfigParser
29from contextlib import ExitStack28from contextlib import ExitStack
30from pkg_resources import resource_filename29from pathlib import Path
31from systemimage.bag import Bag30from systemimage.bag import Bag
32from systemimage.helpers import (31from systemimage.helpers import (
33 as_loglevel, as_object, as_timedelta, makedirs, temporary_directory)32 NO_PORT, as_loglevel, as_object, as_port, as_stripped, as_timedelta,
3433 makedirs, temporary_directory)
3534
36DISABLED = object()35
36SECTIONS = ('service', 'system', 'gpg', 'updater', 'hooks', 'dbus')
3737
3838
39def expand_path(path):39def expand_path(path):
40 return os.path.abspath(os.path.expanduser(path))40 return os.path.abspath(os.path.expanduser(path))
4141
4242
43def port_value_converter(value):43class SafeConfigParser(ConfigParser):
44 if value.lower() in ('disabled', 'disable'):44 """Like ConfigParser, but with default empty sections.
45 return DISABLED45
46 result = int(value)46 This makes the **style of loading keys/values into the Bag objects a
47 if result < 0:47 little cleaner since it doesn't have to worry about KeyErrors when a
48 raise ValueError(value)48 configuration file doesn't contain a section, which is allowed.
49 return result49 """
5050
5151 def __init__(self, *args, **kws):
52def device_converter(value):52 super().__init__(args, **kws)
53 return value.strip()53 for section in SECTIONS:
54 self[section] = {}
5455
5556
56class Configuration:57class Configuration:
57 def __init__(self, ini_file=None):58 def __init__(self, directory=None):
58 # Defaults.59 self._set_defaults()
59 self.config_file = None
60 self.service = Bag()
61 self.system = Bag()
62 if ini_file is None:
63 ini_file = resource_filename('systemimage.data', 'client.ini')
64 self.load(ini_file)
65 self._override = False
66 # 2013-10-14 BAW This is a placeholder for rendezvous between the60 # 2013-10-14 BAW This is a placeholder for rendezvous between the
67 # downloader and the D-Bus service. When running udner D-Bus and we61 # downloader and the D-Bus service. When running under D-Bus and we
68 # get a `paused` signal from the download manager, we need this to62 # get a `paused` signal from the download manager, we need this to
69 # plumb through an UpdatePaused signal to our clients. It rather63 # plumb through an UpdatePaused signal to our clients. It rather
70 # sucks that we need a global for this, but I can't get the plumbing64 # sucks that we need a global for this, but I can't get the plumbing
71 # to work otherwise. This seems like the least horrible place to65 # to work otherwise. This seems like the least horrible place to
72 # stash this global.66 # stash this global.
73 self.dbus_service = None67 self.dbus_service = None
74 # Cache/overrides.68 # Cache.
75 self._device = None69 self._device = None
76 self._build_number = None70 self._build_number = None
71 self.build_number_override = False
77 self._channel = None72 self._channel = None
78 # This is used only to override the phased percentage via command line73 # This is used only to override the phased percentage via command line
79 # and the property setter.74 # and the property setter.
80 self._phase_override = None75 self._phase_override = None
81 self._tempdir = None76 self._tempdir = None
77 self.config_d = None
78 self.ini_files = []
79 self.http_base = None
80 self.https_base = None
81 if directory is not None:
82 self.load(directory)
83 self._calculate_http_bases()
82 self._resources = ExitStack()84 self._resources = ExitStack()
83 atexit.register(self._resources.close)85 atexit.register(self._resources.close)
8486
85 def load(self, path, *, override=False):87 def _set_defaults(self):
86 parser = ConfigParser()88 self.service = Bag(
87 files_read = parser.read(path)89 base='system-image.ubuntu.com',
88 if files_read != [path]:90 http_port=80,
91 https_port=443,
92 channel='daily',
93 build_number=0,
94 )
95 self.system = Bag(
96 timeout=as_timedelta('1h'),
97 tempdir='/tmp',
98 logfile='/var/log/system-image/client.log',
99 loglevel=as_loglevel('info'),
100 settings_db='/var/lib/system-image/settings.db',
101 )
102 self.gpg = Bag(
103 archive_master='/etc/system-image/archive-master.tar.xz',
104 image_master='/var/lib/system-image/keyrings/image-master.tar.xz',
105 image_signing=
106 '/var/lib/system-image/keyrings/image-signing.tar.xz',
107 device_signing=
108 '/var/lib/system-image/keyrings/device-signing.tar.xz',
109 )
110 self.updater = Bag(
111 cache_partition='/android/cache/recovery',
112 data_partition='/var/lib/system-image',
113 )
114 self.hooks = Bag(
115 device=as_object('systemimage.device.SystemProperty'),
116 scorer=as_object('systemimage.scores.WeightedScorer'),
117 reboot=as_object('systemimage.reboot.Reboot'),
118 )
119 self.dbus = Bag(
120 lifetime=as_timedelta('10m'),
121 )
122
123 def _load_file(self, path):
124 parser = SafeConfigParser()
125 str_path = str(path)
126 files_read = parser.read(str_path)
127 if files_read != [str_path]:
89 raise FileNotFoundError(path)128 raise FileNotFoundError(path)
90 self.config_file = path129 self.ini_files.append(path)
91 self.service.update(converters=dict(http_port=port_value_converter,130 self.service.update(converters=dict(http_port=as_port,
92 https_port=port_value_converter,131 https_port=as_port,
93 build_number=int,132 build_number=int,
94 device=device_converter,133 device=as_stripped,
95 ),134 ),
96 **parser['service'])135 **parser['service'])
97 if (self.service.http_port is DISABLED and136 self.system.update(converters=dict(timeout=as_timedelta,
98 self.service.https_port is DISABLED):137 loglevel=as_loglevel,
138 settings_db=expand_path,
139 tempdir=expand_path),
140 **parser['system'])
141 self.gpg.update(**parser['gpg'])
142 self.updater.update(**parser['updater'])
143 self.hooks.update(converters=dict(device=as_object,
144 scorer=as_object,
145 reboot=as_object),
146 **parser['hooks'])
147 self.dbus.update(converters=dict(lifetime=as_timedelta),
148 **parser['dbus'])
149
150 def load(self, directory):
151 """Load up the configuration from a config.d directory."""
152 # Look for all the files in the given directory with .ini or .cfg
153 # suffixes. The files must start with a number, and the files are
154 # loaded in numeric order.
155 if self.config_d is not None:
156 raise RuntimeError('Configuration already loaded; use .reload()')
157 self.config_d = directory
158 if not Path(directory).is_dir():
159 raise TypeError(
160 '.load() requires a directory: {}'.format(directory))
161 candidates = []
162 for child in Path(directory).glob('*.ini'):
163 order, _, base = child.stem.partition('_')
164 # XXX 2014-10-03: The logging system isn't initialized when we get
165 # here, so we can't log that these files are being ignored.
166 if len(_) == 0:
167 continue
168 try:
169 serial = int(order)
170 except ValueError:
171 continue
172 candidates.append((serial, child))
173 for serial, path in sorted(candidates):
174 self._load_file(path)
175 self._calculate_http_bases()
176
177 def reload(self):
178 """Reload the configuration directory."""
179 # Reset some cached attributes.
180 directory = self.config_d
181 self.ini_files = []
182 self.config_d = None
183 self._build_number = None
184 # Now load the defaults, then reload the previous config.d directory.
185 self._set_defaults()
186 self.load(directory)
187
188 def _calculate_http_bases(self):
189 if (self.service.http_port is NO_PORT and
190 self.service.https_port is NO_PORT):
99 raise ValueError('Cannot disable both http and https ports')191 raise ValueError('Cannot disable both http and https ports')
100 # Construct the HTTP and HTTPS base urls, which most applications will192 # Construct the HTTP and HTTPS base urls, which most applications will
101 # actually use. We do this in two steps, in order to support193 # actually use. We do this in two steps, in order to support disabling
102 # disabling one or the other (but not both) protocols.194 # one or the other (but not both) protocols.
103 if self.service.http_port == 80:195 if self.service.http_port == 80:
104 http_base = 'http://{}'.format(self.service.base)196 http_base = 'http://{}'.format(self.service.base)
105 elif self.service.http_port is DISABLED:197 elif self.service.http_port is NO_PORT:
106 http_base = None198 http_base = None
107 else:199 else:
108 http_base = 'http://{}:{}'.format(200 http_base = 'http://{}:{}'.format(
@@ -110,7 +202,7 @@
110 # HTTPS.202 # HTTPS.
111 if self.service.https_port == 443:203 if self.service.https_port == 443:
112 https_base = 'https://{}'.format(self.service.base)204 https_base = 'https://{}'.format(self.service.base)
113 elif self.service.https_port is DISABLED:205 elif self.service.https_port is NO_PORT:
114 https_base = None206 https_base = None
115 else:207 else:
116 https_base = 'https://{}:{}'.format(208 https_base = 'https://{}:{}'.format(
@@ -122,45 +214,13 @@
122 if https_base is None:214 if https_base is None:
123 assert http_base is not None215 assert http_base is not None
124 https_base = http_base216 https_base = http_base
125 self.service['http_base'] = http_base217 self.http_base = http_base
126 self.service['https_base'] = https_base218 self.https_base = https_base
127 try:
128 self.system.update(converters=dict(timeout=as_timedelta,
129 build_file=expand_path,
130 loglevel=as_loglevel,
131 settings_db=expand_path,
132 tempdir=expand_path),
133 **parser['system'])
134 except KeyError:
135 # If we're overriding via a channel.ini file, it's okay if the
136 # [system] section is missing. However, the main configuration
137 # ini file must include all sections.
138 if not override:
139 raise
140 # Short-circuit, since we're loading a channel.ini file.
141 self._override = override
142 if override:
143 return
144 self.gpg = Bag(**parser['gpg'])
145 self.updater = Bag(**parser['updater'])
146 self.hooks = Bag(converters=dict(device=as_object,
147 scorer=as_object,
148 reboot=as_object),
149 **parser['hooks'])
150 self.dbus = Bag(converters=dict(lifetime=as_timedelta),
151 **parser['dbus'])
152219
153 @property220 @property
154 def build_number(self):221 def build_number(self):
155 if self._build_number is None:222 if self._build_number is None:
156 if self._override:223 self._build_number = self.service.build_number
157 return self.service.build_number
158 else:
159 try:
160 with open(self.system.build_file, encoding='utf-8') as fp:
161 return int(fp.read().strip())
162 except FileNotFoundError:
163 return 0
164 return self._build_number224 return self._build_number
165225
166 @build_number.setter226 @build_number.setter
@@ -169,24 +229,18 @@
169 raise ValueError(229 raise ValueError(
170 'integer is required, got: {}'.format(type(value).__name__))230 'integer is required, got: {}'.format(type(value).__name__))
171 self._build_number = value231 self._build_number = value
232 self.build_number_override = True
172233
173 @build_number.deleter234 @build_number.deleter
174 def build_number(self):235 def build_number(self):
175 self._build_number = None236 self._build_number = None
176237
177 @property238 @property
178 def build_number_cli(self):
179 return self._build_number
180
181 @property
182 def device(self):239 def device(self):
183 if self._device is None:240 if self._device is None:
184 # Start by looking for a [service]device setting. Use this if it241 # Start by looking for a [service]device setting. Use this if it
185 # exists, otherwise fall back to calling the hook.242 # exists, otherwise fall back to calling the hook.
186 self._device = getattr(self.service, 'device', None)243 self._device = getattr(self.service, 'device', None)
187 # The key could exist in the channel.ini file, but its value could
188 # be empty. That's semantically equivalent to a missing
189 # [service]device setting.
190 if not self._device:244 if not self._device:
191 self._device = self.hooks.device().get_device()245 self._device = self.hooks.device().get_device()
192 return self._device246 return self._device
@@ -227,20 +281,8 @@
227 return self._tempdir281 return self._tempdir
228282
229283
230# Define the global configuration object. Normal use can be as simple as:284# Define the global configuration object. We use a proxy here so that
231#285# post-object creation loading will work.
232# from systemimage.config import config
233# build_file = config.system.build_file
234#
235# In the test suite though, the actual configuration object can be easily
236# patched by doing something like this:
237#
238# test_config = Configuration(...)
239# with unittest.mock.patch('config._config', test_config):
240# run_test()
241#
242# and now every module which does the first code example will get build_file
243# from the mocked Configuration instance.
244286
245_config = Configuration()287_config = Configuration()
246288
247289
=== removed file 'systemimage/data/client.ini'
--- systemimage/data/client.ini 2013-11-12 19:57:39 +0000
+++ systemimage/data/client.ini 1970-01-01 00:00:00 +0000
@@ -1,35 +0,0 @@
1# Default and example .ini configuration file.
2# Edit this and put it in /etc/system-image/client.ini
3
4[service]
5base: system-image.ubuntu.com
6http_port: 80
7https_port: 443
8channel: daily
9build_number: 0
10
11[system]
12timeout: 1h
13build_file: /etc/ubuntu-build
14tempdir: /tmp
15logfile: /var/log/system-image/client.log
16loglevel: info
17settings_db: /var/lib/system-image/settings.db
18
19[gpg]
20archive_master: /etc/system-image/archive-master.tar.xz
21image_master: /var/lib/system-image/keyrings/image-master.tar.xz
22image_signing: /var/lib/system-image/keyrings/image-signing.tar.xz
23device_signing: /var/lib/system-image/keyrings/device-signing.tar.xz
24
25[updater]
26cache_partition: /android/cache/recovery
27data_partition: /var/lib/system-image
28
29[hooks]
30device: systemimage.device.SystemProperty
31scorer: systemimage.scores.WeightedScorer
32reboot: systemimage.reboot.Reboot
33
34[dbus]
35lifetime: 10m
360
=== modified file 'systemimage/dbus.py'
--- systemimage/dbus.py 2014-10-30 20:47:36 +0000
+++ systemimage/dbus.py 2015-01-15 22:43:25 +0000
@@ -126,7 +126,7 @@
126 downloading,126 downloading,
127 self._update.version,127 self._update.version,
128 self._update.size,128 self._update.size,
129 self._update.last_update_date,129 last_update_date(),
130 self._update.error)130 self._update.error)
131 # Stop GLib from calling this method again.131 # Stop GLib from calling this method again.
132 return False132 return False
@@ -161,7 +161,7 @@
161 self._downloading,161 self._downloading,
162 self._update.version,162 self._update.version,
163 self._update.size,163 self._update.size,
164 self._update.last_update_date,164 last_update_date(),
165 "")165 "")
166 log.info('checking lock not acquired')166 log.info('checking lock not acquired')
167 return167 return
168168
=== modified file 'systemimage/helpers.py'
--- systemimage/helpers.py 2014-12-02 01:12:41 +0000
+++ systemimage/helpers.py 2015-01-15 22:43:25 +0000
@@ -20,6 +20,8 @@
20 'MiB',20 'MiB',
21 'as_loglevel',21 'as_loglevel',
22 'as_object',22 'as_object',
23 'as_port',
24 'as_stripped',
23 'as_timedelta',25 'as_timedelta',
24 'atomic',26 'atomic',
25 'calculate_signature',27 'calculate_signature',
@@ -50,6 +52,7 @@
50DEFAULT_DIRMODE = 0o0270052DEFAULT_DIRMODE = 0o02700
51MiB = 1 << 2053MiB = 1 << 20
52EMPTYSTRING = ''54EMPTYSTRING = ''
55NO_PORT = object()
5356
5457
55def calculate_signature(fp, hash_class=None):58def calculate_signature(fp, hash_class=None):
@@ -78,7 +81,7 @@
78 """Like os.remove() but don't complain if the file doesn't exist."""81 """Like os.remove() but don't complain if the file doesn't exist."""
79 try:82 try:
80 os.remove(path)83 os.remove(path)
81 except (FileNotFoundError, IsADirectoryError):84 except (FileNotFoundError, IsADirectoryError, PermissionError):
82 pass85 pass
8386
8487
@@ -194,13 +197,26 @@
194 dbus = 'ERROR'197 dbus = 'ERROR'
195 main_level = getattr(logging, main, None)198 main_level = getattr(logging, main, None)
196 if main_level is None or not isinstance(main_level, int):199 if main_level is None or not isinstance(main_level, int):
197 raise ValueError200 raise ValueError(value)
198 dbus_level = getattr(logging, dbus, None)201 dbus_level = getattr(logging, dbus, None)
199 if dbus_level is None or not isinstance(dbus_level, int):202 if dbus_level is None or not isinstance(dbus_level, int):
200 raise ValueError203 raise ValueError(value)
201 return main_level, dbus_level204 return main_level, dbus_level
202205
203206
207def as_port(value):
208 if value.lower() in ('disabled', 'disable'):
209 return NO_PORT
210 result = int(value)
211 if result < 0:
212 raise ValueError(value)
213 return result
214
215
216def as_stripped(value):
217 return value.strip()
218
219
204@contextmanager220@contextmanager
205def temporary_directory(*args, **kws):221def temporary_directory(*args, **kws):
206 """A context manager that creates a temporary directory.222 """A context manager that creates a temporary directory.
@@ -226,30 +242,24 @@
226def last_update_date():242def last_update_date():
227 """Return the last update date.243 """Return the last update date.
228244
229 Taken from the mtime of the following files, in order:245 If /userdata/.last_update exists, we use this file's mtime. If it doesn't
230246 exist, then we use the latest mtime of any of the files in
231 - /userdata/.last_update247 /etc/system-image/config.d/*.ini (or whatever directory was given with the
232 - /etc/system-image/channel.ini248 -C/--config option).
233 - /etc/ubuntu-build
234
235 First existing path wins.
236 """249 """
237 # Avoid circular imports.250 # Avoid circular imports.
238 from systemimage.config import config251 from systemimage.config import config
239 channel_ini = os.path.join(252 try:
240 os.path.dirname(config.config_file), 'channel.ini')253 timestamp = datetime.fromtimestamp(os.stat(LAST_UPDATE_FILE).st_mtime)
241 ubuntu_build = config.system.build_file254 except (FileNotFoundError, PermissionError):
242 for path in (LAST_UPDATE_FILE, channel_ini, ubuntu_build):255 # We fall back to the latest mtime of the config.d/*.ini files.
243 try:256 timestamps = sorted(
244 # Local time, since we can't know the timezone.257 datetime.fromtimestamp(path.stat().st_mtime)
245 timestamp = datetime.fromtimestamp(os.stat(path).st_mtime)258 for path in config.ini_files)
246 # Seconds resolution.259 if len(timestamps) == 0:
247 timestamp = timestamp.replace(microsecond=0)260 return 'Unknown'
248 return str(timestamp)261 timestamp = timestamps[-1]
249 except (FileNotFoundError, PermissionError):262 return str(timestamp.replace(microsecond=0))
250 pass
251 else:
252 return 'Unknown'
253263
254264
255def version_detail(details_string=None):265def version_detail(details_string=None):
256266
=== modified file 'systemimage/keyring.py'
--- systemimage/keyring.py 2014-09-26 09:32:29 +0000
+++ systemimage/keyring.py 2015-01-15 22:43:25 +0000
@@ -86,8 +86,8 @@
86 else:86 else:
87 srcurl = urls87 srcurl = urls
88 ascurl = urls + '.asc'88 ascurl = urls + '.asc'
89 tarxz_src = urljoin(config.service.https_base, srcurl)89 tarxz_src = urljoin(config.https_base, srcurl)
90 ascxz_src = urljoin(config.service.https_base, ascurl)90 ascxz_src = urljoin(config.https_base, ascurl)
91 # Calculate the local paths to the temporary download files. The91 # Calculate the local paths to the temporary download files. The
92 # blacklist goes to the data partition and all the other files go to the92 # blacklist goes to the data partition and all the other files go to the
93 # cache partition.93 # cache partition.
9494
=== modified file 'systemimage/main.py'
--- systemimage/main.py 2014-10-25 01:12:08 +0000
+++ systemimage/main.py 2015-01-15 22:43:25 +0000
@@ -21,7 +21,6 @@
21 ]21 ]
2222
2323
24import os
25import sys24import sys
26import logging25import logging
27import argparse26import argparse
@@ -42,12 +41,11 @@
42__version__ = resource_bytes(41__version__ = resource_bytes(
43 'systemimage', 'version.txt').decode('utf-8').strip()42 'systemimage', 'version.txt').decode('utf-8').strip()
4443
45DEFAULT_CONFIG_FILE = '/etc/system-image/client.ini'44DEFAULT_CONFIG_D = '/etc/system-image/config.d'
46COLON = ':'45COLON = ':'
4746
4847
49def main():48def main():
50 global config
51 parser = argparse.ArgumentParser(49 parser = argparse.ArgumentParser(
52 prog='system-image-cli',50 prog='system-image-cli',
53 description='Ubuntu System Image Upgrader')51 description='Ubuntu System Image Upgrader')
@@ -55,7 +53,7 @@
55 action='version',53 action='version',
56 version='system-image-cli {}'.format(__version__))54 version='system-image-cli {}'.format(__version__))
57 parser.add_argument('-C', '--config',55 parser.add_argument('-C', '--config',
58 default=DEFAULT_CONFIG_FILE, action='store',56 default=DEFAULT_CONFIG_D, action='store',
59 metavar='FILE',57 metavar='FILE',
60 help="""Use the given configuration file instead of58 help="""Use the given configuration file instead of
61 the default""")59 the default""")
@@ -137,16 +135,10 @@
137 args = parser.parse_args(sys.argv[1:])135 args = parser.parse_args(sys.argv[1:])
138 try:136 try:
139 config.load(args.config)137 config.load(args.config)
140 except FileNotFoundError as error:138 except (TypeError, FileNotFoundError):
141 parser.error('\nConfiguration file not found: {}'.format(error))139 parser.error('\nConfiguration directory not found: {}'.format(
140 args.config))
142 assert 'parser.error() does not return' # pragma: no cover141 assert 'parser.error() does not return' # pragma: no cover
143 # Load the optional channel.ini file, which must live next to the
144 # configuration file. It's okay if this file does not exist.
145 channel_ini = os.path.join(os.path.dirname(args.config), 'channel.ini')
146 try:
147 config.load(channel_ini, override=True)
148 except FileNotFoundError:
149 pass
150142
151 # Perform a factory reset.143 # Perform a factory reset.
152 if args.factory_reset:144 if args.factory_reset:
153145
=== modified file 'systemimage/scores.py'
--- systemimage/scores.py 2014-10-25 01:12:08 +0000
+++ systemimage/scores.py 2015-01-15 22:43:25 +0000
@@ -53,6 +53,7 @@
53 :rtype: list53 :rtype: list
54 """54 """
55 if len(candidates) == 0:55 if len(candidates) == 0:
56 log.debug('No candidates, so no winner')
56 return []57 return []
57 # We want to zip together the score for each candidate path, plus the58 # We want to zip together the score for each candidate path, plus the
58 # candidate path, so that when we sort the sequence, we'll always get59 # candidate path, so that when we sort the sequence, we'll always get
5960
=== modified file 'systemimage/service.py'
--- systemimage/service.py 2014-10-17 16:10:07 +0000
+++ systemimage/service.py 2015-01-15 22:43:25 +0000
@@ -20,7 +20,6 @@
20 ]20 ]
2121
2222
23import os
24import sys23import sys
25import dbus24import dbus
26import logging25import logging
@@ -33,7 +32,8 @@
33from systemimage.dbus import Loop32from systemimage.dbus import Loop
34from systemimage.helpers import makedirs33from systemimage.helpers import makedirs
35from systemimage.logging import initialize34from systemimage.logging import initialize
36from systemimage.main import DEFAULT_CONFIG_FILE35from systemimage.main import DEFAULT_CONFIG_D
36
3737
38# --testing is only enabled when the systemimage.testing package is38# --testing is only enabled when the systemimage.testing package is
39# available. This will be the case for the upstream source package, and when39# available. This will be the case for the upstream source package, and when
@@ -60,7 +60,7 @@
60 action='version',60 action='version',
61 version='system-image-dbus {}'.format(__version__))61 version='system-image-dbus {}'.format(__version__))
62 parser.add_argument('-C', '--config',62 parser.add_argument('-C', '--config',
63 default=DEFAULT_CONFIG_FILE, action='store',63 default=DEFAULT_CONFIG_D, action='store',
64 metavar='FILE',64 metavar='FILE',
65 help="""Use the given configuration file instead of65 help="""Use the given configuration file instead of
66 the default""")66 the default""")
@@ -80,15 +80,8 @@
80 try:80 try:
81 config.load(args.config)81 config.load(args.config)
82 except FileNotFoundError as error:82 except FileNotFoundError as error:
83 parser.error('\nConfiguration file not found: {}'.format(error))83 parser.error('\nConfiguration directory not found: {}'.format(error))
84 assert 'parser.error() does not return' # pragma: no cover84 assert 'parser.error() does not return' # pragma: no cover
85 # Load the optional channel.ini file, which must live next to the
86 # configuration file. It's okay if this file does not exist.
87 channel_ini = os.path.join(os.path.dirname(args.config), 'channel.ini')
88 try:
89 config.load(channel_ini, override=True)
90 except FileNotFoundError:
91 pass
9285
93 # Create the temporary directory if it doesn't exist.86 # Create the temporary directory if it doesn't exist.
94 makedirs(config.system.tempdir)87 makedirs(config.system.tempdir)
@@ -121,6 +114,7 @@
121 else:114 else:
122 from systemimage.dbus import Service115 from systemimage.dbus import Service
123 config.dbus_service = Service(system_bus, '/Service', loop)116 config.dbus_service = Service(system_bus, '/Service', loop)
117
124 try:118 try:
125 loop.run()119 loop.run()
126 except KeyboardInterrupt: # pragma: no cover120 except KeyboardInterrupt: # pragma: no cover
127121
=== modified file 'systemimage/state.py'
--- systemimage/state.py 2014-11-05 14:59:14 +0000
+++ systemimage/state.py 2015-01-15 22:43:25 +0000
@@ -214,7 +214,7 @@
214 # I think it makes no sense to check the blacklist when we're214 # I think it makes no sense to check the blacklist when we're
215 # downloading a blacklist file.215 # downloading a blacklist file.
216 log.info('Looking for blacklist: {}'.format(216 log.info('Looking for blacklist: {}'.format(
217 urljoin(config.service.https_base, url)))217 urljoin(config.https_base, url)))
218 get_keyring('blacklist', url, 'image-master')218 get_keyring('blacklist', url, 'image-master')
219 except SignatureError:219 except SignatureError:
220 log.exception('No signed blacklist found')220 log.exception('No signed blacklist found')
@@ -250,7 +250,7 @@
250 url = 'gpg/blacklist.tar.xz'250 url = 'gpg/blacklist.tar.xz'
251 try:251 try:
252 log.info('Looking for blacklist again: {}',252 log.info('Looking for blacklist again: {}',
253 urljoin(config.service.https_base, url))253 urljoin(config.https_base, url))
254 get_keyring('blacklist', url, 'image-master')254 get_keyring('blacklist', url, 'image-master')
255 except FileNotFoundError:255 except FileNotFoundError:
256 log.info('No blacklist found on second attempt')256 log.info('No blacklist found on second attempt')
@@ -276,9 +276,9 @@
276 get_keyring(276 get_keyring(
277 'image-signing', 'gpg/image-signing.tar.xz', 'image-master',277 'image-signing', 'gpg/image-signing.tar.xz', 'image-master',
278 self.blacklist)278 self.blacklist)
279 channels_url = urljoin(config.service.https_base, 'channels.json')279 channels_url = urljoin(config.https_base, 'channels.json')
280 channels_path = os.path.join(config.tempdir, 'channels.json')280 channels_path = os.path.join(config.tempdir, 'channels.json')
281 asc_url = urljoin(config.service.https_base, 'channels.json.asc')281 asc_url = urljoin(config.https_base, 'channels.json.asc')
282 asc_path = os.path.join(config.tempdir, 'channels.json.asc')282 asc_path = os.path.join(config.tempdir, 'channels.json.asc')
283 log.info('Looking for: {}', channels_url)283 log.info('Looking for: {}', channels_url)
284 with ExitStack() as stack:284 with ExitStack() as stack:
@@ -332,8 +332,8 @@
332 self._next.append(partial(self._get_index, device.index))332 self._next.append(partial(self._get_index, device.index))
333333
334 def _get_device_keyring(self, keyring):334 def _get_device_keyring(self, keyring):
335 keyring_url = urljoin(config.service.https_base, keyring.path)335 keyring_url = urljoin(config.https_base, keyring.path)
336 asc_url = urljoin(config.service.https_base, keyring.signature)336 asc_url = urljoin(config.https_base, keyring.signature)
337 log.info('getting device keyring: {}', keyring_url)337 log.info('getting device keyring: {}', keyring_url)
338 get_keyring(338 get_keyring(
339 'device-signing', (keyring_url, asc_url), 'image-signing',339 'device-signing', (keyring_url, asc_url), 'image-signing',
@@ -381,7 +381,7 @@
381381
382 def _get_index(self, index):382 def _get_index(self, index):
383 """Get and verify the index.json file."""383 """Get and verify the index.json file."""
384 index_url = urljoin(config.service.https_base, index)384 index_url = urljoin(config.https_base, index)
385 asc_url = index_url + '.asc'385 asc_url = index_url + '.asc'
386 index_path = os.path.join(config.tempdir, 'index.json')386 index_path = os.path.join(config.tempdir, 'index.json')
387 asc_path = index_path + '.asc'387 asc_path = index_path + '.asc'
@@ -413,7 +413,7 @@
413 # winner. Otherwise, trust the configured build number.413 # winner. Otherwise, trust the configured build number.
414 channel = self.channels[config.channel]414 channel = self.channels[config.channel]
415 # channel_target is the channel we're on based on the alias mapping in415 # channel_target is the channel we're on based on the alias mapping in
416 # our channel.ini file. channel_alias is the alias mapping in the416 # our config files. channel_alias is the alias mapping in the
417 # channel.json file, i.e. the channel an update will put us on.417 # channel.json file, i.e. the channel an update will put us on.
418 channel_target = getattr(config.service, 'channel_target', None)418 channel_target = getattr(config.service, 'channel_target', None)
419 channel_alias = getattr(channel, 'alias', None)419 channel_alias = getattr(channel, 'alias', None)
@@ -421,14 +421,17 @@
421 channel_target is None or421 channel_target is None or
422 channel_alias == channel_target):422 channel_alias == channel_target):
423 build_number = config.build_number423 build_number = config.build_number
424 elif config.build_number_cli is not None:
425 # An explicit --build on the command line still takes precedence.
426 build_number = config.build_number_cli
427 else:424 else:
428 # This is a channel switch caused by a new alias.425 # This is a channel switch caused by a new alias. Unless the
429 build_number = 0426 # build number has been explicitly overridden on the command line
427 # via --build/-b, use build number 0 to force a full update.
428 build_number = (config.build_number
429 if config.build_number_override
430 else 0)
430 self.channel_switch = (channel_target, channel_alias)431 self.channel_switch = (channel_target, channel_alias)
431 candidates = get_candidates(self.index, build_number)432 candidates = get_candidates(self.index, build_number)
433 log.debug('Candidates from build# {}: {}'.format(
434 build_number, len(candidates)))
432 if self._filter is not None:435 if self._filter is not None:
433 candidates = self._filter(candidates)436 candidates = self._filter(candidates)
434 self.winner = config.hooks.scorer().choose(437 self.winner = config.hooks.scorer().choose(
@@ -480,11 +483,11 @@
480 else:483 else:
481 # Add the data file, which has a checksum.484 # Add the data file, which has a checksum.
482 downloads.append(Record(485 downloads.append(Record(
483 urljoin(config.service.http_base, filerec.path),486 urljoin(config.http_base, filerec.path),
484 dst, checksum))487 dst, checksum))
485 # Add the signature file, which does not have a checksum.488 # Add the signature file, which does not have a checksum.
486 downloads.append(Record(489 downloads.append(Record(
487 urljoin(config.service.http_base, filerec.signature),490 urljoin(config.http_base, filerec.signature),
488 asc))491 asc))
489 signatures.append((dst, asc))492 signatures.append((dst, asc))
490 checksums.append((dst, checksum))493 checksums.append((dst, checksum))
491494
=== modified file 'systemimage/testing/controller.py'
--- systemimage/testing/controller.py 2015-01-13 15:20:40 +0000
+++ systemimage/testing/controller.py 2015-01-15 22:43:25 +0000
@@ -35,7 +35,7 @@
35from pkg_resources import resource_string as resource_bytes35from pkg_resources import resource_string as resource_bytes
36from systemimage.helpers import temporary_directory36from systemimage.helpers import temporary_directory
37from systemimage.testing.helpers import (37from systemimage.testing.helpers import (
38 data_path, find_dbus_process, reset_envar)38 data_path, find_dbus_process, makedirs, reset_envar)
39from unittest.mock import patch39from unittest.mock import patch
4040
4141
@@ -148,7 +148,6 @@
148 # Public.148 # Public.
149 self.tmpdir = self._stack.enter_context(temporary_directory())149 self.tmpdir = self._stack.enter_context(temporary_directory())
150 self.config_path = os.path.join(self.tmpdir, 'dbus-system.conf')150 self.config_path = os.path.join(self.tmpdir, 'dbus-system.conf')
151 self.ini_path = None
152 self.serverdir = self._stack.enter_context(temporary_directory())151 self.serverdir = self._stack.enter_context(temporary_directory())
153 self.daemon_pid = None152 self.daemon_pid = None
154 self.mode = 'live'153 self.mode = 'live'
@@ -169,10 +168,12 @@
169 ini_logfile = (os.path.join(ini_tmpdir, 'client.log')168 ini_logfile = (os.path.join(ini_tmpdir, 'client.log')
170 if logfile is None169 if logfile is None
171 else logfile)170 else logfile)
172 self.ini_path = os.path.join(self.tmpdir, 'client.ini')171 self.ini_path = os.path.join(self.tmpdir, 'config.d')
172 makedirs(self.ini_path)
173 template = resource_bytes(173 template = resource_bytes(
174 'systemimage.tests.data', 'config_03.ini').decode('utf-8')174 'systemimage.tests.data', '01.ini').decode('utf-8')
175 with open(self.ini_path, 'w', encoding='utf-8') as fp:175 defaults = os.path.join(self.ini_path, '00_defaults.ini')
176 with open(defaults, 'w', encoding='utf-8') as fp:
176 print(template.format(tmpdir=ini_tmpdir,177 print(template.format(tmpdir=ini_tmpdir,
177 vardir=ini_vardir,178 vardir=ini_vardir,
178 logfile=ini_logfile,179 logfile=ini_logfile,
@@ -245,7 +246,7 @@
245 daemon_exe,246 daemon_exe,
246 #'/usr/lib/x86_64-linux-gnu/dbus-1.0/debug-build/bin/dbus-daemon',247 #'/usr/lib/x86_64-linux-gnu/dbus-1.0/debug-build/bin/dbus-daemon',
247 '--fork',248 '--fork',
248 '--config-file=' + self.config_path,249 '--config-file=' + str(self.config_path),
249 # Return the address and pid on stdout.250 # Return the address and pid on stdout.
250 '--print-address=1',251 '--print-address=1',
251 '--print-pid=1',252 '--print-pid=1',
252253
=== modified file 'systemimage/testing/dbus.py'
--- systemimage/testing/dbus.py 2014-10-17 16:10:07 +0000
+++ systemimage/testing/dbus.py 2015-01-15 22:43:25 +0000
@@ -71,6 +71,7 @@
71 @log_and_exit71 @log_and_exit
72 @method('com.canonical.SystemImage')72 @method('com.canonical.SystemImage')
73 def Reset(self):73 def Reset(self):
74 config.reload()
74 self._api = Mediator()75 self._api = Mediator()
75 try:76 try:
76 self._checking.release()77 self._checking.release()
7778
=== modified file 'systemimage/testing/helpers.py'
--- systemimage/testing/helpers.py 2014-11-05 14:59:14 +0000
+++ systemimage/testing/helpers.py 2015-01-15 22:43:25 +0000
@@ -49,7 +49,7 @@
49import unittest49import unittest
5050
51from contextlib import ExitStack, contextmanager, suppress51from contextlib import ExitStack, contextmanager, suppress
52from functools import partial, wraps52from functools import partial, partialmethod, wraps
53from http.server import HTTPServer, SimpleHTTPRequestHandler53from http.server import HTTPServer, SimpleHTTPRequestHandler
54from pathlib import Path54from pathlib import Path
55from pkg_resources import resource_filename, resource_string as resource_bytes55from pkg_resources import resource_filename, resource_string as resource_bytes
@@ -58,7 +58,6 @@
58from systemimage.config import Configuration, config58from systemimage.config import Configuration, config
59from systemimage.helpers import MiB, atomic, makedirs, temporary_directory59from systemimage.helpers import MiB, atomic, makedirs, temporary_directory
60from systemimage.index import Index60from systemimage.index import Index
61from systemimage.state import State
62from threading import Thread61from threading import Thread
63from unittest.mock import patch62from unittest.mock import patch
6463
@@ -208,47 +207,98 @@
208 return resources.pop_all()207 return resources.pop_all()
209208
210209
211def configuration(function):210# This defines the @configuration decorator used in various test suites to
212 """Decorator that produces a temporary configuration for testing.211# create a temporary config.d/ directory for a test. This is all fairly
213212# complicated, but here's what's going on.
214 The config_00.ini template is copied to a temporary file and the the213#
215 various file system locations are filled in with the location for a,214# The _wrapper() function is the inner part of the decorator, and it does the
216 er, temporary temporary directory. This temporary configuration215# heart of the operation, which is to create a temporary directory for
217 file is loaded up and the global configuration object is patched so216# config.d, along with temporary var and tmp directories. These latter two
218 that all other code will see it instead of the default global217# will be interpolated into any configuration file copied into config.d.
219 configuration object.218#
220219# The outer decorator function differs depending on whether @configuration was
221 Everything is properly cleaned up after the test method exits.220# given without arguments, or called with arguments at the time of the
222 """221# function definition.
223 @wraps(function)222#
224 def wrapper(*args, **kws):223# In the former case, e.g.
225 with ExitStack() as resources:224#
226 etc_dir = resources.enter_context(temporary_directory())225# @configuration
227 ini_file = os.path.join(etc_dir, 'client.ini')226# def test_something(self):
228 temp_tmpdir = resources.enter_context(temporary_directory())227#
229 temp_vardir = resources.enter_context(temporary_directory())228# The default 00.ini file is interpolated and copied into config.d. Simple.
229#
230# In the latter case, e.g.
231#
232# @configuration('some-config.ini')
233# def test_something(self):
234#
235# There's actually another level of interior function, because the outer
236# decorator itself is getting called. Here, any named configuration file is
237# additionally copied to the config.d directory, renaming it sequentionally to
238# something like 01_override.ini, with the numeric part incrementing
239# monotonically.
240#
241# The implementation is tricky because we want the call sites to be simple.
242def _wrapper(self, function, ini_files, *args, **kws):
243 start = 0
244 with ExitStack() as resources:
245 # Create the config.d directory and copy all the source ini files to
246 # this directory in sequential order, interpolating in the temporary
247 # tmp and var directories.
248 config_d = resources.enter_context(temporary_directory())
249 temp_tmpdir = resources.enter_context(temporary_directory())
250 temp_vardir = resources.enter_context(temporary_directory())
251 for ini_file in ini_files:
252 dst = os.path.join(config_d, '{:02d}_override.ini'.format(start))
253 start += 1
230 template = resource_bytes(254 template = resource_bytes(
231 'systemimage.tests.data', 'config_00.ini').decode('utf-8')255 'systemimage.tests.data', ini_file).decode('utf-8')
232 with atomic(ini_file) as fp:256 with atomic(dst) as fp:
233 print(template.format(tmpdir=temp_tmpdir,257 print(template.format(tmpdir=temp_tmpdir,
234 vardir=temp_vardir), file=fp)258 vardir=temp_vardir), file=fp)
235 config = Configuration(ini_file)259 # Patch the global configuration object so that it can be used
236 resources.enter_context(260 # directly, which is good enough in most cases. Also patch the bit of
237 patch('systemimage.config._config', config))261 # code that detects the device name.
238 resources.enter_context(262 config = Configuration(config_d)
239 patch('systemimage.device.check_output',263 resources.enter_context(
240 return_value='nexus7'))264 patch('systemimage.config._config', config))
241 # Make sure the cache_partition and data_partition exist.265 resources.enter_context(
242 makedirs(config.updater.cache_partition)266 patch('systemimage.device.check_output',
243 makedirs(config.updater.data_partition)267 return_value='nexus7'))
244 # The method under test is allowed to specify some additional268 # Make sure the cache_partition and data_partition exist.
245 # keyword arguments, in order to pass some variables in from the269 makedirs(config.updater.cache_partition)
246 # wrapper.270 makedirs(config.updater.data_partition)
247 signature = inspect.signature(function)271 # The method under test is allowed to specify some additional
248 if 'ini_file' in signature.parameters:272 # keyword arguments, in order to pass some variables in from the
249 kws['ini_file'] = ini_file273 # wrapper.
250 return function(*args, **kws)274 signature = inspect.signature(function)
251 return wrapper275 if 'config_d' in signature.parameters:
276 kws['config_d'] = config_d
277 if 'config' in signature.parameters:
278 kws['config'] = config
279 # Call the function with the given arguments and return the result.
280 return function(self, *args, **kws)
281
282
283def configuration(*args):
284 """Outer decorator which can be called or not at function definition time.
285
286 If called, the arguments are positional only, and name the test data .ini
287 files which are to be copied to config.d directory. If none are given,
288 then 00.ini is used.
289 """
290 if len(args) == 1 and callable(args[0]):
291 # We assume this was the bare @configuration decorator flavor.
292 function = args[0]
293 inner = partialmethod(_wrapper, function, ('00.ini',))
294 return wraps(function)(inner)
295 else:
296 # We assume this was the called @configuration(...) decorator flavor,
297 # so create the actual decorator that wraps the _wrapper function.
298 def decorator(function):
299 inner = partialmethod(_wrapper, function, args)
300 return wraps(function)(inner)
301 return decorator
252302
253303
254def sign(filename, pubkey_ring):304def sign(filename, pubkey_ring):
@@ -259,6 +309,8 @@
259 with. This keyring must contain only one key, and its key id must309 with. This keyring must contain only one key, and its key id must
260 exist in the master secret keyring.310 exist in the master secret keyring.
261 """311 """
312 # filename could be a Path object. For now, just str-ify it.
313 filename = str(filename)
262 with ExitStack() as resources:314 with ExitStack() as resources:
263 home = resources.enter_context(temporary_directory())315 home = resources.enter_context(temporary_directory())
264 secring = data_path('master-secring.gpg')316 secring = data_path('master-secring.gpg')
@@ -278,7 +330,7 @@
278330
279def copy(filename, todir, dst=None):331def copy(filename, todir, dst=None):
280 src = data_path(filename)332 src = data_path(filename)
281 dst = os.path.join(todir, filename if dst is None else dst)333 dst = os.path.join(str(todir), filename if dst is None else dst)
282 makedirs(os.path.dirname(dst))334 makedirs(os.path.dirname(dst))
283 shutil.copy(src, dst)335 shutil.copy(src, dst)
284336
@@ -405,21 +457,24 @@
405 os.chmod(path, old_mode)457 os.chmod(path, old_mode)
406458
407459
408def touch_build(version, timestamp=None):460def touch_build(version, timestamp=None, use_config=None):
409 # LP: #1220238 - assert that no old-style version numbers are being used.461 # LP: #1220238 - assert that no old-style version numbers are being used.
410 assert 0 <= version < (1 << 16), (462 assert 0 <= version < (1 << 16), (
411 'old style version number: {}'.format(version))463 'Old style version number: {}'.format(version))
412 with open(config.system.build_file, 'w', encoding='utf-8') as fp:464 if use_config is None:
413 print(version, file=fp)465 use_config = config
466 override = Path(use_config.config_d) / '99_build.ini'
467 with override.open('wt', encoding='utf-8') as fp:
468 print("""\
469[service]
470build_number: {}
471""".format(version), file=fp)
472 # We have to touch the mtimes for all the files in the config directory.
414 if timestamp is not None:473 if timestamp is not None:
415 timestamp = int(timestamp)474 timestamp = int(timestamp)
416 os.utime(config.system.build_file, (timestamp, timestamp))475 for path in Path(use_config.config_d).iterdir():
417 channel_ini = os.path.join(476 os.utime(str(path), (timestamp, timestamp))
418 os.path.dirname(config.config_file), 'channel.ini')477 use_config.reload()
419 try:
420 os.utime(channel_ini, (timestamp, timestamp))
421 except FileNotFoundError:
422 pass
423478
424479
425def write_bytes(path, size_in_mib):480def write_bytes(path, size_in_mib):
@@ -497,6 +552,8 @@
497 SystemImagePlugin.controller.set_mode(cert_pem='cert.pem')552 SystemImagePlugin.controller.set_mode(cert_pem='cert.pem')
498553
499 def setUp(self):554 def setUp(self):
555 # Avoid circular imports.
556 from systemimage.state import State
500 self._resources = ExitStack()557 self._resources = ExitStack()
501 self._state = State()558 self._state = State()
502 try:559 try:
503560
=== modified file 'systemimage/testing/nose.py'
--- systemimage/testing/nose.py 2014-09-17 22:34:27 +0000
+++ systemimage/testing/nose.py 2015-01-15 22:43:25 +0000
@@ -90,7 +90,7 @@
90 'Set the log file for the test run',90 'Set the log file for the test run',
91 nargs=1)91 nargs=1)
92 def set_dbus_loglevel(level):92 def set_dbus_loglevel(level):
93 self.log_level = 'info:{}'.format(level[0])93 self.log_level = level[0]
94 self.addOption(set_dbus_loglevel, 'M', 'loglevel',94 self.addOption(set_dbus_loglevel, 'M', 'loglevel',
95 'Set the systemimage.dbus log level',95 'Set the systemimage.dbus log level',
96 nargs=1)96 nargs=1)
@@ -149,3 +149,8 @@
149 ## from systemimage.testing.helpers import debug149 ## from systemimage.testing.helpers import debug
150 ## with debug() as dlog:150 ## with debug() as dlog:
151 ## dlog('^^^^^', event.test)151 ## dlog('^^^^^', event.test)
152
153 def describeTest(self, event):
154 # This is fucked up.
155 if 'partial' in event.description:
156 event.description = event.description[:-73]
152157
=== renamed file 'systemimage/tests/data/config_00.ini' => 'systemimage/tests/data/00.ini'
--- systemimage/tests/data/config_00.ini 2013-11-12 19:57:39 +0000
+++ systemimage/tests/data/00.ini 2015-01-15 22:43:25 +0000
@@ -12,7 +12,6 @@
1212
13[system]13[system]
14timeout: 1s14timeout: 1s
15build_file: {tmpdir}/ubuntu-build
16tempdir: {tmpdir}/tmp15tempdir: {tmpdir}/tmp
17logfile: {tmpdir}/client.log16logfile: {tmpdir}/client.log
18loglevel: info17loglevel: info
1918
=== renamed file 'systemimage/tests/data/config_03.ini' => 'systemimage/tests/data/01.ini'
--- systemimage/tests/data/config_03.ini 2014-09-11 18:12:50 +0000
+++ systemimage/tests/data/01.ini 2015-01-15 22:43:25 +0000
@@ -12,7 +12,6 @@
1212
13[system]13[system]
14timeout: 1s14timeout: 1s
15build_file: {tmpdir}/ubuntu-build
16tempdir: {tmpdir}/tmp15tempdir: {tmpdir}/tmp
17logfile: {logfile}16logfile: {logfile}
18loglevel: {loglevel}17loglevel: {loglevel}
1918
=== added file 'systemimage/tests/data/api.channels_01.json'
--- systemimage/tests/data/api.channels_01.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/api.channels_01.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,13 @@
1{
2 "stable": {
3 "devices": {
4 "nexus7": {
5 "index": "/stable/nexus7/index.json",
6 "keyring": {
7 "path": "/stable/nexus7/device-signing.tar.xz",
8 "signature": "/stable/nexus7/device-signing.tar.xz.asc"
9 }
10 }
11 }
12 }
13}
014
=== added file 'systemimage/tests/data/api.index_01.json'
--- systemimage/tests/data/api.index_01.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/api.index_01.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,36 @@
1{
2 "global": {
3 "generated_at": "Thu Aug 01 08:01:00 UTC 2013"
4 },
5 "images": [
6 {
7 "description": "Full",
8 "files": [
9 {
10 "checksum": "da70dfa4d9f95ac979f921e8e623358236313f334afcd06cddf8a5621cf6a1e9",
11 "order": 3,
12 "path": "/3/4/5.txt",
13 "signature": "/3/4/5.txt.asc",
14 "size": 104857600
15 },
16 {
17 "checksum": "b3a8e0e1f9ab1bfe3a36f231f676f78bb30a519d2b21e6c530c0eee8ebb4a5d0",
18 "order": 1,
19 "path": "/4/5/6.txt",
20 "signature": "/4/5/6.txt.asc",
21 "size": 104857600
22 },
23 {
24 "checksum": "97a6d21df7c51e8289ac1a8c026aaac143e15aa1957f54f42e30d8f8a85c3a55",
25 "order": 2,
26 "path": "/5/6/7.txt",
27 "signature": "/5/6/7.txt.asc",
28 "size": 104857600
29 }
30 ],
31 "type": "full",
32 "version": 1600,
33 "bootme": true
34 }
35 ]
36}
037
=== added file 'systemimage/tests/data/api.index_02.json'
--- systemimage/tests/data/api.index_02.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/api.index_02.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,251 @@
1{
2 "global": {
3 "generated_at": "Mon Apr 29 18:45:27 UTC 2013"
4 },
5 "images": [
6 {
7 "bootme": true,
8 "description": "Full A",
9 "files": [
10 {
11 "checksum": "abc",
12 "order": 1,
13 "path": "/a/b/c.txt",
14 "signature": "/a/b/c.txt.asc",
15 "size": 104857600
16
17 },
18 {
19 "checksum": "bcd",
20 "order": 1,
21 "path": "/b/c/d.txt",
22 "signature": "/b/c/d.txt.asc",
23 "size": 104857600
24 },
25 {
26 "checksum": "cde",
27 "order": 1,
28 "path": "/c/d/e.txt",
29 "signature": "/c/d/e.txt.asc",
30 "size": 104857600
31 }
32 ],
33 "type": "full",
34 "version": 1300
35 },
36 {
37 "base": 1300,
38 "bootme": true,
39 "description": "Delta A.1",
40 "files": [
41 {
42 "checksum": "def",
43 "order": 1,
44 "path": "/d/e/f.txt",
45 "signature": "/d/e/f.txt.asc",
46 "size": 104857600
47 },
48 {
49 "checksum": "ef0",
50 "order": 1,
51 "path": "/e/f/0.txt",
52 "signature": "/e/f/0.txt.asc",
53 "size": 104857600
54 },
55 {
56 "checksum": "f01",
57 "order": 1,
58 "path": "/f/e/1.txt",
59 "signature": "/f/e/1.txt.asc",
60 "size": 104857600
61 }
62 ],
63 "type": "delta",
64 "version": 1301
65 },
66 {
67 "base": 1301,
68 "bootme": true,
69 "description": "Delta A.2",
70 "files": [
71 {
72 "checksum": "012",
73 "order": 1,
74 "path": "/0/1/2.txt",
75 "signature": "/0/1/2.txt.asc",
76 "size": 104857600
77 },
78 {
79 "checksum": "123",
80 "order": 1,
81 "path": "/1/2/3.txt",
82 "signature": "/1/2/3.txt.asc",
83 "size": 104857600
84 },
85 {
86 "checksum": "234",
87 "order": 1,
88 "path": "/2/3/4.txt",
89 "signature": "/2/3/4.txt.asc",
90 "size": 104857600
91 }
92 ],
93 "type": "delta",
94 "version": 1304
95 },
96
97 {
98 "description": "Full B",
99 "description-en": "The full B",
100 "files": [
101 {
102 "checksum": "da70dfa4d9f95ac979f921e8e623358236313f334afcd06cddf8a5621cf6a1e9",
103 "order": 1,
104 "path": "/3/4/5.txt",
105 "signature": "/3/4/5.txt.asc",
106 "size": 10000
107 },
108 {
109 "checksum": "b3a8e0e1f9ab1bfe3a36f231f676f78bb30a519d2b21e6c530c0eee8ebb4a5d0",
110 "order": 1,
111 "path": "/4/5/6.txt",
112 "signature": "/4/5/6.txt.asc",
113 "size": 10001
114 },
115 {
116 "checksum": "97a6d21df7c51e8289ac1a8c026aaac143e15aa1957f54f42e30d8f8a85c3a55",
117 "order": 1,
118 "path": "/5/6/7.txt",
119 "signature": "/5/6/7.txt.asc",
120 "size": 10002
121 }
122 ],
123 "type": "full",
124 "version": 1200
125 },
126 {
127 "base": 1200,
128 "description": "Delta B.1",
129 "description-en_US": "This is the delta B.1",
130 "description-xx": "XX This is the delta B.1",
131 "description-yy": "YY This is the delta B.1",
132 "description-yy_ZZ": "YY-ZZ This is the delta B.1",
133 "files": [
134 {
135 "checksum": "cebe3d9d614ba5c19f633566104315854a11353a333bf96f16b5afa0e90abdc4",
136 "order": 1,
137 "path": "/6/7/8.txt",
138 "signature": "/6/7/8.txt.asc",
139 "size": 20000
140 },
141 {
142 "checksum": "35a9e381b1a27567549b5f8a6f783c167ebf809f1c4d6a9e367240484d8ce281",
143 "order": 1,
144 "path": "/7/8/9.txt",
145 "signature": "/7/8/9.txt.asc",
146 "size": 20001
147 },
148 {
149 "checksum": "6bd6c3f7808391e8b74f5c2d58810809eda5c134aaa7f1b27ddf4b445c421ac5",
150 "order": 1,
151 "path": "/8/9/a.txt",
152 "signature": "/8/9/a.txt.asc",
153 "size": 20002
154 }
155 ],
156 "type": "delta",
157 "version": 1201
158 },
159 {
160 "base": 1201,
161 "description": "Delta B.2",
162 "description-xx": "Oh delta, my delta",
163 "description-xx_CC": "This hyar is the delta B.2",
164 "files": [
165 {
166 "checksum": "8c43d75d5b9f1aa9fc3fabb6b60b6c06553324352399a33febce95a1b588d1d6",
167 "order": 1,
168 "path": "/9/a/b.txt",
169 "signature": "/9/a/b.txt.asc",
170 "size": 30000
171 },
172 {
173 "checksum": "20e796c128096d229ba89bf412a53c3151d170a409c2c8c1dd8e414087b7ffae",
174 "order": 1,
175 "path": "/f/e/d.txt",
176 "signature": "/f/e/d.txt.asc",
177 "size": 30001
178 },
179 {
180 "checksum": "278238e8bafa4709c77aa723e168101acd6ee1fb9fcc1b6eca4762e5c7dad768",
181 "order": 1,
182 "path": "/e/d/c.txt",
183 "signature": "/e/d/c.txt.asc",
184 "size": 30002
185
186 }
187 ],
188 "type": "delta",
189 "version": 1304
190 },
191
192 {
193 "description": "Full C",
194 "files": [
195 {
196 "checksum": "dcb",
197 "order": 1,
198 "path": "/d/c/b.txt",
199 "signature": "/d/c/b.txt.asc",
200 "size": 104857600
201 },
202 {
203 "checksum": "cba",
204 "order": 1,
205 "path": "/c/b/a.txt",
206 "signature": "/c/b/a.txt.asc",
207 "size": 104857600
208 },
209 {
210 "checksum": "ba9",
211 "order": 1,
212 "path": "/b/a/9.txt",
213 "signature": "/b/a/9.txt.asc",
214 "size": 104857600
215 }
216 ],
217 "type": "full",
218 "version": 1100
219 },
220 {
221 "base": 1100,
222 "description": "Delta C.1",
223 "files": [
224 {
225 "checksum": "a98",
226 "order": 1,
227 "path": "/a/9/8.txt",
228 "signature": "/a/9/8.txt.asc",
229 "size": 104857600
230 },
231 {
232 "checksum": "987",
233 "order": 1,
234 "path": "/9/8/7.txt",
235 "signature": "/9/8/7.txt.asc",
236 "size": 104857600
237 },
238 {
239 "checksum": "876",
240 "order": 1,
241 "path": "/8/7/6.txt",
242 "signature": "/8/7/6.txt.asc",
243 "size": 838860800
244
245 }
246 ],
247 "type": "delta",
248 "version": 1303
249 }
250 ]
251}
0252
=== added file 'systemimage/tests/data/candidates.index_01.json'
--- systemimage/tests/data/candidates.index_01.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/candidates.index_01.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,6 @@
1{
2 "global": {
3 "generated_at": "Mon Apr 29 18:45:27 UTC 2013"
4 },
5 "images": []
6}
07
=== added file 'systemimage/tests/data/candidates.index_02.json'
--- systemimage/tests/data/candidates.index_02.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/candidates.index_02.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,23 @@
1{
2 "global": {
3 "generated_at": "Mon Apr 29 18:45:27 UTC 2013"
4 },
5 "images": [
6 {
7 "bootme": true,
8 "description": "New full build 1",
9 "files": [],
10 "minversion": 600,
11 "type": "full",
12 "version": 1300
13 },
14 {
15 "bootme": true,
16 "description": "New full build 2",
17 "files": [],
18 "minversion": 1100,
19 "type": "full",
20 "version": 1400
21 }
22 ]
23}
024
=== renamed file 'systemimage/tests/data/index_05.json' => 'systemimage/tests/data/candidates.index_03.json'
=== renamed file 'systemimage/tests/data/index_03.json' => 'systemimage/tests/data/candidates.index_04.json'
=== renamed file 'systemimage/tests/data/index_04.json' => 'systemimage/tests/data/candidates.index_05.json'
=== renamed file 'systemimage/tests/data/index_06.json' => 'systemimage/tests/data/candidates.index_06.json'
=== renamed file 'systemimage/tests/data/index_07.json' => 'systemimage/tests/data/candidates.index_07.json'
=== added file 'systemimage/tests/data/candidates.index_08.json'
--- systemimage/tests/data/candidates.index_08.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/candidates.index_08.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,244 @@
1{
2 "global": {
3 "generated_at": "Mon Apr 29 18:45:27 UTC 2013"
4 },
5 "images": [
6 {
7 "bootme": true,
8 "description": "Full A",
9 "files": [
10 {
11 "checksum": "abc",
12 "order": 1,
13 "path": "/a/b/c.txt",
14 "signature": "/a/b/c.txt.asc",
15 "size": 104857600
16
17 },
18 {
19 "checksum": "bcd",
20 "order": 1,
21 "path": "/b/c/d.txt",
22 "signature": "/b/c/d.txt.asc",
23 "size": 104857600
24 },
25 {
26 "checksum": "cde",
27 "order": 1,
28 "path": "/c/d/e.txt",
29 "signature": "/c/d/e.txt.asc",
30 "size": 104857600
31 }
32 ],
33 "type": "full",
34 "version": 1300
35 },
36 {
37 "base": 1300,
38 "bootme": true,
39 "description": "Delta A.1",
40 "files": [
41 {
42 "checksum": "def",
43 "order": 1,
44 "path": "/d/e/f.txt",
45 "signature": "/d/e/f.txt.asc",
46 "size": 104857600
47 },
48 {
49 "checksum": "ef0",
50 "order": 1,
51 "path": "/e/f/0.txt",
52 "signature": "/e/f/0.txt.asc",
53 "size": 104857600
54 },
55 {
56 "checksum": "f01",
57 "order": 1,
58 "path": "/f/e/1.txt",
59 "signature": "/f/e/1.txt.asc",
60 "size": 104857600
61 }
62 ],
63 "type": "delta",
64 "version": 1301
65 },
66 {
67 "base": 1301,
68 "bootme": true,
69 "description": "Delta A.2",
70 "files": [
71 {
72 "checksum": "012",
73 "order": 1,
74 "path": "/0/1/2.txt",
75 "signature": "/0/1/2.txt.asc",
76 "size": 104857600
77 },
78 {
79 "checksum": "123",
80 "order": 1,
81 "path": "/1/2/3.txt",
82 "signature": "/1/2/3.txt.asc",
83 "size": 104857600
84 },
85 {
86 "checksum": "234",
87 "order": 1,
88 "path": "/2/3/4.txt",
89 "signature": "/2/3/4.txt.asc",
90 "size": 104857600
91 }
92 ],
93 "type": "delta",
94 "version": 1304
95 },
96
97 {
98 "description": "Full B",
99 "files": [
100 {
101 "checksum": "345",
102 "order": 1,
103 "path": "/3/4/5.txt",
104 "signature": "/3/4/5.txt.asc",
105 "size": 104857600
106 },
107 {
108 "checksum": "456",
109 "order": 1,
110 "path": "/4/5/6.txt",
111 "signature": "/4/5/6.txt.asc",
112 "size": 104857600
113 },
114 {
115 "checksum": "567",
116 "order": 1,
117 "path": "/5/6/7.txt",
118 "signature": "/5/6/7.txt.asc",
119 "size": 104857600
120 }
121 ],
122 "type": "full",
123 "version": 1200
124 },
125 {
126 "base": 1200,
127 "description": "Delta B.1",
128 "files": [
129 {
130 "checksum": "678",
131 "order": 1,
132 "path": "/6/7/8.txt",
133 "signature": "/6/7/8.txt.asc",
134 "size": 104857600
135 },
136 {
137 "checksum": "789",
138 "order": 1,
139 "path": "/7/8/9.txt",
140 "signature": "/7/8/9.txt.asc",
141 "size": 104857600
142 },
143 {
144 "checksum": "89a",
145 "order": 1,
146 "path": "/8/9/a.txt",
147 "signature": "/8/9/a.txt.asc",
148 "size": 104857600
149 }
150 ],
151 "type": "delta",
152 "version": 1201
153 },
154 {
155 "base": 1201,
156 "description": "Delta B.2",
157 "files": [
158 {
159 "checksum": "9ab",
160 "order": 1,
161 "path": "/9/a/b.txt",
162 "signature": "/9/a/b.txt.asc",
163 "size": 104857600
164 },
165 {
166 "checksum": "fed",
167 "order": 1,
168 "path": "/f/e/d.txt",
169 "signature": "/f/e/d.txt.asc",
170 "size": 104857600
171 },
172 {
173 "checksum": "edc",
174 "order": 1,
175 "path": "/e/d/c.txt",
176 "signature": "/e/d/c.txt.asc",
177 "size": 209715200
178
179 }
180 ],
181 "type": "delta",
182 "version": 1304
183 },
184
185 {
186 "description": "Full C",
187 "files": [
188 {
189 "checksum": "dcb",
190 "order": 1,
191 "path": "/d/c/b.txt",
192 "signature": "/d/c/b.txt.asc",
193 "size": 104857600
194 },
195 {
196 "checksum": "cba",
197 "order": 1,
198 "path": "/c/b/a.txt",
199 "signature": "/c/b/a.txt.asc",
200 "size": 104857600
201 },
202 {
203 "checksum": "ba9",
204 "order": 1,
205 "path": "/b/a/9.txt",
206 "signature": "/b/a/9.txt.asc",
207 "size": 104857600
208 }
209 ],
210 "type": "full",
211 "version": 1100
212 },
213 {
214 "base": 1100,
215 "description": "Delta C.1",
216 "files": [
217 {
218 "checksum": "a98",
219 "order": 1,
220 "path": "/a/9/8.txt",
221 "signature": "/a/9/8.txt.asc",
222 "size": 104857600
223 },
224 {
225 "checksum": "987",
226 "order": 1,
227 "path": "/9/8/7.txt",
228 "signature": "/9/8/7.txt.asc",
229 "size": 104857600
230 },
231 {
232 "checksum": "876",
233 "order": 1,
234 "path": "/8/7/6.txt",
235 "signature": "/8/7/6.txt.asc",
236 "size": 838860800
237
238 }
239 ],
240 "type": "delta",
241 "version": 1303
242 }
243 ]
244}
0245
=== renamed file 'systemimage/tests/data/index_11.json' => 'systemimage/tests/data/candidates.index_09.json'
=== added file 'systemimage/tests/data/candidates.index_10.json'
--- systemimage/tests/data/candidates.index_10.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/candidates.index_10.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,36 @@
1{
2 "global": {
3 "generated_at": "Thu Aug 01 08:01:00 UTC 2013"
4 },
5 "images": [
6 {
7 "description": "Full",
8 "files": [
9 {
10 "checksum": "da70dfa4d9f95ac979f921e8e623358236313f334afcd06cddf8a5621cf6a1e9",
11 "order": 3,
12 "path": "/3/4/5.txt",
13 "signature": "/3/4/5.txt.asc",
14 "size": 104857600
15 },
16 {
17 "checksum": "b3a8e0e1f9ab1bfe3a36f231f676f78bb30a519d2b21e6c530c0eee8ebb4a5d0",
18 "order": 1,
19 "path": "/4/5/6.txt",
20 "signature": "/4/5/6.txt.asc",
21 "size": 104857600
22 },
23 {
24 "checksum": "97a6d21df7c51e8289ac1a8c026aaac143e15aa1957f54f42e30d8f8a85c3a55",
25 "order": 2,
26 "path": "/5/6/7.txt",
27 "signature": "/5/6/7.txt.asc",
28 "size": 104857600
29 }
30 ],
31 "type": "full",
32 "version": 1600,
33 "bootme": true
34 }
35 ]
36}
037
=== added file 'systemimage/tests/data/candidates.index_11.json'
--- systemimage/tests/data/candidates.index_11.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/candidates.index_11.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,37 @@
1{
2 "global": {
3 "generated_at": "Mon Apr 29 18:45:27 UTC 2013"
4 },
5 "images": [
6 {
7 "base": 100,
8 "description": "Delta",
9 "files": [
10 {
11 "checksum": "da70dfa4d9f95ac979f921e8e623358236313f334afcd06cddf8a5621cf6a1e9",
12 "order": 3,
13 "path": "/3/4/5.txt",
14 "signature": "/3/4/5.txt.asc",
15 "size": 104857600
16 },
17 {
18 "checksum": "b3a8e0e1f9ab1bfe3a36f231f676f78bb30a519d2b21e6c530c0eee8ebb4a5d0",
19 "order": 1,
20 "path": "/4/5/6.txt",
21 "signature": "/4/5/6.txt.asc",
22 "size": 104857600
23 },
24 {
25 "checksum": "97a6d21df7c51e8289ac1a8c026aaac143e15aa1957f54f42e30d8f8a85c3a55",
26 "order": 2,
27 "path": "/5/6/7.txt",
28 "signature": "/5/6/7.txt.asc",
29 "size": 104857600
30 }
31 ],
32 "type": "delta",
33 "version": 1600,
34 "bootme": true
35 }
36 ]
37}
038
=== renamed file 'systemimage/tests/data/index_19.json' => 'systemimage/tests/data/candidates.index_12.json'
=== added file 'systemimage/tests/data/candidates.index_13.json'
--- systemimage/tests/data/candidates.index_13.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/candidates.index_13.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,244 @@
1{
2 "global": {
3 "generated_at": "Mon Apr 29 18:45:27 UTC 2013"
4 },
5 "images": [
6 {
7 "bootme": true,
8 "description": "Full A",
9 "files": [
10 {
11 "checksum": "abc",
12 "order": 1,
13 "path": "/a/b/c.txt",
14 "signature": "/a/b/c.txt.asc",
15 "size": 104857600
16
17 },
18 {
19 "checksum": "bcd",
20 "order": 1,
21 "path": "/b/c/d.txt",
22 "signature": "/b/c/d.txt.asc",
23 "size": 104857600
24 },
25 {
26 "checksum": "cde",
27 "order": 1,
28 "path": "/c/d/e.txt",
29 "signature": "/c/d/e.txt.asc",
30 "size": 104857600
31 }
32 ],
33 "type": "full",
34 "version": 300
35 },
36 {
37 "base": 300,
38 "bootme": true,
39 "description": "Delta A.1",
40 "files": [
41 {
42 "checksum": "def",
43 "order": 1,
44 "path": "/d/e/f.txt",
45 "signature": "/d/e/f.txt.asc",
46 "size": 104857600
47 },
48 {
49 "checksum": "ef0",
50 "order": 1,
51 "path": "/e/f/0.txt",
52 "signature": "/e/f/0.txt.asc",
53 "size": 104857600
54 },
55 {
56 "checksum": "f01",
57 "order": 1,
58 "path": "/f/e/1.txt",
59 "signature": "/f/e/1.txt.asc",
60 "size": 104857600
61 }
62 ],
63 "type": "delta",
64 "version": 301
65 },
66 {
67 "base": 301,
68 "bootme": true,
69 "description": "Delta A.2",
70 "files": [
71 {
72 "checksum": "012",
73 "order": 1,
74 "path": "/0/1/2.txt",
75 "signature": "/0/1/2.txt.asc",
76 "size": 104857600
77 },
78 {
79 "checksum": "123",
80 "order": 1,
81 "path": "/1/2/3.txt",
82 "signature": "/1/2/3.txt.asc",
83 "size": 104857600
84 },
85 {
86 "checksum": "234",
87 "order": 1,
88 "path": "/2/3/4.txt",
89 "signature": "/2/3/4.txt.asc",
90 "size": 104857600
91 }
92 ],
93 "type": "delta",
94 "version": 304
95 },
96
97 {
98 "description": "Full B",
99 "files": [
100 {
101 "checksum": "345",
102 "order": 1,
103 "path": "/3/4/5.txt",
104 "signature": "/3/4/5.txt.asc",
105 "size": 104857600
106 },
107 {
108 "checksum": "456",
109 "order": 1,
110 "path": "/4/5/6.txt",
111 "signature": "/4/5/6.txt.asc",
112 "size": 104857600
113 },
114 {
115 "checksum": "567",
116 "order": 1,
117 "path": "/5/6/7.txt",
118 "signature": "/5/6/7.txt.asc",
119 "size": 104857600
120 }
121 ],
122 "type": "full",
123 "version": 200
124 },
125 {
126 "base": 200,
127 "description": "Delta B.1",
128 "files": [
129 {
130 "checksum": "678",
131 "order": 1,
132 "path": "/6/7/8.txt",
133 "signature": "/6/7/8.txt.asc",
134 "size": 104857600
135 },
136 {
137 "checksum": "789",
138 "order": 1,
139 "path": "/7/8/9.txt",
140 "signature": "/7/8/9.txt.asc",
141 "size": 104857600
142 },
143 {
144 "checksum": "89a",
145 "order": 1,
146 "path": "/8/9/a.txt",
147 "signature": "/8/9/a.txt.asc",
148 "size": 104857600
149 }
150 ],
151 "type": "delta",
152 "version": 201
153 },
154 {
155 "base": 201,
156 "description": "Delta B.2",
157 "files": [
158 {
159 "checksum": "9ab",
160 "order": 1,
161 "path": "/9/a/b.txt",
162 "signature": "/9/a/b.txt.asc",
163 "size": 104857600
164 },
165 {
166 "checksum": "fed",
167 "order": 1,
168 "path": "/f/e/d.txt",
169 "signature": "/f/e/d.txt.asc",
170 "size": 104857600
171 },
172 {
173 "checksum": "edc",
174 "order": 1,
175 "path": "/e/d/c.txt",
176 "signature": "/e/d/c.txt.asc",
177 "size": 209715200
178
179 }
180 ],
181 "type": "delta",
182 "version": 304
183 },
184
185 {
186 "description": "Full C",
187 "files": [
188 {
189 "checksum": "dcb",
190 "order": 1,
191 "path": "/d/c/b.txt",
192 "signature": "/d/c/b.txt.asc",
193 "size": 104857600
194 },
195 {
196 "checksum": "cba",
197 "order": 1,
198 "path": "/c/b/a.txt",
199 "signature": "/c/b/a.txt.asc",
200 "size": 104857600
201 },
202 {
203 "checksum": "ba9",
204 "order": 1,
205 "path": "/b/a/9.txt",
206 "signature": "/b/a/9.txt.asc",
207 "size": 104857600
208 }
209 ],
210 "type": "full",
211 "version": 100
212 },
213 {
214 "base": 100,
215 "description": "Delta C.1",
216 "files": [
217 {
218 "checksum": "a98",
219 "order": 1,
220 "path": "/a/9/8.txt",
221 "signature": "/a/9/8.txt.asc",
222 "size": 104857600
223 },
224 {
225 "checksum": "987",
226 "order": 1,
227 "path": "/9/8/7.txt",
228 "signature": "/9/8/7.txt.asc",
229 "size": 104857600
230 },
231 {
232 "checksum": "876",
233 "order": 1,
234 "path": "/8/7/6.txt",
235 "signature": "/8/7/6.txt.asc",
236 "size": 838860800
237
238 }
239 ],
240 "type": "delta",
241 "version": 303
242 }
243 ]
244}
0245
=== added file 'systemimage/tests/data/channel.channels_01.json'
--- systemimage/tests/data/channel.channels_01.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/channel.channels_01.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,23 @@
1{
2 "daily": {
3 "devices": {
4 "nexus7": {
5 "index": "/daily/nexus7/index.json",
6 "keyring": {
7 "path": "/daily/nexus7/device-keyring.tar.xz",
8 "signature": "/daily/nexus7/device-keyring.tar.xz.asc"
9 }
10 },
11 "nexus4":{
12 "index": "/daily/nexus4/index.json"
13 }
14 }
15 },
16 "stable": {
17 "devices": {
18 "nexus7":{
19 "index": "/stable/nexus7/index.json"
20 }
21 }
22 }
23}
024
=== added file 'systemimage/tests/data/channel.channels_02.json'
--- systemimage/tests/data/channel.channels_02.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/channel.channels_02.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,38 @@
1{
2 "daily": {
3 "devices": {
4 "grouper": {
5 "index": "/daily/grouper/index.json"
6 },
7 "maguro": {
8 "index": "/daily/maguro/index.json"
9 },
10 "mako": {
11 "index": "/daily/mako/index.json"
12 },
13 "manta": {
14 "index": "/daily/manta/index.json"
15 }
16 }
17 },
18 "daily-proposed": {
19 "devices": {
20 "grouper": {
21 "index": "/daily-proposed/grouper/index.json",
22 "keyring": {
23 "path": "/daily-proposed/grouper/device-signing.tar.xz",
24 "signature": "/daily-proposed/grouper/device-signing.tar.xz.asc"
25 }
26 },
27 "maguro": {
28 "index": "/daily-proposed/maguro/index.json"
29 },
30 "mako": {
31 "index": "/daily-proposed/mako/index.json"
32 },
33 "manta": {
34 "index": "/daily-proposed/manta/index.json"
35 }
36 }
37 }
38}
039
=== added file 'systemimage/tests/data/channel.channels_03.json'
--- systemimage/tests/data/channel.channels_03.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/channel.channels_03.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,70 @@
1{
2 "13.10": {
3 "devices": {
4 "grouper": {
5 "index": "/13.10/grouper/index.json"
6 },
7 "maguro": {
8 "index": "/13.10/maguro/index.json"
9 },
10 "mako": {
11 "index": "/13.10/mako/index.json"
12 },
13 "manta": {
14 "index": "/13.10/manta/index.json"
15 }
16 }
17 },
18 "13.10-proposed": {
19 "devices": {
20 "grouper": {
21 "index": "/13.10-proposed/grouper/index.json"
22 },
23 "maguro": {
24 "index": "/13.10-proposed/maguro/index.json"
25 },
26 "mako": {
27 "index": "/13.10-proposed/mako/index.json"
28 },
29 "manta": {
30 "index": "/13.10-proposed/manta/index.json"
31 }
32 }
33 },
34 "14.04": {
35 "devices": {
36 "grouper": {
37 "index": "/14.04/grouper/index.json"
38 },
39 "maguro": {
40 "index": "/14.04/maguro/index.json"
41 },
42 "mako": {
43 "index": "/14.04/mako/index.json"
44 },
45 "manta": {
46 "index": "/14.04/manta/index.json"
47 }
48 }
49 },
50 "14.04-proposed": {
51 "devices": {
52 "grouper": {
53 "index": "/14.04-proposed/grouper/index.json",
54 "keyring": {
55 "path": "/14.04-proposed/grouper/device-signing.tar.xz",
56 "signature": "/14.04-proposed/grouper/device-signing.tar.xz.asc"
57 }
58 },
59 "maguro": {
60 "index": "/14.04-proposed/maguro/index.json"
61 },
62 "mako": {
63 "index": "/14.04-proposed/mako/index.json"
64 },
65 "manta": {
66 "index": "/14.04-proposed/manta/index.json"
67 }
68 }
69 }
70}
071
=== added file 'systemimage/tests/data/channel.channels_04.json'
--- systemimage/tests/data/channel.channels_04.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/channel.channels_04.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,56 @@
1{
2 "daily": {
3 "alias": "saucy",
4 "devices": {
5 "grouper": {
6 "index": "/daily/grouper/index.json"
7 },
8 "maguro": {
9 "index": "/daily/maguro/index.json"
10 },
11 "mako": {
12 "index": "/daily/mako/index.json"
13 },
14 "manta": {
15 "index": "/daily/manta/index.json"
16 }
17 }
18 },
19 "saucy": {
20 "devices": {
21 "grouper": {
22 "index": "/saucy/grouper/index.json"
23 },
24 "maguro": {
25 "index": "/saucy/maguro/index.json"
26 },
27 "mako": {
28 "index": "/saucy/mako/index.json"
29 },
30 "manta": {
31 "index": "/saucy/manta/index.json",
32 "keyring": {
33 "path": "/saucy/manta/device-signing.tar.xz",
34 "signature": "/saucy/manta/device-signing.tar.xz.asc"
35 }
36 }
37 }
38 },
39 "saucy-proposed": {
40 "hidden": true,
41 "devices": {
42 "grouper": {
43 "index": "/saucy-proposed/grouper/index.json"
44 },
45 "maguro": {
46 "index": "/saucy-proposed/maguro/index.json"
47 },
48 "mako": {
49 "index": "/saucy-proposed/mako/index.json"
50 },
51 "manta": {
52 "index": "/saucy-proposed/manta/index.json"
53 }
54 }
55 }
56}
057
=== added file 'systemimage/tests/data/channel.channels_05.json'
--- systemimage/tests/data/channel.channels_05.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/channel.channels_05.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,23 @@
1{
2 "daily": {
3 "devices": {
4 "nexus7": {
5 "index": "/daily/nexus7/index.json",
6 "keyring": {
7 "path": "/daily/nexus7/device-keyring.tar.xz",
8 "signature": "/daily/nexus7/device-keyring.tar.xz.asc"
9 }
10 },
11 "nexus4":{
12 "index": "/daily/nexus4/index.json"
13 }
14 }
15 },
16 "stable": {
17 "devices": {
18 "nexus7":{
19 "index": "/stable/nexus7/index.json"
20 }
21 }
22 }
23}
024
=== removed file 'systemimage/tests/data/channel_06.ini'
--- systemimage/tests/data/channel_06.ini 2014-08-08 20:25:17 +0000
+++ systemimage/tests/data/channel_06.ini 1970-01-01 00:00:00 +0000
@@ -1,8 +0,0 @@
1[service]
2base: localhost
3http_port: 8980
4https_port: 8943
5channel: daily
6build_number: 300
7channel_target: saucy
8device: shoephone
90
=== removed file 'systemimage/tests/data/channel_07.ini'
--- systemimage/tests/data/channel_07.ini 2014-08-08 20:25:17 +0000
+++ systemimage/tests/data/channel_07.ini 1970-01-01 00:00:00 +0000
@@ -1,8 +0,0 @@
1[service]
2base: localhost
3http_port: 8980
4https_port: 8943
5channel: daily
6build_number: 300
7channel_target: saucy
8device:
90
=== added file 'systemimage/tests/data/config.config_01.ini'
--- systemimage/tests/data/config.config_01.ini 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/config.config_01.ini 2015-01-15 22:43:25 +0000
@@ -0,0 +1,34 @@
1# Configuration file for specifying relatively static information about the
2# upgrade resolution process.
3
4[service]
5base: phablet.example.com
6http_port: 80
7https_port: 443
8channel: stable
9build_number: 0
10
11[system]
12timeout: 10s
13tempdir: /tmp
14logfile: /var/log/system-image/client.log
15loglevel: error
16settings_db: /var/lib/phablet/settings.db
17
18[gpg]
19archive_master: /etc/phablet/archive-master.tar.xz
20image_master: /etc/phablet/image-master.tar.xz
21image_signing: /var/lib/phablet/image-signing.tar.xz
22device_signing: /var/lib/phablet/device-signing.tar.xz
23
24[updater]
25cache_partition: {tmpdir}/android/cache
26data_partition: {vardir}/lib/phablet/updater
27
28[hooks]
29device: systemimage.device.SystemProperty
30scorer: systemimage.scores.WeightedScorer
31reboot: systemimage.reboot.Reboot
32
33[dbus]
34lifetime: 2m
035
=== renamed file 'systemimage/tests/data/config_10.ini' => 'systemimage/tests/data/config.config_02.ini'
--- systemimage/tests/data/config_10.ini 2014-09-11 18:12:50 +0000
+++ systemimage/tests/data/config.config_02.ini 2015-01-15 22:43:25 +0000
@@ -10,7 +10,6 @@
1010
11[system]11[system]
12timeout: 10s12timeout: 10s
13build_file: /etc/ubuntu-build
14tempdir: /tmp13tempdir: /tmp
15logfile: /var/log/system-image/client.log14logfile: /var/log/system-image/client.log
16loglevel: critical:debug15loglevel: critical:debug
@@ -23,8 +22,8 @@
23device_signing: /var/lib/phablet/device-signing.tar.xz22device_signing: /var/lib/phablet/device-signing.tar.xz
2423
25[updater]24[updater]
26cache_partition: /android/cache25cache_partition: {tmpdir}/android/cache
27data_partition: /var/lib/phablet/updater26data_partition: {vardir}/lib/phablet/updater
2827
29[hooks]28[hooks]
30device: systemimage.device.SystemProperty29device: systemimage.device.SystemProperty
3130
=== renamed file 'systemimage/tests/data/config_02.ini' => 'systemimage/tests/data/config.config_03.ini'
--- systemimage/tests/data/config_02.ini 2013-11-12 19:57:39 +0000
+++ systemimage/tests/data/config.config_03.ini 2015-01-15 22:43:25 +0000
@@ -11,7 +11,6 @@
1111
12[system]12[system]
13timeout: 10s13timeout: 10s
14build_file: /etc/ubuntu-build
15tempdir: /tmp14tempdir: /tmp
16logfile: /var/log/system-image/client.log15logfile: /var/log/system-image/client.log
17loglevel: error16loglevel: error
@@ -24,8 +23,8 @@
24device_signing: /var/lib/phablet/device-signing.tar.xz23device_signing: /var/lib/phablet/device-signing.tar.xz
2524
26[updater]25[updater]
27cache_partition: /android/cache26cache_partition: {tmpdir}/android/cache
28data_partition: /var/lib/phablet/updater27data_partition: {vardir}/lib/phablet/updater
2928
30[hooks]29[hooks]
31device: systemimage.device.SystemProperty30device: systemimage.device.SystemProperty
3231
=== added file 'systemimage/tests/data/config.config_04.ini'
--- systemimage/tests/data/config.config_04.ini 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/config.config_04.ini 2015-01-15 22:43:25 +0000
@@ -0,0 +1,36 @@
1# TEMPLATE configuration file for specifying relatively static information
2# about the upgrade resolution process.
3#
4# This is used by the DBus tests.
5
6[service]
7base: localhost
8http_port: 8980
9https_port: 8943
10channel: stable
11build_number: 0
12
13[system]
14timeout: 1s
15tempdir: {tmpdir}/tmp
16logfile: {logfile}
17loglevel: {loglevel}
18settings_db: {vardir}/settings.db
19
20[gpg]
21archive_master: {vardir}/etc/archive-master.tar.xz
22image_master: {vardir}/keyrings/image-master.tar.xz
23image_signing: {vardir}/keyrings/image-signing.tar.xz
24device_signing: {vardir}/keyrings/device-signing.tar.xz
25
26[updater]
27cache_partition: {vardir}/android/cache
28data_partition: {vardir}/ubuntu/cache
29
30[hooks]
31device: systemimage.testing.demo.TestingDevice
32scorer: systemimage.scores.WeightedScorer
33reboot: systemimage.reboot.Reboot
34
35[dbus]
36lifetime: 5m
037
=== renamed file 'systemimage/tests/data/config_05.ini' => 'systemimage/tests/data/config.config_05.ini'
--- systemimage/tests/data/config_05.ini 2014-02-25 21:46:55 +0000
+++ systemimage/tests/data/config.config_05.ini 2015-01-15 22:43:25 +0000
@@ -11,7 +11,6 @@
1111
12[system]12[system]
13timeout: 10s13timeout: 10s
14build_file: /etc/ubuntu-build
15tempdir: /tmp14tempdir: /tmp
16logfile: /var/log/system-image/client.log15logfile: /var/log/system-image/client.log
17loglevel: error16loglevel: error
@@ -24,8 +23,8 @@
24device_signing: /var/lib/phablet/device-signing.tar.xz23device_signing: /var/lib/phablet/device-signing.tar.xz
2524
26[updater]25[updater]
27cache_partition: /android/cache26cache_partition: {tmpdir}/android/cache
28data_partition: /var/lib/phablet/updater27data_partition: {vardir}/lib/phablet/updater
2928
30[hooks]29[hooks]
31device: systemimage.device.SystemProperty30device: systemimage.device.SystemProperty
3231
=== renamed file 'systemimage/tests/data/config_06.ini' => 'systemimage/tests/data/config.config_06.ini'
--- systemimage/tests/data/config_06.ini 2014-02-25 21:46:55 +0000
+++ systemimage/tests/data/config.config_06.ini 2015-01-15 22:43:25 +0000
@@ -11,7 +11,6 @@
1111
12[system]12[system]
13timeout: 10s13timeout: 10s
14build_file: /etc/ubuntu-build
15tempdir: /tmp14tempdir: /tmp
16logfile: /var/log/system-image/client.log15logfile: /var/log/system-image/client.log
17loglevel: error16loglevel: error
@@ -24,8 +23,8 @@
24device_signing: /var/lib/phablet/device-signing.tar.xz23device_signing: /var/lib/phablet/device-signing.tar.xz
2524
26[updater]25[updater]
27cache_partition: /android/cache26cache_partition: {tmpdir}/android/cache
28data_partition: /var/lib/phablet/updater27data_partition: {vardir}/lib/phablet/updater
2928
30[hooks]29[hooks]
31device: systemimage.device.SystemProperty30device: systemimage.device.SystemProperty
3231
=== renamed file 'systemimage/tests/data/config_07.ini' => 'systemimage/tests/data/config.config_07.ini'
--- systemimage/tests/data/config_07.ini 2014-02-25 21:46:55 +0000
+++ systemimage/tests/data/config.config_07.ini 2015-01-15 22:43:25 +0000
@@ -11,7 +11,6 @@
1111
12[system]12[system]
13timeout: 10s13timeout: 10s
14build_file: /etc/ubuntu-build
15tempdir: /tmp14tempdir: /tmp
16logfile: /var/log/system-image/client.log15logfile: /var/log/system-image/client.log
17loglevel: error16loglevel: error
1817
=== renamed file 'systemimage/tests/data/config_08.ini' => 'systemimage/tests/data/config.config_08.ini'
--- systemimage/tests/data/config_08.ini 2014-02-26 16:11:09 +0000
+++ systemimage/tests/data/config.config_08.ini 2015-01-15 22:43:25 +0000
@@ -11,7 +11,6 @@
1111
12[system]12[system]
13timeout: 10s13timeout: 10s
14build_file: /etc/ubuntu-build
15tempdir: /tmp14tempdir: /tmp
16logfile: /var/log/system-image/client.log15logfile: /var/log/system-image/client.log
17loglevel: error16loglevel: error
1817
=== renamed file 'systemimage/tests/data/channel_02.ini' => 'systemimage/tests/data/config.config_09.ini'
--- systemimage/tests/data/channel_02.ini 2014-02-26 16:11:09 +0000
+++ systemimage/tests/data/config.config_09.ini 2015-01-15 22:43:25 +0000
@@ -5,8 +5,5 @@
5channel: proposed5channel: proposed
6build_number: 8336build_number: 833
77
8[system]
9build_file: /etc/path/to/alternative/build-file
10
11[dbus]8[dbus]
12lifetime: 1h9lifetime: 1h
1310
=== renamed file 'systemimage/tests/data/config_09.ini' => 'systemimage/tests/data/config.config_10.ini'
--- systemimage/tests/data/config_09.ini 2014-08-08 00:58:41 +0000
+++ systemimage/tests/data/config.config_10.ini 2015-01-15 22:43:25 +0000
@@ -15,8 +15,8 @@
15device_signing: /var/lib/phablet/device-signing.tar.xz15device_signing: /var/lib/phablet/device-signing.tar.xz
1616
17[updater]17[updater]
18cache_partition: /android/cache18cache_partition: {tmpdir}/android/cache
19data_partition: /var/lib/phablet/updater19data_partition: {vardir}/lib/phablet/updater
2020
21[hooks]21[hooks]
22device: systemimage.device.SystemProperty22device: systemimage.device.SystemProperty
2323
=== removed file 'systemimage/tests/data/config_04.ini'
--- systemimage/tests/data/config_04.ini 2013-11-12 19:57:39 +0000
+++ systemimage/tests/data/config_04.ini 1970-01-01 00:00:00 +0000
@@ -1,36 +0,0 @@
1# Configuration file for specifying relatively static information about the
2# upgrade resolution process.
3
4[service]
5base: phablet.example.com
6# Non-standard ports
7http_port: 8080
8https_port: 80443
9channel: stable
10build_number: 0
11
12[system]
13timeout: 30s
14build_file: {tmpdir}/ubuntu-build
15tempdir: {tmpdir}/tmp
16logfile: {vardir}/client.log
17loglevel: info
18settings_db: {vardir}/settings.db
19
20[gpg]
21archive_master: {vardir}/etc/archive-master.tar.xz
22image_master: {vardir}/keyrings/image-master.tar.xz
23image_signing: {vardir}/keyrings/image-signing.tar.xz
24device_signing: {vardir}/keyrings/device-signing.tar.xz
25
26[updater]
27cache_partition: {vardir}/android/cache
28data_partition: {vardir}/ubuntu/cache
29
30[hooks]
31device: systemimage.device.SystemProperty
32scorer: systemimage.scores.WeightedScorer
33reboot: systemimage.reboot.Reboot
34
35[dbus]
36lifetime: 3s
370
=== renamed file 'systemimage/tests/data/channels_06.json' => 'systemimage/tests/data/dbus.channels_01.json'
=== renamed file 'systemimage/tests/data/index_13.json' => 'systemimage/tests/data/dbus.index_01.json'
=== renamed file 'systemimage/tests/data/index_18.json' => 'systemimage/tests/data/dbus.index_02.json'
=== added file 'systemimage/tests/data/dbus.index_03.json'
--- systemimage/tests/data/dbus.index_03.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/dbus.index_03.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,36 @@
1{
2 "global": {
3 "generated_at": "Thu Aug 01 08:01:00 UTC 2013"
4 },
5 "images": [
6 {
7 "description": "Full",
8 "files": [
9 {
10 "checksum": "da70dfa4d9f95ac979f921e8e623358236313f334afcd06cddf8a5621cf6a1e9",
11 "order": 3,
12 "path": "/3/4/5.txt",
13 "signature": "/3/4/5.txt.asc",
14 "size": 104857600
15 },
16 {
17 "checksum": "b3a8e0e1f9ab1bfe3a36f231f676f78bb30a519d2b21e6c530c0eee8ebb4a5d0",
18 "order": 1,
19 "path": "/4/5/6.txt",
20 "signature": "/4/5/6.txt.asc",
21 "size": 104857600
22 },
23 {
24 "checksum": "97a6d21df7c51e8289ac1a8c026aaac143e15aa1957f54f42e30d8f8a85c3a55",
25 "order": 2,
26 "path": "/5/6/5.txt",
27 "signature": "/5/6/5.txt.asc",
28 "size": 104857600
29 }
30 ],
31 "type": "full",
32 "version": 1600,
33 "bootme": true
34 }
35 ]
36}
037
=== renamed file 'systemimage/tests/data/index_24.json' => 'systemimage/tests/data/dbus.index_04.json'
=== renamed file 'systemimage/tests/data/index_25.json' => 'systemimage/tests/data/dbus.index_05.json'
=== added file 'systemimage/tests/data/download.index_01.json'
--- systemimage/tests/data/download.index_01.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/download.index_01.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,6 @@
1{
2 "global": {
3 "generated_at": "Mon Apr 29 18:45:27 UTC 2013"
4 },
5 "images": []
6}
07
=== added file 'systemimage/tests/data/gpg.channels_01.json'
--- systemimage/tests/data/gpg.channels_01.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/gpg.channels_01.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,23 @@
1{
2 "daily": {
3 "devices": {
4 "nexus7": {
5 "index": "/daily/nexus7/index.json",
6 "keyring": {
7 "path": "/daily/nexus7/device-keyring.tar.xz",
8 "signature": "/daily/nexus7/device-keyring.tar.xz.asc"
9 }
10 },
11 "nexus4":{
12 "index": "/daily/nexus4/index.json"
13 }
14 }
15 },
16 "stable": {
17 "devices": {
18 "nexus7":{
19 "index": "/stable/nexus7/index.json"
20 }
21 }
22 }
23}
024
=== added file 'systemimage/tests/data/helpers.config_01.ini'
--- systemimage/tests/data/helpers.config_01.ini 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/helpers.config_01.ini 2015-01-15 22:43:25 +0000
@@ -0,0 +1,7 @@
1[service]
2base: systum-imaje.ubuntu.com
3http_port: 88
4https_port: 89
5channel: proposed
6build_number: 1833
7version_detail: ubuntu=123,mako=456,custom=789
08
=== added file 'systemimage/tests/data/helpers.config_02.ini'
--- systemimage/tests/data/helpers.config_02.ini 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/helpers.config_02.ini 2015-01-15 22:43:25 +0000
@@ -0,0 +1,6 @@
1[service]
2base: systum-imaje.ubuntu.com
3http_port: 88
4https_port: 89
5channel: proposed
6build_number: 1833
07
=== added file 'systemimage/tests/data/index.channels_01.json'
--- systemimage/tests/data/index.channels_01.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/index.channels_01.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,9 @@
1{
2 "stable": {
3 "devices": {
4 "nexus7":{
5 "index": "/stable/nexus7/index.json"
6 }
7 }
8 }
9}
010
=== added file 'systemimage/tests/data/index.channels_02.json'
--- systemimage/tests/data/index.channels_02.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/index.channels_02.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,13 @@
1{
2 "stable": {
3 "devices": {
4 "nexus7":{
5 "index": "/stable/nexus7/index.json",
6 "keyring": {
7 "path": "stable/nexus7/device.tar.xz",
8 "signature": "stable/nexus7/device.tar.xz.asc"
9 }
10 }
11 }
12 }
13}
014
=== renamed file 'systemimage/tests/data/channels_04.json' => 'systemimage/tests/data/index.channels_03.json'
=== renamed file 'systemimage/tests/data/channels_05.json' => 'systemimage/tests/data/index.channels_04.json'
=== added file 'systemimage/tests/data/index.channels_05.json'
--- systemimage/tests/data/index.channels_05.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/index.channels_05.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,9 @@
1{
2 "stable": {
3 "devices": {
4 "nexus7":{
5 "index": "/stable/nexus7/index.json"
6 }
7 }
8 }
9}
010
=== added file 'systemimage/tests/data/index.index_01.json'
--- systemimage/tests/data/index.index_01.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/index.index_01.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,251 @@
1{
2 "global": {
3 "generated_at": "Mon Apr 29 18:45:27 UTC 2013"
4 },
5 "images": [
6 {
7 "bootme": true,
8 "description": "Full A",
9 "files": [
10 {
11 "checksum": "abc",
12 "order": 1,
13 "path": "/a/b/c.txt",
14 "signature": "/a/b/c.txt.asc",
15 "size": 104857600
16
17 },
18 {
19 "checksum": "bcd",
20 "order": 1,
21 "path": "/b/c/d.txt",
22 "signature": "/b/c/d.txt.asc",
23 "size": 104857600
24 },
25 {
26 "checksum": "cde",
27 "order": 1,
28 "path": "/c/d/e.txt",
29 "signature": "/c/d/e.txt.asc",
30 "size": 104857600
31 }
32 ],
33 "type": "full",
34 "version": 1300
35 },
36 {
37 "base": 1300,
38 "bootme": true,
39 "description": "Delta A.1",
40 "files": [
41 {
42 "checksum": "def",
43 "order": 1,
44 "path": "/d/e/f.txt",
45 "signature": "/d/e/f.txt.asc",
46 "size": 104857600
47 },
48 {
49 "checksum": "ef0",
50 "order": 1,
51 "path": "/e/f/0.txt",
52 "signature": "/e/f/0.txt.asc",
53 "size": 104857600
54 },
55 {
56 "checksum": "f01",
57 "order": 1,
58 "path": "/f/e/1.txt",
59 "signature": "/f/e/1.txt.asc",
60 "size": 104857600
61 }
62 ],
63 "type": "delta",
64 "version": 1301
65 },
66 {
67 "base": 1301,
68 "bootme": true,
69 "description": "Delta A.2",
70 "files": [
71 {
72 "checksum": "012",
73 "order": 1,
74 "path": "/0/1/2.txt",
75 "signature": "/0/1/2.txt.asc",
76 "size": 104857600
77 },
78 {
79 "checksum": "123",
80 "order": 1,
81 "path": "/1/2/3.txt",
82 "signature": "/1/2/3.txt.asc",
83 "size": 104857600
84 },
85 {
86 "checksum": "234",
87 "order": 1,
88 "path": "/2/3/4.txt",
89 "signature": "/2/3/4.txt.asc",
90 "size": 104857600
91 }
92 ],
93 "type": "delta",
94 "version": 1304
95 },
96
97 {
98 "description": "Full B",
99 "description-en": "The full B",
100 "files": [
101 {
102 "checksum": "da70dfa4d9f95ac979f921e8e623358236313f334afcd06cddf8a5621cf6a1e9",
103 "order": 1,
104 "path": "/3/4/5.txt",
105 "signature": "/3/4/5.txt.asc",
106 "size": 10000
107 },
108 {
109 "checksum": "b3a8e0e1f9ab1bfe3a36f231f676f78bb30a519d2b21e6c530c0eee8ebb4a5d0",
110 "order": 1,
111 "path": "/4/5/6.txt",
112 "signature": "/4/5/6.txt.asc",
113 "size": 10001
114 },
115 {
116 "checksum": "97a6d21df7c51e8289ac1a8c026aaac143e15aa1957f54f42e30d8f8a85c3a55",
117 "order": 1,
118 "path": "/5/6/7.txt",
119 "signature": "/5/6/7.txt.asc",
120 "size": 10002
121 }
122 ],
123 "type": "full",
124 "version": 1200
125 },
126 {
127 "base": 1200,
128 "description": "Delta B.1",
129 "description-en_US": "This is the delta B.1",
130 "description-xx": "XX This is the delta B.1",
131 "description-yy": "YY This is the delta B.1",
132 "description-yy_ZZ": "YY-ZZ This is the delta B.1",
133 "files": [
134 {
135 "checksum": "cebe3d9d614ba5c19f633566104315854a11353a333bf96f16b5afa0e90abdc4",
136 "order": 1,
137 "path": "/6/7/8.txt",
138 "signature": "/6/7/8.txt.asc",
139 "size": 20000
140 },
141 {
142 "checksum": "35a9e381b1a27567549b5f8a6f783c167ebf809f1c4d6a9e367240484d8ce281",
143 "order": 1,
144 "path": "/7/8/9.txt",
145 "signature": "/7/8/9.txt.asc",
146 "size": 20001
147 },
148 {
149 "checksum": "6bd6c3f7808391e8b74f5c2d58810809eda5c134aaa7f1b27ddf4b445c421ac5",
150 "order": 1,
151 "path": "/8/9/a.txt",
152 "signature": "/8/9/a.txt.asc",
153 "size": 20002
154 }
155 ],
156 "type": "delta",
157 "version": 1201
158 },
159 {
160 "base": 1201,
161 "description": "Delta B.2",
162 "description-xx": "Oh delta, my delta",
163 "description-xx_CC": "This hyar is the delta B.2",
164 "files": [
165 {
166 "checksum": "8c43d75d5b9f1aa9fc3fabb6b60b6c06553324352399a33febce95a1b588d1d6",
167 "order": 1,
168 "path": "/9/a/b.txt",
169 "signature": "/9/a/b.txt.asc",
170 "size": 30000
171 },
172 {
173 "checksum": "20e796c128096d229ba89bf412a53c3151d170a409c2c8c1dd8e414087b7ffae",
174 "order": 1,
175 "path": "/f/e/d.txt",
176 "signature": "/f/e/d.txt.asc",
177 "size": 30001
178 },
179 {
180 "checksum": "278238e8bafa4709c77aa723e168101acd6ee1fb9fcc1b6eca4762e5c7dad768",
181 "order": 1,
182 "path": "/e/d/c.txt",
183 "signature": "/e/d/c.txt.asc",
184 "size": 30002
185
186 }
187 ],
188 "type": "delta",
189 "version": 1304
190 },
191
192 {
193 "description": "Full C",
194 "files": [
195 {
196 "checksum": "dcb",
197 "order": 1,
198 "path": "/d/c/b.txt",
199 "signature": "/d/c/b.txt.asc",
200 "size": 104857600
201 },
202 {
203 "checksum": "cba",
204 "order": 1,
205 "path": "/c/b/a.txt",
206 "signature": "/c/b/a.txt.asc",
207 "size": 104857600
208 },
209 {
210 "checksum": "ba9",
211 "order": 1,
212 "path": "/b/a/9.txt",
213 "signature": "/b/a/9.txt.asc",
214 "size": 104857600
215 }
216 ],
217 "type": "full",
218 "version": 1100
219 },
220 {
221 "base": 1100,
222 "description": "Delta C.1",
223 "files": [
224 {
225 "checksum": "a98",
226 "order": 1,
227 "path": "/a/9/8.txt",
228 "signature": "/a/9/8.txt.asc",
229 "size": 104857600
230 },
231 {
232 "checksum": "987",
233 "order": 1,
234 "path": "/9/8/7.txt",
235 "signature": "/9/8/7.txt.asc",
236 "size": 104857600
237 },
238 {
239 "checksum": "876",
240 "order": 1,
241 "path": "/8/7/6.txt",
242 "signature": "/8/7/6.txt.asc",
243 "size": 838860800
244
245 }
246 ],
247 "type": "delta",
248 "version": 1303
249 }
250 ]
251}
0252
=== renamed file 'systemimage/tests/data/index_01.json' => 'systemimage/tests/data/index.index_02.json'
=== renamed file 'systemimage/tests/data/index_02.json' => 'systemimage/tests/data/index.index_03.json'
=== added file 'systemimage/tests/data/index.index_04.json'
--- systemimage/tests/data/index.index_04.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/index.index_04.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,244 @@
1{
2 "global": {
3 "generated_at": "Mon Apr 29 18:45:27 UTC 2013"
4 },
5 "images": [
6 {
7 "bootme": true,
8 "description": "Full A",
9 "files": [
10 {
11 "checksum": "abc",
12 "order": 1,
13 "path": "/a/b/c.txt",
14 "signature": "/a/b/c.txt.asc",
15 "size": 104857600
16
17 },
18 {
19 "checksum": "bcd",
20 "order": 1,
21 "path": "/b/c/d.txt",
22 "signature": "/b/c/d.txt.asc",
23 "size": 104857600
24 },
25 {
26 "checksum": "cde",
27 "order": 1,
28 "path": "/c/d/e.txt",
29 "signature": "/c/d/e.txt.asc",
30 "size": 104857600
31 }
32 ],
33 "type": "full",
34 "version": 1300
35 },
36 {
37 "base": 1300,
38 "bootme": true,
39 "description": "Delta A.1",
40 "files": [
41 {
42 "checksum": "def",
43 "order": 1,
44 "path": "/d/e/f.txt",
45 "signature": "/d/e/f.txt.asc",
46 "size": 104857600
47 },
48 {
49 "checksum": "ef0",
50 "order": 1,
51 "path": "/e/f/0.txt",
52 "signature": "/e/f/0.txt.asc",
53 "size": 104857600
54 },
55 {
56 "checksum": "f01",
57 "order": 1,
58 "path": "/f/e/1.txt",
59 "signature": "/f/e/1.txt.asc",
60 "size": 104857600
61 }
62 ],
63 "type": "delta",
64 "version": 1301
65 },
66 {
67 "base": 1301,
68 "bootme": true,
69 "description": "Delta A.2",
70 "files": [
71 {
72 "checksum": "012",
73 "order": 1,
74 "path": "/0/1/2.txt",
75 "signature": "/0/1/2.txt.asc",
76 "size": 104857600
77 },
78 {
79 "checksum": "123",
80 "order": 1,
81 "path": "/1/2/3.txt",
82 "signature": "/1/2/3.txt.asc",
83 "size": 104857600
84 },
85 {
86 "checksum": "234",
87 "order": 1,
88 "path": "/2/3/4.txt",
89 "signature": "/2/3/4.txt.asc",
90 "size": 104857600
91 }
92 ],
93 "type": "delta",
94 "version": 1304
95 },
96
97 {
98 "description": "Full B",
99 "files": [
100 {
101 "checksum": "345",
102 "order": 1,
103 "path": "/3/4/5.txt",
104 "signature": "/3/4/5.txt.asc",
105 "size": 104857600
106 },
107 {
108 "checksum": "456",
109 "order": 1,
110 "path": "/4/5/6.txt",
111 "signature": "/4/5/6.txt.asc",
112 "size": 104857600
113 },
114 {
115 "checksum": "567",
116 "order": 1,
117 "path": "/5/6/7.txt",
118 "signature": "/5/6/7.txt.asc",
119 "size": 104857600
120 }
121 ],
122 "type": "full",
123 "version": 1200
124 },
125 {
126 "base": 1200,
127 "description": "Delta B.1",
128 "files": [
129 {
130 "checksum": "678",
131 "order": 1,
132 "path": "/6/7/8.txt",
133 "signature": "/6/7/8.txt.asc",
134 "size": 104857600
135 },
136 {
137 "checksum": "789",
138 "order": 1,
139 "path": "/7/8/9.txt",
140 "signature": "/7/8/9.txt.asc",
141 "size": 104857600
142 },
143 {
144 "checksum": "89a",
145 "order": 1,
146 "path": "/8/9/a.txt",
147 "signature": "/8/9/a.txt.asc",
148 "size": 104857600
149 }
150 ],
151 "type": "delta",
152 "version": 1201
153 },
154 {
155 "base": 1201,
156 "description": "Delta B.2",
157 "files": [
158 {
159 "checksum": "9ab",
160 "order": 1,
161 "path": "/9/a/b.txt",
162 "signature": "/9/a/b.txt.asc",
163 "size": 104857600
164 },
165 {
166 "checksum": "fed",
167 "order": 1,
168 "path": "/f/e/d.txt",
169 "signature": "/f/e/d.txt.asc",
170 "size": 104857600
171 },
172 {
173 "checksum": "edc",
174 "order": 1,
175 "path": "/e/d/c.txt",
176 "signature": "/e/d/c.txt.asc",
177 "size": 209715200
178
179 }
180 ],
181 "type": "delta",
182 "version": 1304
183 },
184
185 {
186 "description": "Full C",
187 "files": [
188 {
189 "checksum": "dcb",
190 "order": 1,
191 "path": "/d/c/b.txt",
192 "signature": "/d/c/b.txt.asc",
193 "size": 104857600
194 },
195 {
196 "checksum": "cba",
197 "order": 1,
198 "path": "/c/b/a.txt",
199 "signature": "/c/b/a.txt.asc",
200 "size": 104857600
201 },
202 {
203 "checksum": "ba9",
204 "order": 1,
205 "path": "/b/a/9.txt",
206 "signature": "/b/a/9.txt.asc",
207 "size": 104857600
208 }
209 ],
210 "type": "full",
211 "version": 1100
212 },
213 {
214 "base": 1100,
215 "description": "Delta C.1",
216 "files": [
217 {
218 "checksum": "a98",
219 "order": 1,
220 "path": "/a/9/8.txt",
221 "signature": "/a/9/8.txt.asc",
222 "size": 104857600
223 },
224 {
225 "checksum": "987",
226 "order": 1,
227 "path": "/9/8/7.txt",
228 "signature": "/9/8/7.txt.asc",
229 "size": 104857600
230 },
231 {
232 "checksum": "876",
233 "order": 1,
234 "path": "/8/7/6.txt",
235 "signature": "/8/7/6.txt.asc",
236 "size": 838860800
237
238 }
239 ],
240 "type": "delta",
241 "version": 1303
242 }
243 ]
244}
0245
=== renamed file 'systemimage/tests/data/sprint_nexus7_index_01.json' => 'systemimage/tests/data/index.index_05.json'
=== removed file 'systemimage/tests/data/index_26.json'
--- systemimage/tests/data/index_26.json 2014-10-21 20:06:07 +0000
+++ systemimage/tests/data/index_26.json 1970-01-01 00:00:00 +0000
@@ -1,245 +0,0 @@
1{
2 "global": {
3 "generated_at": "Mon Apr 29 18:45:27 UTC 2013"
4 },
5 "images": [
6 {
7 "bootme": true,
8 "description": "Full A",
9 "files": [
10 {
11 "checksum": "abc",
12 "order": 1,
13 "path": "/a/b/c.txt",
14 "signature": "/a/b/c.txt.asc",
15 "size": 104857600
16
17 },
18 {
19 "checksum": "bcd",
20 "order": 1,
21 "path": "/b/c/d.txt",
22 "signature": "/b/c/d.txt.asc",
23 "size": 104857600
24 },
25 {
26 "checksum": "cde",
27 "order": 1,
28 "path": "/c/d/e.txt",
29 "signature": "/c/d/e.txt.asc",
30 "size": 104857600
31 }
32 ],
33 "type": "full",
34 "version": 300
35 },
36 {
37 "base": 300,
38 "bootme": true,
39 "description": "Delta A.1",
40 "files": [
41 {
42 "checksum": "def",
43 "order": 1,
44 "path": "/d/e/f.txt",
45 "signature": "/d/e/f.txt.asc",
46 "size": 104857600
47 },
48 {
49 "checksum": "ef0",
50 "order": 1,
51 "path": "/e/f/0.txt",
52 "signature": "/e/f/0.txt.asc",
53 "size": 104857600
54 },
55 {
56 "checksum": "f01",
57 "order": 1,
58 "path": "/f/e/1.txt",
59 "signature": "/f/e/1.txt.asc",
60 "size": 104857600
61 }
62 ],
63 "type": "delta",
64 "version": 301
65 },
66 {
67 "base": 301,
68 "bootme": true,
69 "description": "Delta A.2",
70 "files": [
71 {
72 "checksum": "012",
73 "order": 1,
74 "path": "/0/1/2.txt",
75 "signature": "/0/1/2.txt.asc",
76 "size": 104857600
77 },
78 {
79 "checksum": "123",
80 "order": 1,
81 "path": "/1/2/3.txt",
82 "signature": "/1/2/3.txt.asc",
83 "size": 104857600
84 },
85 {
86 "checksum": "234",
87 "order": 1,
88 "path": "/2/3/4.txt",
89 "signature": "/2/3/4.txt.asc",
90 "size": 104857600
91 }
92 ],
93 "type": "delta",
94 "version": 304
95 },
96
97 {
98 "description": "Full B",
99 "files": [
100 {
101 "checksum": "345",
102 "order": 1,
103 "path": "/3/4/5.txt",
104 "signature": "/3/4/5.txt.asc",
105 "size": 104857600
106 },
107 {
108 "checksum": "456",
109 "order": 1,
110 "path": "/4/5/6.txt",
111 "signature": "/4/5/6.txt.asc",
112 "size": 104857600
113 },
114 {
115 "checksum": "567",
116 "order": 1,
117 "path": "/5/6/7.txt",
118 "signature": "/5/6/7.txt.asc",
119 "size": 104857600
120 }
121 ],
122 "type": "full",
123 "version": 200
124 },
125 {
126 "base": 200,
127 "description": "Delta B.1",
128 "files": [
129 {
130 "checksum": "678",
131 "order": 1,
132 "path": "/6/7/8.txt",
133 "signature": "/6/7/8.txt.asc",
134 "size": 104857600
135 },
136 {
137 "checksum": "789",
138 "order": 1,
139 "path": "/7/8/9.txt",
140 "signature": "/7/8/9.txt.asc",
141 "size": 104857600
142 },
143 {
144 "checksum": "89a",
145 "order": 1,
146 "path": "/8/9/a.txt",
147 "signature": "/8/9/a.txt.asc",
148 "size": 104857600
149 }
150 ],
151 "type": "delta",
152 "version": 201
153 },
154 {
155 "base": 201,
156 "description": "Delta B.2",
157 "files": [
158 {
159 "checksum": "9ab",
160 "order": 1,
161 "path": "/9/a/b.txt",
162 "signature": "/9/a/b.txt.asc",
163 "size": 104857600
164 },
165 {
166 "checksum": "fed",
167 "order": 1,
168 "path": "/f/e/d.txt",
169 "signature": "/f/e/d.txt.asc",
170 "size": 104857600
171 },
172 {
173 "checksum": "edc",
174 "order": 1,
175 "path": "/e/d/c.txt",
176 "signature": "/e/d/c.txt.asc",
177 "size": 209715200
178
179 }
180 ],
181 "type": "delta",
182 "version": 304,
183 "phased-percentage": 0
184 },
185
186 {
187 "description": "Full C",
188 "files": [
189 {
190 "checksum": "dcb",
191 "order": 1,
192 "path": "/d/c/b.txt",
193 "signature": "/d/c/b.txt.asc",
194 "size": 104857600
195 },
196 {
197 "checksum": "cba",
198 "order": 1,
199 "path": "/c/b/a.txt",
200 "signature": "/c/b/a.txt.asc",
201 "size": 104857600
202 },
203 {
204 "checksum": "ba9",
205 "order": 1,
206 "path": "/b/a/9.txt",
207 "signature": "/b/a/9.txt.asc",
208 "size": 104857600
209 }
210 ],
211 "type": "full",
212 "version": 100
213 },
214 {
215 "base": 100,
216 "description": "Delta C.1",
217 "files": [
218 {
219 "checksum": "a98",
220 "order": 1,
221 "path": "/a/9/8.txt",
222 "signature": "/a/9/8.txt.asc",
223 "size": 104857600
224 },
225 {
226 "checksum": "987",
227 "order": 1,
228 "path": "/9/8/7.txt",
229 "signature": "/9/8/7.txt.asc",
230 "size": 104857600
231 },
232 {
233 "checksum": "876",
234 "order": 1,
235 "path": "/8/7/6.txt",
236 "signature": "/8/7/6.txt.asc",
237 "size": 838860800
238
239 }
240 ],
241 "type": "delta",
242 "version": 303
243 }
244 ]
245}
2460
=== added file 'systemimage/tests/data/main.channels_01.json'
--- systemimage/tests/data/main.channels_01.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/main.channels_01.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,13 @@
1{
2 "stable": {
3 "devices": {
4 "nexus7": {
5 "index": "/stable/nexus7/index.json",
6 "keyring": {
7 "path": "/stable/nexus7/device-signing.tar.xz",
8 "signature": "/stable/nexus7/device-signing.tar.xz.asc"
9 }
10 }
11 }
12 }
13}
014
=== renamed file 'systemimage/tests/data/channels_10.json' => 'systemimage/tests/data/main.channels_02.json'
=== added file 'systemimage/tests/data/main.channels_03.json'
--- systemimage/tests/data/main.channels_03.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/main.channels_03.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,13 @@
1{
2 "stable": {
3 "devices": {
4 "nexus7": {
5 "index": "/stable/nexus7/index.json",
6 "keyring": {
7 "path": "/stable/nexus7/device-signing.tar.xz",
8 "signature": "/stable/nexus7/device-signing.tar.xz.asc"
9 }
10 }
11 }
12 }
13}
014
=== renamed file 'systemimage/tests/data/config_01.ini' => 'systemimage/tests/data/main.config_01.ini'
--- systemimage/tests/data/config_01.ini 2013-11-12 19:57:39 +0000
+++ systemimage/tests/data/main.config_01.ini 2015-01-15 22:43:25 +0000
@@ -5,12 +5,11 @@
5base: phablet.example.com5base: phablet.example.com
6http_port: 806http_port: 80
7https_port: 4437https_port: 443
8channel: stable8channel: special
9build_number: 09build_number: 0
1010
11[system]11[system]
12timeout: 10s12timeout: 10s
13build_file: /etc/ubuntu-build
14tempdir: /tmp13tempdir: /tmp
15logfile: /var/log/system-image/client.log14logfile: /var/log/system-image/client.log
16loglevel: error15loglevel: error
@@ -23,8 +22,8 @@
23device_signing: /var/lib/phablet/device-signing.tar.xz22device_signing: /var/lib/phablet/device-signing.tar.xz
2423
25[updater]24[updater]
26cache_partition: /android/cache25cache_partition: {tmpdir}/android/cache
27data_partition: /var/lib/phablet/updater26data_partition: {vardir}/lib/phablet/updater
2827
29[hooks]28[hooks]
30device: systemimage.device.SystemProperty29device: systemimage.device.SystemProperty
3130
=== renamed file 'systemimage/tests/data/channel_01.ini' => 'systemimage/tests/data/main.config_02.ini'
=== renamed file 'systemimage/tests/data/channel_05.ini' => 'systemimage/tests/data/main.config_03.ini'
=== renamed file 'systemimage/tests/data/channel_03.ini' => 'systemimage/tests/data/main.config_04.ini'
=== added file 'systemimage/tests/data/main.config_05.ini'
--- systemimage/tests/data/main.config_05.ini 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/main.config_05.ini 2015-01-15 22:43:25 +0000
@@ -0,0 +1,7 @@
1[service]
2base: localhost
3http_port: 8980
4https_port: 8943
5channel: daily
6build_number: 300
7channel_target: saucy
08
=== renamed file 'systemimage/tests/data/channel_04.ini' => 'systemimage/tests/data/main.config_07.ini'
--- systemimage/tests/data/channel_04.ini 2013-09-06 22:09:02 +0000
+++ systemimage/tests/data/main.config_07.ini 2015-01-15 22:43:25 +0000
@@ -3,4 +3,4 @@
3http_port: 89803http_port: 8980
4https_port: 89434https_port: 8943
5channel: saucy5channel: saucy
6build_number: 16build_number: 33
77
=== renamed file 'systemimage/tests/data/index_14.json' => 'systemimage/tests/data/main.index_01.json'
=== renamed file 'systemimage/tests/data/index_20.json' => 'systemimage/tests/data/main.index_02.json'
=== renamed file 'systemimage/tests/data/index_15.json' => 'systemimage/tests/data/main.index_03.json'
=== added file 'systemimage/tests/data/main.index_04.json'
--- systemimage/tests/data/main.index_04.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/main.index_04.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,36 @@
1{
2 "global": {
3 "generated_at": "Thu Aug 01 08:01:00 UTC 2013"
4 },
5 "images": [
6 {
7 "description": "Full",
8 "files": [
9 {
10 "checksum": "da70dfa4d9f95ac979f921e8e623358236313f334afcd06cddf8a5621cf6a1e9",
11 "order": 3,
12 "path": "/3/4/5.txt",
13 "signature": "/3/4/5.txt.asc",
14 "size": 104857600
15 },
16 {
17 "checksum": "b3a8e0e1f9ab1bfe3a36f231f676f78bb30a519d2b21e6c530c0eee8ebb4a5d0",
18 "order": 1,
19 "path": "/4/5/6.txt",
20 "signature": "/4/5/6.txt.asc",
21 "size": 104857600
22 },
23 {
24 "checksum": "97a6d21df7c51e8289ac1a8c026aaac143e15aa1957f54f42e30d8f8a85c3a55",
25 "order": 2,
26 "path": "/5/6/5.txt",
27 "signature": "/5/6/5.txt.asc",
28 "size": 104857600
29 }
30 ],
31 "type": "full",
32 "version": 1600,
33 "bootme": true
34 }
35 ]
36}
037
=== added file 'systemimage/tests/data/main.index_05.json'
--- systemimage/tests/data/main.index_05.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/main.index_05.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,36 @@
1{
2 "global": {
3 "generated_at": "Thu Aug 01 08:01:00 UTC 2013"
4 },
5 "images": [
6 {
7 "description": "Full",
8 "files": [
9 {
10 "checksum": "da70dfa4d9f95ac979f921e8e623358236313f334afcd06cddf8a5621cf6a1e9",
11 "order": 3,
12 "path": "/3/4/5.txt",
13 "signature": "/3/4/5.txt.asc",
14 "size": 104857600
15 },
16 {
17 "checksum": "b3a8e0e1f9ab1bfe3a36f231f676f78bb30a519d2b21e6c530c0eee8ebb4a5d0",
18 "order": 1,
19 "path": "/4/5/6.txt",
20 "signature": "/4/5/6.txt.asc",
21 "size": 104857600
22 },
23 {
24 "checksum": "97a6d21df7c51e8289ac1a8c026aaac143e15aa1957f54f42e30d8f8a85c3a55",
25 "order": 2,
26 "path": "/5/6/7.txt",
27 "signature": "/5/6/7.txt.asc",
28 "size": 104857600
29 }
30 ],
31 "type": "full",
32 "version": 1600,
33 "bootme": true
34 }
35 ]
36}
037
=== added file 'systemimage/tests/data/scores.index_01.json'
--- systemimage/tests/data/scores.index_01.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/scores.index_01.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,245 @@
1{
2 "global": {
3 "generated_at": "Mon Apr 29 18:45:27 UTC 2013"
4 },
5 "images": [
6 {
7 "bootme": true,
8 "description": "Full A",
9 "files": [
10 {
11 "checksum": "abc",
12 "order": 1,
13 "path": "/a/b/c.txt",
14 "signature": "/a/b/c.txt.asc",
15 "size": 104857600
16
17 },
18 {
19 "checksum": "bcd",
20 "order": 1,
21 "path": "/b/c/d.txt",
22 "signature": "/b/c/d.txt.asc",
23 "size": 104857600
24 },
25 {
26 "checksum": "cde",
27 "order": 1,
28 "path": "/c/d/e.txt",
29 "signature": "/c/d/e.txt.asc",
30 "size": 104857600
31 }
32 ],
33 "type": "full",
34 "version": 300
35 },
36 {
37 "base": 300,
38 "bootme": true,
39 "description": "Delta A.1",
40 "files": [
41 {
42 "checksum": "def",
43 "order": 1,
44 "path": "/d/e/f.txt",
45 "signature": "/d/e/f.txt.asc",
46 "size": 104857600
47 },
48 {
49 "checksum": "ef0",
50 "order": 1,
51 "path": "/e/f/0.txt",
52 "signature": "/e/f/0.txt.asc",
53 "size": 104857600
54 },
55 {
56 "checksum": "f01",
57 "order": 1,
58 "path": "/f/e/1.txt",
59 "signature": "/f/e/1.txt.asc",
60 "size": 104857600
61 }
62 ],
63 "type": "delta",
64 "version": 301
65 },
66 {
67 "base": 301,
68 "bootme": true,
69 "description": "Delta A.2",
70 "files": [
71 {
72 "checksum": "012",
73 "order": 1,
74 "path": "/0/1/2.txt",
75 "signature": "/0/1/2.txt.asc",
76 "size": 104857600
77 },
78 {
79 "checksum": "123",
80 "order": 1,
81 "path": "/1/2/3.txt",
82 "signature": "/1/2/3.txt.asc",
83 "size": 104857600
84 },
85 {
86 "checksum": "234",
87 "order": 1,
88 "path": "/2/3/4.txt",
89 "signature": "/2/3/4.txt.asc",
90 "size": 104857600
91 }
92 ],
93 "type": "delta",
94 "version": 304
95 },
96
97 {
98 "description": "Full B",
99 "files": [
100 {
101 "checksum": "345",
102 "order": 1,
103 "path": "/3/4/5.txt",
104 "signature": "/3/4/5.txt.asc",
105 "size": 104857600
106 },
107 {
108 "checksum": "456",
109 "order": 1,
110 "path": "/4/5/6.txt",
111 "signature": "/4/5/6.txt.asc",
112 "size": 104857600
113 },
114 {
115 "checksum": "567",
116 "order": 1,
117 "path": "/5/6/7.txt",
118 "signature": "/5/6/7.txt.asc",
119 "size": 104857600
120 }
121 ],
122 "type": "full",
123 "version": 200
124 },
125 {
126 "base": 200,
127 "description": "Delta B.1",
128 "files": [
129 {
130 "checksum": "678",
131 "order": 1,
132 "path": "/6/7/8.txt",
133 "signature": "/6/7/8.txt.asc",
134 "size": 104857600
135 },
136 {
137 "checksum": "789",
138 "order": 1,
139 "path": "/7/8/9.txt",
140 "signature": "/7/8/9.txt.asc",
141 "size": 104857600
142 },
143 {
144 "checksum": "89a",
145 "order": 1,
146 "path": "/8/9/a.txt",
147 "signature": "/8/9/a.txt.asc",
148 "size": 104857600
149 }
150 ],
151 "type": "delta",
152 "version": 201
153 },
154 {
155 "base": 201,
156 "description": "Delta B.2",
157 "files": [
158 {
159 "checksum": "9ab",
160 "order": 1,
161 "path": "/9/a/b.txt",
162 "signature": "/9/a/b.txt.asc",
163 "size": 104857600
164 },
165 {
166 "checksum": "fed",
167 "order": 1,
168 "path": "/f/e/d.txt",
169 "signature": "/f/e/d.txt.asc",
170 "size": 104857600
171 },
172 {
173 "checksum": "edc",
174 "order": 1,
175 "path": "/e/d/c.txt",
176 "signature": "/e/d/c.txt.asc",
177 "size": 209715200
178
179 }
180 ],
181 "type": "delta",
182 "version": 304,
183 "phased-percentage": 0
184 },
185
186 {
187 "description": "Full C",
188 "files": [
189 {
190 "checksum": "dcb",
191 "order": 1,
192 "path": "/d/c/b.txt",
193 "signature": "/d/c/b.txt.asc",
194 "size": 104857600
195 },
196 {
197 "checksum": "cba",
198 "order": 1,
199 "path": "/c/b/a.txt",
200 "signature": "/c/b/a.txt.asc",
201 "size": 104857600
202 },
203 {
204 "checksum": "ba9",
205 "order": 1,
206 "path": "/b/a/9.txt",
207 "signature": "/b/a/9.txt.asc",
208 "size": 104857600
209 }
210 ],
211 "type": "full",
212 "version": 100
213 },
214 {
215 "base": 100,
216 "description": "Delta C.1",
217 "files": [
218 {
219 "checksum": "a98",
220 "order": 1,
221 "path": "/a/9/8.txt",
222 "signature": "/a/9/8.txt.asc",
223 "size": 104857600
224 },
225 {
226 "checksum": "987",
227 "order": 1,
228 "path": "/9/8/7.txt",
229 "signature": "/9/8/7.txt.asc",
230 "size": 104857600
231 },
232 {
233 "checksum": "876",
234 "order": 1,
235 "path": "/8/7/6.txt",
236 "signature": "/8/7/6.txt.asc",
237 "size": 838860800
238
239 }
240 ],
241 "type": "delta",
242 "version": 303
243 }
244 ]
245}
0246
=== renamed file 'systemimage/tests/data/index_08.json' => 'systemimage/tests/data/scores.index_02.json'
=== renamed file 'systemimage/tests/data/index_09.json' => 'systemimage/tests/data/scores.index_03.json'
=== renamed file 'systemimage/tests/data/index_17.json' => 'systemimage/tests/data/scores.index_04.json'
=== added file 'systemimage/tests/data/scores.index_05.json'
--- systemimage/tests/data/scores.index_05.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/scores.index_05.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,245 @@
1{
2 "global": {
3 "generated_at": "Mon Apr 29 18:45:27 UTC 2013"
4 },
5 "images": [
6 {
7 "bootme": true,
8 "description": "Full A",
9 "files": [
10 {
11 "checksum": "abc",
12 "order": 1,
13 "path": "/a/b/c.txt",
14 "signature": "/a/b/c.txt.asc",
15 "size": 104857600
16
17 },
18 {
19 "checksum": "bcd",
20 "order": 1,
21 "path": "/b/c/d.txt",
22 "signature": "/b/c/d.txt.asc",
23 "size": 104857600
24 },
25 {
26 "checksum": "cde",
27 "order": 1,
28 "path": "/c/d/e.txt",
29 "signature": "/c/d/e.txt.asc",
30 "size": 104857600
31 }
32 ],
33 "type": "full",
34 "version": 300
35 },
36 {
37 "base": 300,
38 "bootme": true,
39 "description": "Delta A.1",
40 "files": [
41 {
42 "checksum": "def",
43 "order": 1,
44 "path": "/d/e/f.txt",
45 "signature": "/d/e/f.txt.asc",
46 "size": 104857600
47 },
48 {
49 "checksum": "ef0",
50 "order": 1,
51 "path": "/e/f/0.txt",
52 "signature": "/e/f/0.txt.asc",
53 "size": 104857600
54 },
55 {
56 "checksum": "f01",
57 "order": 1,
58 "path": "/f/e/1.txt",
59 "signature": "/f/e/1.txt.asc",
60 "size": 104857600
61 }
62 ],
63 "type": "delta",
64 "version": 301
65 },
66 {
67 "base": 301,
68 "bootme": true,
69 "description": "Delta A.2",
70 "files": [
71 {
72 "checksum": "012",
73 "order": 1,
74 "path": "/0/1/2.txt",
75 "signature": "/0/1/2.txt.asc",
76 "size": 104857600
77 },
78 {
79 "checksum": "123",
80 "order": 1,
81 "path": "/1/2/3.txt",
82 "signature": "/1/2/3.txt.asc",
83 "size": 104857600
84 },
85 {
86 "checksum": "234",
87 "order": 1,
88 "path": "/2/3/4.txt",
89 "signature": "/2/3/4.txt.asc",
90 "size": 104857600
91 }
92 ],
93 "type": "delta",
94 "version": 304
95 },
96
97 {
98 "description": "Full B",
99 "files": [
100 {
101 "checksum": "345",
102 "order": 1,
103 "path": "/3/4/5.txt",
104 "signature": "/3/4/5.txt.asc",
105 "size": 104857600
106 },
107 {
108 "checksum": "456",
109 "order": 1,
110 "path": "/4/5/6.txt",
111 "signature": "/4/5/6.txt.asc",
112 "size": 104857600
113 },
114 {
115 "checksum": "567",
116 "order": 1,
117 "path": "/5/6/7.txt",
118 "signature": "/5/6/7.txt.asc",
119 "size": 104857600
120 }
121 ],
122 "type": "full",
123 "version": 200
124 },
125 {
126 "base": 200,
127 "description": "Delta B.1",
128 "files": [
129 {
130 "checksum": "678",
131 "order": 1,
132 "path": "/6/7/8.txt",
133 "signature": "/6/7/8.txt.asc",
134 "size": 104857600
135 },
136 {
137 "checksum": "789",
138 "order": 1,
139 "path": "/7/8/9.txt",
140 "signature": "/7/8/9.txt.asc",
141 "size": 104857600
142 },
143 {
144 "checksum": "89a",
145 "order": 1,
146 "path": "/8/9/a.txt",
147 "signature": "/8/9/a.txt.asc",
148 "size": 104857600
149 }
150 ],
151 "type": "delta",
152 "version": 201
153 },
154 {
155 "base": 201,
156 "description": "Delta B.2",
157 "files": [
158 {
159 "checksum": "9ab",
160 "order": 1,
161 "path": "/9/a/b.txt",
162 "signature": "/9/a/b.txt.asc",
163 "size": 104857600
164 },
165 {
166 "checksum": "fed",
167 "order": 1,
168 "path": "/f/e/d.txt",
169 "signature": "/f/e/d.txt.asc",
170 "size": 104857600
171 },
172 {
173 "checksum": "edc",
174 "order": 1,
175 "path": "/e/d/c.txt",
176 "signature": "/e/d/c.txt.asc",
177 "size": 209715200
178
179 }
180 ],
181 "type": "delta",
182 "version": 304,
183 "phased-percentage": 50
184 },
185
186 {
187 "description": "Full C",
188 "files": [
189 {
190 "checksum": "dcb",
191 "order": 1,
192 "path": "/d/c/b.txt",
193 "signature": "/d/c/b.txt.asc",
194 "size": 104857600
195 },
196 {
197 "checksum": "cba",
198 "order": 1,
199 "path": "/c/b/a.txt",
200 "signature": "/c/b/a.txt.asc",
201 "size": 104857600
202 },
203 {
204 "checksum": "ba9",
205 "order": 1,
206 "path": "/b/a/9.txt",
207 "signature": "/b/a/9.txt.asc",
208 "size": 104857600
209 }
210 ],
211 "type": "full",
212 "version": 100
213 },
214 {
215 "base": 100,
216 "description": "Delta C.1",
217 "files": [
218 {
219 "checksum": "a98",
220 "order": 1,
221 "path": "/a/9/8.txt",
222 "signature": "/a/9/8.txt.asc",
223 "size": 104857600
224 },
225 {
226 "checksum": "987",
227 "order": 1,
228 "path": "/9/8/7.txt",
229 "signature": "/9/8/7.txt.asc",
230 "size": 104857600
231 },
232 {
233 "checksum": "876",
234 "order": 1,
235 "path": "/8/7/6.txt",
236 "signature": "/8/7/6.txt.asc",
237 "size": 838860800
238
239 }
240 ],
241 "type": "delta",
242 "version": 303
243 }
244 ]
245}
0246
=== added file 'systemimage/tests/data/state.channel_01.ini'
--- systemimage/tests/data/state.channel_01.ini 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/state.channel_01.ini 2015-01-15 22:43:25 +0000
@@ -0,0 +1,6 @@
1[service]
2base: localhost
3http_port: 8980
4https_port: 8943
5channel: saucy
6build_number: 1
07
=== added file 'systemimage/tests/data/state.channels_01.json'
--- systemimage/tests/data/state.channels_01.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/state.channels_01.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,64 @@
1{
2 "daily": {
3 "alias": "tubular",
4 "devices": {
5 "grouper": {
6 "index": "/daily/grouper/index.json"
7 },
8 "maguro": {
9 "index": "/daily/maguro/index.json"
10 },
11 "mako": {
12 "index": "/daily/mako/index.json"
13 },
14 "manta": {
15 "index": "/daily/manta/index.json",
16 "keyring": {
17 "path": "/daily/manta/device-signing.tar.xz",
18 "signature": "/daily/manta/device-signing.tar.xz.asc"
19 }
20 }
21 }
22 },
23 "saucy": {
24 "devices": {
25 "grouper": {
26 "index": "/saucy/grouper/index.json"
27 },
28 "maguro": {
29 "index": "/saucy/maguro/index.json"
30 },
31 "mako": {
32 "index": "/saucy/mako/index.json"
33 },
34 "manta": {
35 "index": "/saucy/manta/index.json",
36 "keyring": {
37 "path": "/saucy/manta/device-signing.tar.xz",
38 "signature": "/saucy/manta/device-signing.tar.xz.asc"
39 }
40 }
41 }
42 },
43 "tubular": {
44 "hidden": true,
45 "devices": {
46 "grouper": {
47 "index": "/tubular/grouper/index.json"
48 },
49 "maguro": {
50 "index": "/tubular/maguro/index.json"
51 },
52 "mako": {
53 "index": "/tubular/mako/index.json"
54 },
55 "manta": {
56 "index": "/tubular/manta/index.json",
57 "keyring": {
58 "path": "/tubular/manta/device-signing.tar.xz",
59 "signature": "/tubular/manta/device-signing.tar.xz.asc"
60 }
61 }
62 }
63 }
64}
065
=== added file 'systemimage/tests/data/state.channels_02.json'
--- systemimage/tests/data/state.channels_02.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/state.channels_02.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,13 @@
1{
2 "stable": {
3 "devices": {
4 "nexus7": {
5 "index": "/stable/nexus7/index.json",
6 "keyring": {
7 "path": "/stable/nexus7/device-signing.tar.xz",
8 "signature": "/stable/nexus7/device-signing.tar.xz.asc"
9 }
10 }
11 }
12 }
13}
014
=== renamed file 'systemimage/tests/data/channels_11.json' => 'systemimage/tests/data/state.channels_03.json'
=== renamed file 'systemimage/tests/data/channels_07.json' => 'systemimage/tests/data/state.channels_04.json'
=== renamed file 'systemimage/tests/data/channels_08.json' => 'systemimage/tests/data/state.channels_05.json'
=== renamed file 'systemimage/tests/data/channels_09.json' => 'systemimage/tests/data/state.channels_06.json'
=== renamed file 'systemimage/tests/data/channels_01.json' => 'systemimage/tests/data/state.channels_07.json'
=== added file 'systemimage/tests/data/state.index_01.json'
--- systemimage/tests/data/state.index_01.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/state.index_01.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,244 @@
1{
2 "global": {
3 "generated_at": "Mon Apr 29 18:45:27 UTC 2013"
4 },
5 "images": [
6 {
7 "bootme": true,
8 "description": "Full A",
9 "files": [
10 {
11 "checksum": "abc",
12 "order": 1,
13 "path": "/a/b/c.txt",
14 "signature": "/a/b/c.txt.asc",
15 "size": 104857600
16
17 },
18 {
19 "checksum": "bcd",
20 "order": 1,
21 "path": "/b/c/d.txt",
22 "signature": "/b/c/d.txt.asc",
23 "size": 104857600
24 },
25 {
26 "checksum": "cde",
27 "order": 1,
28 "path": "/c/d/e.txt",
29 "signature": "/c/d/e.txt.asc",
30 "size": 104857600
31 }
32 ],
33 "type": "full",
34 "version": 300
35 },
36 {
37 "base": 300,
38 "bootme": true,
39 "description": "Delta A.1",
40 "files": [
41 {
42 "checksum": "def",
43 "order": 1,
44 "path": "/d/e/f.txt",
45 "signature": "/d/e/f.txt.asc",
46 "size": 104857600
47 },
48 {
49 "checksum": "ef0",
50 "order": 1,
51 "path": "/e/f/0.txt",
52 "signature": "/e/f/0.txt.asc",
53 "size": 104857600
54 },
55 {
56 "checksum": "f01",
57 "order": 1,
58 "path": "/f/e/1.txt",
59 "signature": "/f/e/1.txt.asc",
60 "size": 104857600
61 }
62 ],
63 "type": "delta",
64 "version": 301
65 },
66 {
67 "base": 301,
68 "bootme": true,
69 "description": "Delta A.2",
70 "files": [
71 {
72 "checksum": "012",
73 "order": 1,
74 "path": "/0/1/2.txt",
75 "signature": "/0/1/2.txt.asc",
76 "size": 104857600
77 },
78 {
79 "checksum": "123",
80 "order": 1,
81 "path": "/1/2/3.txt",
82 "signature": "/1/2/3.txt.asc",
83 "size": 104857600
84 },
85 {
86 "checksum": "234",
87 "order": 1,
88 "path": "/2/3/4.txt",
89 "signature": "/2/3/4.txt.asc",
90 "size": 104857600
91 }
92 ],
93 "type": "delta",
94 "version": 304
95 },
96
97 {
98 "description": "Full B",
99 "files": [
100 {
101 "checksum": "345",
102 "order": 1,
103 "path": "/3/4/5.txt",
104 "signature": "/3/4/5.txt.asc",
105 "size": 104857600
106 },
107 {
108 "checksum": "456",
109 "order": 1,
110 "path": "/4/5/6.txt",
111 "signature": "/4/5/6.txt.asc",
112 "size": 104857600
113 },
114 {
115 "checksum": "567",
116 "order": 1,
117 "path": "/5/6/7.txt",
118 "signature": "/5/6/7.txt.asc",
119 "size": 104857600
120 }
121 ],
122 "type": "full",
123 "version": 200
124 },
125 {
126 "base": 200,
127 "description": "Delta B.1",
128 "files": [
129 {
130 "checksum": "678",
131 "order": 1,
132 "path": "/6/7/8.txt",
133 "signature": "/6/7/8.txt.asc",
134 "size": 104857600
135 },
136 {
137 "checksum": "789",
138 "order": 1,
139 "path": "/7/8/9.txt",
140 "signature": "/7/8/9.txt.asc",
141 "size": 104857600
142 },
143 {
144 "checksum": "89a",
145 "order": 1,
146 "path": "/8/9/a.txt",
147 "signature": "/8/9/a.txt.asc",
148 "size": 104857600
149 }
150 ],
151 "type": "delta",
152 "version": 201
153 },
154 {
155 "base": 201,
156 "description": "Delta B.2",
157 "files": [
158 {
159 "checksum": "9ab",
160 "order": 1,
161 "path": "/9/a/b.txt",
162 "signature": "/9/a/b.txt.asc",
163 "size": 104857600
164 },
165 {
166 "checksum": "fed",
167 "order": 1,
168 "path": "/f/e/d.txt",
169 "signature": "/f/e/d.txt.asc",
170 "size": 104857600
171 },
172 {
173 "checksum": "edc",
174 "order": 1,
175 "path": "/e/d/c.txt",
176 "signature": "/e/d/c.txt.asc",
177 "size": 209715200
178
179 }
180 ],
181 "type": "delta",
182 "version": 304
183 },
184
185 {
186 "description": "Full C",
187 "files": [
188 {
189 "checksum": "dcb",
190 "order": 1,
191 "path": "/d/c/b.txt",
192 "signature": "/d/c/b.txt.asc",
193 "size": 104857600
194 },
195 {
196 "checksum": "cba",
197 "order": 1,
198 "path": "/c/b/a.txt",
199 "signature": "/c/b/a.txt.asc",
200 "size": 104857600
201 },
202 {
203 "checksum": "ba9",
204 "order": 1,
205 "path": "/b/a/9.txt",
206 "signature": "/b/a/9.txt.asc",
207 "size": 104857600
208 }
209 ],
210 "type": "full",
211 "version": 100
212 },
213 {
214 "base": 100,
215 "description": "Delta C.1",
216 "files": [
217 {
218 "checksum": "a98",
219 "order": 1,
220 "path": "/a/9/8.txt",
221 "signature": "/a/9/8.txt.asc",
222 "size": 104857600
223 },
224 {
225 "checksum": "987",
226 "order": 1,
227 "path": "/9/8/7.txt",
228 "signature": "/9/8/7.txt.asc",
229 "size": 104857600
230 },
231 {
232 "checksum": "876",
233 "order": 1,
234 "path": "/8/7/6.txt",
235 "signature": "/8/7/6.txt.asc",
236 "size": 838860800
237
238 }
239 ],
240 "type": "delta",
241 "version": 303
242 }
243 ]
244}
0245
=== added file 'systemimage/tests/data/state.index_02.json'
--- systemimage/tests/data/state.index_02.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/state.index_02.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,245 @@
1{
2 "global": {
3 "generated_at": "Mon Apr 29 18:45:27 UTC 2013"
4 },
5 "images": [
6 {
7 "bootme": true,
8 "description": "Full A",
9 "files": [
10 {
11 "checksum": "abc",
12 "order": 1,
13 "path": "/a/b/c.txt",
14 "signature": "/a/b/c.txt.asc",
15 "size": 104857600
16
17 },
18 {
19 "checksum": "bcd",
20 "order": 1,
21 "path": "/b/c/d.txt",
22 "signature": "/b/c/d.txt.asc",
23 "size": 104857600
24 },
25 {
26 "checksum": "cde",
27 "order": 1,
28 "path": "/c/d/e.txt",
29 "signature": "/c/d/e.txt.asc",
30 "size": 104857600
31 }
32 ],
33 "type": "full",
34 "version": 300
35 },
36 {
37 "base": 300,
38 "bootme": true,
39 "description": "Delta A.1",
40 "files": [
41 {
42 "checksum": "def",
43 "order": 1,
44 "path": "/d/e/f.txt",
45 "signature": "/d/e/f.txt.asc",
46 "size": 104857600
47 },
48 {
49 "checksum": "ef0",
50 "order": 1,
51 "path": "/e/f/0.txt",
52 "signature": "/e/f/0.txt.asc",
53 "size": 104857600
54 },
55 {
56 "checksum": "f01",
57 "order": 1,
58 "path": "/f/e/1.txt",
59 "signature": "/f/e/1.txt.asc",
60 "size": 104857600
61 }
62 ],
63 "type": "delta",
64 "version": 301
65 },
66 {
67 "base": 301,
68 "bootme": true,
69 "description": "Delta A.2",
70 "files": [
71 {
72 "checksum": "012",
73 "order": 1,
74 "path": "/0/1/2.txt",
75 "signature": "/0/1/2.txt.asc",
76 "size": 104857600
77 },
78 {
79 "checksum": "123",
80 "order": 1,
81 "path": "/1/2/3.txt",
82 "signature": "/1/2/3.txt.asc",
83 "size": 104857600
84 },
85 {
86 "checksum": "234",
87 "order": 1,
88 "path": "/2/3/4.txt",
89 "signature": "/2/3/4.txt.asc",
90 "size": 104857600
91 }
92 ],
93 "type": "delta",
94 "version": 304
95 },
96
97 {
98 "description": "Full B",
99 "files": [
100 {
101 "checksum": "345",
102 "order": 1,
103 "path": "/3/4/5.txt",
104 "signature": "/3/4/5.txt.asc",
105 "size": 104857600
106 },
107 {
108 "checksum": "456",
109 "order": 1,
110 "path": "/4/5/6.txt",
111 "signature": "/4/5/6.txt.asc",
112 "size": 104857600
113 },
114 {
115 "checksum": "567",
116 "order": 1,
117 "path": "/5/6/7.txt",
118 "signature": "/5/6/7.txt.asc",
119 "size": 104857600
120 }
121 ],
122 "type": "full",
123 "version": 200
124 },
125 {
126 "base": 200,
127 "description": "Delta B.1",
128 "files": [
129 {
130 "checksum": "678",
131 "order": 1,
132 "path": "/6/7/8.txt",
133 "signature": "/6/7/8.txt.asc",
134 "size": 104857600
135 },
136 {
137 "checksum": "789",
138 "order": 1,
139 "path": "/7/8/9.txt",
140 "signature": "/7/8/9.txt.asc",
141 "size": 104857600
142 },
143 {
144 "checksum": "89a",
145 "order": 1,
146 "path": "/8/9/a.txt",
147 "signature": "/8/9/a.txt.asc",
148 "size": 104857600
149 }
150 ],
151 "type": "delta",
152 "version": 201
153 },
154 {
155 "base": 201,
156 "description": "Delta B.2",
157 "files": [
158 {
159 "checksum": "9ab",
160 "order": 1,
161 "path": "/9/a/b.txt",
162 "signature": "/9/a/b.txt.asc",
163 "size": 104857600
164 },
165 {
166 "checksum": "fed",
167 "order": 1,
168 "path": "/f/e/d.txt",
169 "signature": "/f/e/d.txt.asc",
170 "size": 104857600
171 },
172 {
173 "checksum": "edc",
174 "order": 1,
175 "path": "/e/d/c.txt",
176 "signature": "/e/d/c.txt.asc",
177 "size": 209715200
178
179 }
180 ],
181 "type": "delta",
182 "version": 304,
183 "phased-percentage": 0
184 },
185
186 {
187 "description": "Full C",
188 "files": [
189 {
190 "checksum": "dcb",
191 "order": 1,
192 "path": "/d/c/b.txt",
193 "signature": "/d/c/b.txt.asc",
194 "size": 104857600
195 },
196 {
197 "checksum": "cba",
198 "order": 1,
199 "path": "/c/b/a.txt",
200 "signature": "/c/b/a.txt.asc",
201 "size": 104857600
202 },
203 {
204 "checksum": "ba9",
205 "order": 1,
206 "path": "/b/a/9.txt",
207 "signature": "/b/a/9.txt.asc",
208 "size": 104857600
209 }
210 ],
211 "type": "full",
212 "version": 100
213 },
214 {
215 "base": 100,
216 "description": "Delta C.1",
217 "files": [
218 {
219 "checksum": "a98",
220 "order": 1,
221 "path": "/a/9/8.txt",
222 "signature": "/a/9/8.txt.asc",
223 "size": 104857600
224 },
225 {
226 "checksum": "987",
227 "order": 1,
228 "path": "/9/8/7.txt",
229 "signature": "/9/8/7.txt.asc",
230 "size": 104857600
231 },
232 {
233 "checksum": "876",
234 "order": 1,
235 "path": "/8/7/6.txt",
236 "signature": "/8/7/6.txt.asc",
237 "size": 838860800
238
239 }
240 ],
241 "type": "delta",
242 "version": 303
243 }
244 ]
245}
0246
=== added file 'systemimage/tests/data/state.index_03.json'
--- systemimage/tests/data/state.index_03.json 1970-01-01 00:00:00 +0000
+++ systemimage/tests/data/state.index_03.json 2015-01-15 22:43:25 +0000
@@ -0,0 +1,36 @@
1{
2 "global": {
3 "generated_at": "Thu Aug 01 08:01:00 UTC 2013"
4 },
5 "images": [
6 {
7 "description": "Full",
8 "files": [
9 {
10 "checksum": "da70dfa4d9f95ac979f921e8e623358236313f334afcd06cddf8a5621cf6a1e9",
11 "order": 3,
12 "path": "/3/4/5.txt",
13 "signature": "/3/4/5.txt.asc",
14 "size": 104857600
15 },
16 {
17 "checksum": "b3a8e0e1f9ab1bfe3a36f231f676f78bb30a519d2b21e6c530c0eee8ebb4a5d0",
18 "order": 1,
19 "path": "/4/5/6.txt",
20 "signature": "/4/5/6.txt.asc",
21 "size": 104857600
22 },
23 {
24 "checksum": "97a6d21df7c51e8289ac1a8c026aaac143e15aa1957f54f42e30d8f8a85c3a55",
25 "order": 2,
26 "path": "/5/6/7.txt",
27 "signature": "/5/6/7.txt.asc",
28 "size": 104857600
29 }
30 ],
31 "type": "full",
32 "version": 1600,
33 "bootme": true
34 }
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches