=== modified file 'doc/changes.rst'
@@ -6,6 +6,10 @@
Version 0.5
===========
+ * Allow users to override ``analyzer_assigned_uuid`` by passing
+ ``--analyzer-assigned-uuid`` to the run command. This change fixes
+ https://bugs.launchpad.net/lava-dispatcher/+bug/934164
+
.. _version_0_4:
Version 0.4
=== modified file 'lava_test/commands.py'
@@ -203,6 +203,17 @@
" test results created on embedded devices"
" that often have inaccurate real time"
" clock settings."))
+ group.add_argument("--analyzer-assigned-uuid",
+ default=None,
+ metavar="UUID",
+ help=("Set the analyzer_assigned_uuid to the specified value."
+ " This will prevent the test device from attempting"
+ " to generate an UUID by itself. This option may be"
+ " required if the test device has unreliable real"
+ " time clock (no battery backed, not ensure to be"
+ " up-to-date) and unreliable/random hardware ethernet "
+ " address."))
+
group = parser.add_argument_group("complete bundle configuration")
group.add_argument("-o", "--output",
default=None,
@@ -229,8 +240,14 @@
"To provide multiple options, use quote character."
"Example : lava-test run peacekeeper -t firefox. "
"Example of multiple options : lava-test run foo_test -t 'arg1 arg2'")
-
def invoke_with_test(self, test):
+ # Validate analyzer_assigned_uuid
+ if self.args.analyzer_assigned_uuid:
+ import uuid
+ try:
+ self.analyzer_assigned_uuid=str(uuid.UUID(self.args.analyzer_assigned_uuid))
+ except ValueError as exc:
+ self.parser.error("--analyzer-assigned-uuid: %s" % exc)
if not test.is_installed:
raise LavaCommandError("The specified test is not installed")
try:
@@ -246,7 +263,8 @@
artifacts.create_initial_bundle(
self.args.skip_software_context,
self.args.skip_hardware_context,
- self.args.trusted_time)
+ self.args.trusted_time,
+ self.args.analyzer_assigned_uuid)
artifacts.save_bundle()
if self.args.output:
parse_results = test.parse(artifacts)
=== modified file 'lava_test/core/artifacts.py'
@@ -137,7 +137,8 @@
def create_initial_bundle(self,
skip_software_context=False,
skip_hardware_context=False,
- time_check_performed=False):
+ time_check_performed=False,
+ analyzer_assigned_uuid=None):
"""
Create the bundle object.
@@ -150,7 +151,8 @@
"""
TIMEFORMAT = '%Y-%m-%dT%H:%M:%SZ'
# Generate UUID and analyzer_assigned_date for the test run
- analyzer_assigned_uuid = str(uuid.uuid1())
+ if analyzer_assigned_uuid is None:
+ analyzer_assigned_uuid = str(uuid.uuid1())
analyzer_assigned_date = datetime.datetime.utcnow()
# Create basic test run structure
test_run = {