Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support uboot-env object #62

Merged
merged 1 commit into from
Sep 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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