aboutsummaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorMilo Casagrande <milo.casagrande@linaro.org>2014-12-05 13:15:03 +0100
committerMilo Casagrande <milo.casagrande@linaro.org>2014-12-05 13:15:03 +0100
commit17e76cfa4f45b2319cda0aef29c849a3e11f814d (patch)
tree06b2b9db5fc128a95c58b403d0fe52c39da824cf /app/models
parent80a2c92839f5393a0d31956a7fcb2ab5b2a277f5 (diff)
Add board_instance field for boot model.
Change-Id: Ic91f8ff906c9650a02cdbebb7e8df792390cb350
Diffstat (limited to 'app/models')
-rw-r--r--app/models/__init__.py1
-rw-r--r--app/models/boot.py2
-rw-r--r--app/models/tests/test_boot_model.py4
3 files changed, 6 insertions, 1 deletions
diff --git a/app/models/__init__.py b/app/models/__init__.py
index adcc453..9723ada 100644
--- a/app/models/__init__.py
+++ b/app/models/__init__.py
@@ -23,6 +23,7 @@ AGGREGATE_KEY = 'aggregate'
ARCHITECTURE_KEY = 'arch'
ARM64_ARCHITECTURE_KEY = 'arm64'
ARM_ARCHITECTURE_KEY = 'arm'
+BOARD_INSTANCE_KEY = 'board_instance'
BOARD_KEY = 'board'
BOOT_ID_KEY = 'boot_id'
BOOT_LOAD_ADDR_KEY = 'loadaddr'
diff --git a/app/models/boot.py b/app/models/boot.py
index 3f4981c..92c3dfc 100644
--- a/app/models/boot.py
+++ b/app/models/boot.py
@@ -64,6 +64,7 @@ class BootDocument(modb.BaseDocument):
self._job = job
self._kernel = kernel
self._lab_name = lab_name
+ self.board_instance = None
self.boot_log = None
self.boot_log_html = None
self.boot_result_description = None
@@ -186,6 +187,7 @@ class BootDocument(modb.BaseDocument):
def to_dict(self):
boot_dict = {
models.ARCHITECTURE_KEY: self.arch,
+ models.BOARD_INSTANCE_KEY: self.board_instance,
models.BOARD_KEY: self.board,
models.BOOT_LOG_HTML_KEY: self.boot_log_html,
models.BOOT_LOG_KEY: self.boot_log,
diff --git a/app/models/tests/test_boot_model.py b/app/models/tests/test_boot_model.py
index 8794ec0..90c12a2 100644
--- a/app/models/tests/test_boot_model.py
+++ b/app/models/tests/test_boot_model.py
@@ -49,6 +49,7 @@ class TestBootModel(unittest.TestCase):
boot_doc.file_server_url = "file-server"
boot_doc.file_server_resource = "file-resource"
boot_doc.initrd = "initrd"
+ boot_doc.board_instance = "instance"
expected = {
'_id': 'id',
@@ -87,7 +88,8 @@ class TestBootModel(unittest.TestCase):
"defconfig_full": "defconfig",
"file_server_url": "file-server",
"file_server_resource": "file-resource",
- "initrd": "initrd"
+ "initrd": "initrd",
+ "board_instance": "instance"
}
self.assertDictEqual(expected, boot_doc.to_dict())