From patchwork Thu Jun 3 13:03:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 1487228 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FwmLg6YkKz9sPf; Thu, 3 Jun 2021 23:04:11 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1lon14-0005Dl-7K; Thu, 03 Jun 2021 13:04:06 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lon0y-0005Cm-Gy for kernel-team@lists.ubuntu.com; Thu, 03 Jun 2021 13:04:00 +0000 Received: from mail-ed1-f71.google.com ([209.85.208.71]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lon0y-0004w3-AK for kernel-team@lists.ubuntu.com; Thu, 03 Jun 2021 13:04:00 +0000 Received: by mail-ed1-f71.google.com with SMTP id c21-20020a0564021015b029038c3f08ce5aso3229384edu.18 for ; Thu, 03 Jun 2021 06:04:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Q57urVKAkSBkeeATKyKwtz6YZ4kDgoRWVIwrLInUjdo=; b=s15njR36I9SSB8mYwoNt0Bh7TJEHgFr8la7AFsZb8TCuLfzTZu/QQB7xwyElasqqVN shyah7y/OfUY964cJDew4RhEmODkxkdk4MKucMsYCMh6P9BXWuIrBi0tZclEN2KvUVMO 7LYjoy6m9rKW37JdcnVS+C/LvmJ8Sur32FRmgPLMjSIMwv0JLDKgkFEvYOzztHmewlmC j53hFPx6zu0Pi7rKCv/2edSMgeiwhzRLVUB5PWk48S07YxOT0yFhHqu57lSEf+c3nRdL 8918hryk28lEzBtzfq6MttHlNuxgPrP6lyfupe9zqES77nH1xLMA+p+nXFkGbc1wFaBU Ztvg== X-Gm-Message-State: AOAM531gWPPC5/Sp8ufm7fcT7Qv1/DuZaaieS9kf3olcjKu2jDrZDLMl G7N5uNWjcqkwWhffM8p5Dp1NNJSWMqbcE29ZxJ5Daf3RteeOb6Ca/N1w1GPH/qWyToFJebRe4hH L/q/Nbgn0Sxlf1OdxXkNxQ8LtCtb/SlM8jJyAujZNBg== X-Received: by 2002:aa7:dd81:: with SMTP id g1mr20522913edv.274.1622725439684; Thu, 03 Jun 2021 06:03:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9//SDwNdD8nnDa2a51Y+ztFCGH77CBntTzY7Rx+X7qYxsQyv2yNerQGnkN9NR3ht836wSgg== X-Received: by 2002:aa7:dd81:: with SMTP id g1mr20522892edv.274.1622725439452; Thu, 03 Jun 2021 06:03:59 -0700 (PDT) Received: from localhost.localdomain (xdsl-188-155-185-9.adslplus.ch. [188.155.185.9]) by smtp.gmail.com with ESMTPSA id t5sm1530056eje.29.2021.06.03.06.03.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Jun 2021 06:03:59 -0700 (PDT) From: Krzysztof Kozlowski To: kernel-team@lists.ubuntu.com Subject: [PATCH v2] UBUNTU: SAUCE: ubuntu_boot: fix second test execution Date: Thu, 3 Jun 2021 15:03:52 +0200 Message-Id: <20210603130352.38472-1-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" The setup() might not be called on second test run and actually autotest design assumes setup() for given version will be called exactly once. It is expected from setup() to modify only persistent state of the system, so on next run it's execution is not needed. Runtime-only settings should not be configured via setup(). This fixes failure on second test execution: 00:54:03 INFO | START ubuntu_boot.log_check ubuntu_boot.log_check 00:54:03 DEBUG| Persistent state client._record_indent now set to 2 00:54:03 DEBUG| Persistent state client.unexpected_reboot now set to ('ubuntu_boot.log_check', 'ubuntu_boot.log_check') 00:54:03 DEBUG| Waiting for pid 19403 for 300 seconds 00:54:03 WARNI| System python is too old, crash handling disabled 00:54:03 ERROR| Exception escaping from test: Traceback (most recent call last): File "/home/azure/autotest/client/shared/test.py", line 411, in _exec _call_test_function(self.execute, *p_args, **p_dargs) File "/home/azure/autotest/client/shared/test.py", line 830, in _call_test_function raise error.UnhandledTestFail(e) UnhandledTestFail: Unhandled AttributeError: 'ubuntu_boot' object has no attribute 'centos' Traceback (most recent call last): File "/home/azure/autotest/client/shared/test.py", line 823, in _call_test_function return func(*args, **dargs) File "/home/azure/autotest/client/shared/test.py", line 291, in execute postprocess_profiled_run, args, dargs) File "/home/azure/autotest/client/shared/test.py", line 212, in _call_run_once self.run_once(*args, **dargs) File "/home/azure/autotest/client/tests/ubuntu_boot/ubuntu_boot.py", line 63, in run_once if not self.log_check(): File "/home/azure/autotest/client/tests/ubuntu_boot/ubuntu_boot.py", line 25, in log_check if self.centos: AttributeError: 'ubuntu_boot' object has no attribute 'centos' Fixes: e14cb0e1bd0c ("UBUNTU SAUCE: ubuntu_boot Centos Support") Signed-off-by: Krzysztof Kozlowski --- Changes since v1: 1. Add prefix to subject --- ubuntu_boot/ubuntu_boot.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ubuntu_boot/ubuntu_boot.py b/ubuntu_boot/ubuntu_boot.py index a67f21d49fc7..b67a588285f8 100644 --- a/ubuntu_boot/ubuntu_boot.py +++ b/ubuntu_boot/ubuntu_boot.py @@ -12,17 +12,17 @@ class ubuntu_boot(test.test): cmd = 'yes "" | DEBIAN_FRONTEND=noninteractive apt-get install --yes --force-yes ' + ' '.join(pkgs) self.results = utils.system_output(cmd, retain_output=True) + def log_check(self): + '''Test for checking error patterns in log files''' '''Centos Specific Boot Test Checks''' - self.centos = False + centos = False os_dist = platform.linux_distribution()[0].split(' ')[0] if os_dist == 'CentOS': - self.centos = True + centos = True - def log_check(self): - '''Test for checking error patterns in log files''' # dmesg will be cleared out in autotest with dmesg -c before the test starts # Let's check for /var/log/syslog instead - if self.centos: + if centos: logfile = '/var/log/messages' else: logfile = '/var/log/syslog'