From patchwork Tue Mar 6 13:01:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zygmunt Krynicki X-Patchwork-Id: 7114 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 C84AD23E80 for ; Tue, 6 Mar 2012 13:01:12 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id 72BA4A1831D for ; Tue, 6 Mar 2012 13:01:12 +0000 (UTC) Received: by yhpp61 with SMTP id p61so2495843yhp.11 for ; Tue, 06 Mar 2012 05:01:12 -0800 (PST) Received: from mr.google.com ([10.50.195.234]) by 10.50.195.234 with SMTP id ih10mr10331369igc.50.1331038871944 (num_hops = 1); Tue, 06 Mar 2012 05:01:11 -0800 (PST) Received: by 10.50.195.234 with SMTP id ih10mr8563959igc.50.1331038871866; Tue, 06 Mar 2012 05:01:11 -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 k18csp56640ibg; Tue, 6 Mar 2012 05:01:11 -0800 (PST) Received: by 10.180.104.137 with SMTP id ge9mr18243553wib.20.1331038870660; Tue, 06 Mar 2012 05:01:10 -0800 (PST) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id u4si11776575wid.6.2012.03.06.05.01.10 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 06 Mar 2012 05:01: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 1S4u0r-0006SX-DD for ; Tue, 06 Mar 2012 13:01:09 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 4F41AE04E1 for ; Tue, 6 Mar 2012 13:01:09 +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: <20120306130109.976.48299.launchpad@ackee.canonical.com> Date: Tue, 06 Mar 2012 13:01:09 -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: d838d710b728264a807ed9624a87114ec868d0a4 X-Gm-Message-State: ALoCoQlmHsJZ8lNSwniHoijkigJ8c0e7fAN61u3xkeGh/mL9oh2BPauNefRPnkZgqy8CmPsu4P/D ------------------------------------------------------------ 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 = {