Skip to content

Commit

Permalink
Add support uboot-env object
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathas-Conceicao <jonathas.conceicao@ossystems.com.br>
  • Loading branch information
Jonathas-Conceicao authored and otavio committed Sep 10, 2020
1 parent 6efd61c commit 67aae53
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ install_requires =
pycryptodomex
requests >= 2.20.0
rfc3987 >= 1.3
updatehub-package-schema >= 1.0.3
updatehub-package-schema >= 1.1.0

[options.entry_points]
console_scripts =
Expand Down
1 change: 1 addition & 0 deletions tests/core/fixtures/modes/uboot-env_default.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uboot-env_default.txt [mode: uboot-env]
1 change: 1 addition & 0 deletions tests/core/fixtures/modes/uboot-env_full.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uboot-env_full.txt [mode: uboot-env]
41 changes: 41 additions & 0 deletions tests/core/modes/test_uboot_env.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright (C) 2020 O.S. Systems Software LTDA.
# SPDX-License-Identifier: GPL-2.0

from utils import UHUTestCase
from .base import ModeTestCaseMixin


class UbootEnvObjectTestCase(ModeTestCaseMixin, UHUTestCase):
mode = 'uboot-env'

def setUp(self):
super().setUp()
self.default_options = {
'filename': self.fn,
'mode': self.mode,
}
self.default_template = {
'mode': 'uboot-env',
'filename': self.fn,
}
self.default_metadata = {
'filename': self.fn,
'sha256sum': self.sha256sum,
'size': self.size,
'mode': 'uboot-env',
}

self.full_options = {
'filename': self.fn,
'mode': self.mode,
}
self.full_template = {
'mode': 'uboot-env',
'filename': self.fn,
}
self.full_metadata = {
'filename': self.fn,
'sha256sum': self.sha256sum,
'size': self.size,
'mode': 'uboot-env',
}
14 changes: 14 additions & 0 deletions uhu/core/modes.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,20 @@ class UBIFSObject(BaseObject):
]


class UbootEnv(BaseObject):
mode = 'uboot-env'
allow_compression = False
allow_install_condition = False
options = [
'filename',
'size',
'sha256sum',
]
required_options = [
'filename',
]


class MenderObject(BaseObject):
mode = 'mender'
allow_compression = False
Expand Down

0 comments on commit 67aae53

Please sign in to comment.