aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/handlers/common.py2
-rw-r--r--app/models/__init__.py6
-rw-r--r--app/models/boot.py4
-rw-r--r--app/models/tests/test_boot_model.py6
-rw-r--r--app/utils/bootimport.py3
-rw-r--r--doc/schema-boot.rst18
6 files changed, 36 insertions, 3 deletions
diff --git a/app/handlers/common.py b/app/handlers/common.py
index ed734be..3f7e37e 100644
--- a/app/handlers/common.py
+++ b/app/handlers/common.py
@@ -75,6 +75,8 @@ BOOT_VALID_KEYS = {
models.ENDIANNESS_KEY,
models.FASTBOOT_CMD_KEY,
models.FASTBOOT_KEY,
+ models.FILE_SERVER_RESOURCE_KEY,
+ models.FILE_SERVER_URL_KEY,
models.GIT_BRANCH_KEY,
models.GIT_COMMIT_KEY,
models.GIT_DESCRIBE_KEY,
diff --git a/app/models/__init__.py b/app/models/__init__.py
index 6ff8094..e4ebfe2 100644
--- a/app/models/__init__.py
+++ b/app/models/__init__.py
@@ -21,6 +21,8 @@ ACCEPTED_KEYS = 'accepted'
ADDRESS_KEY = "address"
AGGREGATE_KEY = 'aggregate'
ARCHITECTURE_KEY = 'arch'
+ARM64_ARCHITECTURE_KEY = 'arm64'
+ARM_ARCHITECTURE_KEY = 'arm'
BOARD_KEY = 'board'
BOOT_ID_KEY = 'boot_id'
BOOT_LOAD_ADDR_KEY = 'loadaddr'
@@ -61,6 +63,8 @@ EXPIRES_KEY = 'expires_on'
FASTBOOT_CMD_KEY = 'fastboot_cmd'
FASTBOOT_KEY = 'fastboot'
FIELD_KEY = 'field'
+FILE_SERVER_RESOURCE_KEY = 'file_server_resource'
+FILE_SERVER_URL_KEY = 'file_server_url'
GIT_BRANCH_KEY = 'git_branch'
GIT_COMMIT_KEY = 'git_commit'
GIT_DESCRIBE_KEY = 'git_describe'
@@ -101,8 +105,6 @@ UPDATED_KEY = 'updated_on'
USERNAME_KEY = 'username'
VERSION_KEY = 'version'
WARNINGS_KEY = 'warnings'
-ARM_ARCHITECTURE_KEY = 'arm'
-ARM64_ARCHITECTURE_KEY = 'arm64'
x86_ARCHITECTURE_KEY = 'x86'
# Token special fields.
diff --git a/app/models/boot.py b/app/models/boot.py
index abf8c88..a9d425d 100644
--- a/app/models/boot.py
+++ b/app/models/boot.py
@@ -74,6 +74,8 @@ class BootDocument(modb.BaseDocument):
self.endianness = None
self.fastboot = False
self.fastboot_cmd = None
+ self.file_server_resource = None
+ self.file_server_url = None
self.git_branch = None
self.git_commit = None
self.git_describe = None
@@ -197,6 +199,8 @@ class BootDocument(modb.BaseDocument):
models.ENDIANNESS_KEY: self.endianness,
models.FASTBOOT_CMD_KEY: self.fastboot_cmd,
models.FASTBOOT_KEY: self.fastboot,
+ models.FILE_SERVER_RESOURCE_KEY: self.file_server_resource,
+ models.FILE_SERVER_URL_KEY: self.file_server_url,
models.GIT_BRANCH_KEY: self.git_branch,
models.GIT_COMMIT_KEY: self.git_commit,
models.GIT_DESCRIBE_KEY: self.git_describe,
diff --git a/app/models/tests/test_boot_model.py b/app/models/tests/test_boot_model.py
index 66ec8b1..077e023 100644
--- a/app/models/tests/test_boot_model.py
+++ b/app/models/tests/test_boot_model.py
@@ -46,6 +46,8 @@ class TestBootModel(unittest.TestCase):
boot_doc.git_url = "git-url"
boot_doc.fastboot_cmd = "fastboot"
boot_doc.defconfig_full = "defconfig"
+ boot_doc.file_server_url = "file-server"
+ boot_doc.file_server_resource = "file-resource"
expected = {
'_id': 'id',
@@ -81,7 +83,9 @@ class TestBootModel(unittest.TestCase):
"git_url": "git-url",
"arch": "arm",
"fastboot_cmd": "fastboot",
- "defconfig_full": 'defconfig'
+ "defconfig_full": "defconfig",
+ "file_server_url": "file-server",
+ "file_server_resource": "file-resource"
}
self.assertDictEqual(expected, boot_doc.to_dict())
diff --git a/app/utils/bootimport.py b/app/utils/bootimport.py
index 62ba468..d0c76b7 100644
--- a/app/utils/bootimport.py
+++ b/app/utils/bootimport.py
@@ -313,6 +313,9 @@ def _update_boot_doc_from_json(boot_doc, boot_json, json_pop_f):
boot_doc.endianness = json_pop_f(models.ENDIANNESS_KEY, None)
boot_doc.fastboot = json_pop_f(models.FASTBOOT_KEY, None)
boot_doc.fastboot_cmd = json_pop_f(models.FASTBOOT_CMD_KEY, None)
+ boot_doc.file_server_resource = json_pop_f(
+ models.FILE_SERVER_RESOURCE_KEY, None)
+ boot_doc.file_server_url = json_pop_f(models.FILE_SERVER_URL_KEY, None)
boot_doc.git_branch = json_pop_f(models.GIT_BRANCH_KEY, None)
boot_doc.git_commit = json_pop_f(models.GIT_COMMIT_KEY, None)
boot_doc.git_describe = json_pop_f(models.GIT_DESCRIBE_KEY, None)
diff --git a/doc/schema-boot.rst b/doc/schema-boot.rst
index f3cdc71..1100261 100644
--- a/doc/schema-boot.rst
+++ b/doc/schema-boot.rst
@@ -172,6 +172,14 @@ necessary to use its ``_id`` value.
"type": "string",
"description": "The version of this JSON schema: depends on the POST request"
},
+ "file_server_url": {
+ "type": "string",
+ "description": "The URL where boot log files, or other related files, are stored"
+ },
+ "file_server_resource": {
+ "type": "string",
+ "description": "The server path where the boot related files are stored"
+ },
"metadata": {
"type": "object",
"description": "A free form object that can contain different properties"
@@ -309,6 +317,14 @@ have when sent to the server.
"email": {
"type": "string",
"description": "Optional email address to be notified if the boot report import fails"
+ },
+ "file_server_url": {
+ "type": "string",
+ "description": "The URL where boot log files, or other related files, are stored"
+ },
+ "file_server_resource": {
+ "type": "string",
+ "description": "The server path where the boot related files are stored"
}
},
"required": ["version", "lab_name", "job", "kernel", "defconfig", "board", "arch"]
@@ -319,6 +335,8 @@ Notes
* ``defconfig_full``: This field should be used to specify the full defconfig name if config fragments have been used. It should not contain the architecture (``arch``) value. If not defined, the ``defconfig`` value will be used. Its value should conform to: ``defconfig[+fragment[+fragment ... ]]``.
+* ``file_server_url``, ``file_server_resource``: These field should be used to provide the base URL and the actual path where boot related files (i.e. boot logs) are stored. ``file_server_url`` defines the base path, like ``http://storage.armcloud.us/``, ``file_server_resource`` defines the path on the server, like ``kernel-ci/next/``. When both resources are available, they should be joined together with the file names to form the actual URL. Implementation and default values are left to the user or the visualization tool using the data.
+
More Info
*********