diff --git a/README.md b/README.md index 07aa60e..c82a1b9 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ If you want to leave the firmware image, manifest and campaign to your account a New manifest-tool 2.0.0 supports two different versions of manifest schemas. Update test's manifest creation defaults to 'v1' manifest version, but you can set the version e.g to 'v3' by the `--manifest_version=v3` startup argument. Supported versions at the moment are 'v1' and 'v3'. +If you need to pass in an explicit firmware version, versus using a time-stamp-generated value, use the `--fw_version` option. ### Results output diff --git a/pelion_test_lib/fixtures/cloud_fixtures.py b/pelion_test_lib/fixtures/cloud_fixtures.py index 11746d6..f6c4d40 100644 --- a/pelion_test_lib/fixtures/cloud_fixtures.py +++ b/pelion_test_lib/fixtures/cloud_fixtures.py @@ -116,6 +116,7 @@ def update_device(cloud, client, request): binary_path = request.config.getoption('update_bin', None) manifest_tool_path = request.config.getoption('manifest_tool') manifest_version = request.config.getoption('manifest_version', 'v1') + fw_version = request.config.getoption('fw_version', None) no_cleanup = request.config.getoption('no_cleanup', False) delta_manifest = request.config.getoption('delta_manifest', None) local_bin = request.config.getoption('local_binary', None) @@ -144,7 +145,8 @@ def update_device(cloud, client, request): firmware_url=fw_image['datafile'], update_image_path=binary_path, delta_manifest=delta_manifest, - manifest_version=manifest_version) + manifest_version=manifest_version, + fw_version=fw_version) assert manifest_file is not None, 'Manifest file was not created' manifest = cloud.update.upload_firmware_manifest(manifest_file, expected_status_code=201).json() diff --git a/pelion_test_lib/tools/manifest_tool.py b/pelion_test_lib/tools/manifest_tool.py index 1198f0e..91626f0 100644 --- a/pelion_test_lib/tools/manifest_tool.py +++ b/pelion_test_lib/tools/manifest_tool.py @@ -60,7 +60,7 @@ def init(working_path, vendor_domain=None, model_name=None): def create_manifest(path, firmware_url, update_image_path, output='output.manifest', delta_manifest=None, - manifest_version='v1'): + manifest_version='v1', fw_version=None): """ Create a manifest file :param path: Manifest-tool path @@ -80,7 +80,11 @@ def create_manifest(path, firmware_url, update_image_path, output='output.manife if os.path.isfile(output): os.remove(output) if manifest_version == 'v1': - cmd = [MANIFEST_DEV_TOOL, 'create-v1', '-u', firmware_url, '-o', output] + if fw_version is None: + cmd = [MANIFEST_DEV_TOOL, 'create-v1', '-u', firmware_url, '-o', output] + else: + cmd = [MANIFEST_DEV_TOOL, 'create-v1', '-u', firmware_url, '-o', output, '--fw-version', fw_version] + elif manifest_version == 'v3': cmd = [MANIFEST_DEV_TOOL, 'create', '-u', firmware_url, '-o', output, '--sign-image'] else: diff --git a/tests/conftest.py b/tests/conftest.py index fef32d9..86eb724 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -39,7 +39,7 @@ def pytest_addoption(parser): parser.addoption('--local_binary', action='store', help='local linux client binary path') parser.addoption('--use_one_apikey', action='store_true', default=False, help='do not create temp api key') parser.addoption('--manifest_version', action='store', default='v1', help='manifest template version') - + parser.addoption('--fw_version', action='store', default=None, help='firmware version') def pytest_report_teststatus(report): """