From patchwork Tue Mar 6 13:46:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zygmunt Krynicki X-Patchwork-Id: 7115 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id EC94623E68 for ; Tue, 6 Mar 2012 13:46:13 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id 84A5BA18329 for ; Tue, 6 Mar 2012 13:46:13 +0000 (UTC) Received: by yenl4 with SMTP id l4so2519531yen.11 for ; Tue, 06 Mar 2012 05:46:13 -0800 (PST) Received: by 10.50.183.137 with SMTP id em9mr467606igc.58.1331041572776; Tue, 06 Mar 2012 05:46:12 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.53.18 with SMTP id k18csp57668ibg; Tue, 6 Mar 2012 05:46:11 -0800 (PST) Received: by 10.216.82.141 with SMTP id o13mr6646996wee.2.1331041570806; Tue, 06 Mar 2012 05:46:10 -0800 (PST) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id v6si13605644weq.72.2012.03.06.05.46.10 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 06 Mar 2012 05:46:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1S4uiQ-0002bB-5n for ; Tue, 06 Mar 2012 13:46:10 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 1CF5AE0801 for ; Tue, 6 Mar 2012 13:46:10 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-test X-Launchpad-Branch: ~linaro-validation/lava-test/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 124 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-test/trunk] Rev 124: Allow the user to pre-define analyzer_assigned_uuid Message-Id: <20120306134610.12739.57408.launchpad@ackee.canonical.com> Date: Tue, 06 Mar 2012 13:46:10 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14900"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 31293b627683c5e66bbc608a47802a2de92dfffc X-Gm-Message-State: ALoCoQk0/jftCnav7hEKE3Ger1N8vWXq75FkDfF5DkGd0CvYrXBW5XHwbxTg6SfNQs2ZdyuhunmS ------------------------------------------------------------ revno: 124 fixes bug: https://launchpad.net/bugs/934164 committer: Zygmunt Krynicki branch nick: fix-934164 timestamp: Tue 2012-03-06 13:59:07 +0100 message: Allow the user to pre-define analyzer_assigned_uuid modified: doc/changes.rst lava_test/commands.py lava_test/core/artifacts.py --- lp:lava-test https://code.launchpad.net/~linaro-validation/lava-test/trunk You are subscribed to branch lp:lava-test. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-test/trunk/+edit-subscription === modified file 'doc/changes.rst' --- doc/changes.rst 2012-03-06 12:29:33 +0000 +++ doc/changes.rst 2012-03-06 12:59:07 +0000 @@ -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' --- lava_test/commands.py 2012-01-17 12:42:46 +0000 +++ lava_test/commands.py 2012-03-06 12:59:07 +0000 @@ -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' --- lava_test/core/artifacts.py 2011-09-12 09:19:10 +0000 +++ lava_test/core/artifacts.py 2012-03-06 12:59:07 +0000 @@ -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 = {