1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# Copyright 2012-2014 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Test helpers for boot-image parameters."""
from __future__ import (
absolute_import,
print_function,
unicode_literals,
)
str = None
__metaclass__ = type
__all__ = [
'make_boot_image_params',
]
from maastesting.factory import factory
def make_boot_image_params():
"""Create an arbitrary dict of boot-image parameters.
These are the parameters that together describe a kind of boot for
which we may need a kernel and initrd: operating system, architecture,
sub-architecture, Ubuntu release, boot purpose, and release label.
"""
return dict(
osystem=factory.make_name('osystem'),
architecture=factory.make_name('architecture'),
subarchitecture=factory.make_name('subarchitecture'),
release=factory.make_name('release'),
label=factory.make_name('label'),
purpose=factory.make_name('purpose'),
supported_subarches=factory.make_name("sup_subarches"),
)
def make_boot_image_storage_params():
"""Create a dict of boot-image parameters as used to store the image.
These are the parameters that together describe a path to store a boot
image: operating system, architecture, sub-architecture, Ubuntu release,
and release label.
"""
return dict(
osystem=factory.make_name('osystem'),
architecture=factory.make_name('architecture'),
subarchitecture=factory.make_name('subarchitecture'),
release=factory.make_name('release'),
label=factory.make_name('label'),
)
|