From 17e76cfa4f45b2319cda0aef29c849a3e11f814d Mon Sep 17 00:00:00 2001 From: Milo Casagrande Date: Fri, 5 Dec 2014 13:15:03 +0100 Subject: Add board_instance field for boot model. Change-Id: Ic91f8ff906c9650a02cdbebb7e8df792390cb350 --- app/models/__init__.py | 1 + app/models/boot.py | 2 ++ app/models/tests/test_boot_model.py | 4 +++- 3 files changed, 6 insertions(+), 1 deletion(-) (limited to 'app/models') 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()) -- cgit v1.2.3