diff options
-rw-r--r-- | app/models/boot.py | 37 | ||||
-rw-r--r-- | app/models/tests/test_boot_model.py | 8 | ||||
-rw-r--r-- | doc/schema-boot.rst | 8 |
3 files changed, 52 insertions, 1 deletions
diff --git a/app/models/boot.py b/app/models/boot.py index 257724e..60eeb24 100644 --- a/app/models/boot.py +++ b/app/models/boot.py @@ -76,10 +76,14 @@ class BootDocument(modb.BaseDocument): self._boot_result_description = None self._retries = 0 self._version = None + self._fastboot_cmd = None self._git_commit = None self._git_branch = None self._git_describe = None + self._git_url = None + + self._arch = None @property def collection(self): @@ -402,8 +406,39 @@ class BootDocument(modb.BaseDocument): """Set the git describe value.""" self._git_describe = value + @property + def git_url(self): + """The URL of the git repository.""" + return self._git_url + + @git_url.setter + def git_url(self, value): + """Set the URL of the git repository.""" + self._git_url = value + + @property + def fastboot_cmd(self): + """The fastboot command used.""" + return self._fastboot_cmd + + @fastboot_cmd.setter + def fastboot_cmd(self, value): + """Set the fastboot command used.""" + self._fastboot_cmd = value + + @property + def arch(self): + """The architecture of this board.""" + return self._arch + + @arch.setter + def arch(self, value): + """Set the board architecture.""" + self._arch = value + def to_dict(self): boot_dict = { + models.ARCHITECTURE_KEY: self.arch, models.BOARD_KEY: self.board, models.BOOT_LOG_HTML_KEY: self.boot_log_html, models.BOOT_LOG_KEY: self.boot_log, @@ -415,10 +450,12 @@ class BootDocument(modb.BaseDocument): models.DTB_APPEND_KEY: self.dtb_append, models.DTB_KEY: self.dtb, models.ENDIANNESS_KEY: self.endianness, + models.FASTBOOT_CMD_KEY: self.fastboot_cmd, models.FASTBOOT_KEY: self.fastboot, models.GIT_BRANCH_KEY: self.git_branch, models.GIT_COMMIT_KEY: self.git_commit, models.GIT_DESCRIBE_KEY: self.git_describe, + models.GIT_URL_KEY: self.git_url, models.INITRD_ADDR_KEY: self.initrd_addr, models.JOB_ID_KEY: self.job_id, models.JOB_KEY: self.job, diff --git a/app/models/tests/test_boot_model.py b/app/models/tests/test_boot_model.py index effbc0f..a50790e 100644 --- a/app/models/tests/test_boot_model.py +++ b/app/models/tests/test_boot_model.py @@ -43,6 +43,9 @@ class TestBootModel(unittest.TestCase): boot_doc.git_branch = "git-branch" boot_doc.git_commit = "git-commit" boot_doc.git_describe = "git-describe" + boot_doc.git_url = "git-url" + boot_doc.arch = "arm" + boot_doc.fastboot_cmd = "fastboot" expected = { '_id': 'id', @@ -74,7 +77,10 @@ class TestBootModel(unittest.TestCase): 'warnings': 2, "git_commit": "git-commit", "git_branch": "git-branch", - "git_describe": "git-describe" + "git_describe": "git-describe", + "git_url": "git-url", + "arch": "arm", + "fastboot_cmd": "fastboot" } self.assertDictEqual(expected, boot_doc.to_dict()) diff --git a/doc/schema-boot.rst b/doc/schema-boot.rst index d96cdef..6530567 100644 --- a/doc/schema-boot.rst +++ b/doc/schema-boot.rst @@ -76,6 +76,10 @@ necessary to use its ``_id`` value. } } }, + "arch" : { + "type": "string", + "description": "The architecture type of this board" + }, "git_branch": { "type": "string", "description": "The branch used for boot testing" @@ -208,6 +212,10 @@ have when sent to the server. "type": "string", "description": "The name of the board: it must be a valid and recognized name" }, + "arch" : { + "type": "string", + "description": "The architecture type of this board" + }, "git_branch": { "type": "string", "description": "The branch used for boot testing" |