From patchwork Thu Jun 3 13:21:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 1487240 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 4Fwml31vfKz9sVb; Thu, 3 Jun 2021 23:21:51 +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 1lonI7-0006Lf-Vg; Thu, 03 Jun 2021 13:21:43 +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 1lonI2-0006LJ-3v for kernel-team@lists.ubuntu.com; Thu, 03 Jun 2021 13:21:38 +0000 Received: from mail-ej1-f70.google.com ([209.85.218.70]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lonI1-0006lt-Sr for kernel-team@lists.ubuntu.com; Thu, 03 Jun 2021 13:21:37 +0000 Received: by mail-ej1-f70.google.com with SMTP id q7-20020a1709063607b02903f57f85ac45so1924257ejb.15 for ; Thu, 03 Jun 2021 06:21:37 -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=AfdrYKNWsz9/8X2NShqub4VIHgDXP5wDMT1pFlLct5w=; b=YlDSNkwTtnIT2WTo3Ez2F9ZgetgYBJ7DIkAYB9p0lJRuF+Kx6atFn6SlFZIoQi0//Y ELmAedMRIObuARjI8R8QOeHCJ1PxKPtKmmQUB0yHZDR0cORUZIkZCaKubxlGEST6LphA 3fqzbSkrSx465+s52m81WmcYcFFma8AGgOBi7HqE4fLRT1xF/jMt6Kfibm51Xs0I5WuD U9fQpL1VieRLk4gLx1LtNemxix+VIegQnmDbUW62ngGE1fz/Jzi84EOGxJg9kOzdntle Aprn09OwWzEFcc5MV+Jj+e0pu5m47jVcD8LLECyuAlAGgk5nQZbXu6L7rRRQWg4ymeny nO1w== X-Gm-Message-State: AOAM532cAzF/4lIA5nvmR8f8WYAyAkD1EQPQpxHpY7NeuSf/O5mJai50 XrrNWHQSKWQmaPOBt3H1PlVJ3i3ZwDRC7X5VL6ozYU4n5rS4mIgNxNP8h+LnpiGHGF4Z8IpLYuj rOLCfSRyU9f4l/PdPP2PK3m27JW6x7TMNsvjoO0j4BA== X-Received: by 2002:aa7:cfd4:: with SMTP id r20mr20658824edy.237.1622726497278; Thu, 03 Jun 2021 06:21:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRRMeTpCxwQkvHOCijzAawe5BNf+X/DO47TuJJqvIAKDhvFs6vbf7cSee9dSzroYldOuxFyg== X-Received: by 2002:aa7:cfd4:: with SMTP id r20mr20658805edy.237.1622726497155; Thu, 03 Jun 2021 06:21:37 -0700 (PDT) Received: from localhost.localdomain (xdsl-188-155-185-9.adslplus.ch. [188.155.185.9]) by smtp.gmail.com with ESMTPSA id b22sm1761656eds.71.2021.06.03.06.21.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Jun 2021 06:21:36 -0700 (PDT) From: Krzysztof Kozlowski To: kernel-team@lists.ubuntu.com Subject: [autotest][PATCH] UBUNTU: SAUCE: fix missing setup on second run Date: Thu, 3 Jun 2021 15:21:18 +0200 Message-Id: <20210603132118.40298-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 autotest had nice idea that test setup can be executed only once on a machine, till test version does not change. If version stays the same, autotest will not run test setup on next executions. However this requirement/feature was not defined clear enough and some tests: 1. Perform cleanup() which reverts the setup() (e.g. ubuntu_boot). 2. Set runtime configuration (e.g. initialize object's field in Python __init__()) during setup() and read it on each test (e.g. ubuntu_sysdig_smoke_test). All of these cases fail. Fix this by calling the test setup() every time. Signed-off-by: Krzysztof Kozlowski --- client/shared/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/shared/utils.py b/client/shared/utils.py index 3e8c9448d23e..367edcd04a03 100644 --- a/client/shared/utils.py +++ b/client/shared/utils.py @@ -862,7 +862,11 @@ def update_version(srcdir, preserve_srcdir, new_version, install, os.path.basename(patch_src)) shutil.copyfile(patch_src, patch_dst) - install(*args, **dargs) + # The test-specific setup is always needed because: + # - it could have been reverted with cleanup() + # - few broken tests might depend on setup() run always + install(*args, **dargs) + if install_needed: pickle.dump(new_version, open(versionfile, 'w'))