From patchwork Mon Jun 20 03:35:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: akuster808 X-Patchwork-Id: 9366 X-Patchwork-Delegate: akuster808@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58502C43334 for ; Mon, 20 Jun 2022 03:37:10 +0000 (UTC) Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by mx.groups.io with SMTP id smtpd.web10.25939.1655696228390772296 for ; Sun, 19 Jun 2022 20:37:08 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bgtj2g6h; spf=pass (domain: gmail.com, ip: 209.85.216.48, mailfrom: akuster808@gmail.com) Received: by mail-pj1-f48.google.com with SMTP id g16-20020a17090a7d1000b001ea9f820449so9518548pjl.5 for ; Sun, 19 Jun 2022 20:37:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=SyVkvmK+K3EBmF0hBCWqcc0P4zoTY8r4GoaFifOa5Vk=; b=bgtj2g6hbyeuApmrBkX6Xhx5++pohJiKDEUiXkzjEApxgDqaVyTM8Y9fcLm8CrQRE/ bi1qbGoRatbEuMG5V6BpAqC/uATzwqLLamzEqVcoMOEYIAtTJcEvW4XO/rlsbTPdI8/U pEQojGzsowEAzH+QGsDrDQDufJ/izj44hcDOjUoJhklwITwxwfod5PgaZaO1esmTHXI/ 8ZnI5NfKbHbaO9GtrYkwj1NlN9KJtsaGvG0tDBKWHPbif4YMXpfhHuXpJpa/cHaPMPgl n0j1vipCHila7nuG7zwUR+iIEQYGCb5o+pUt92SXo4eWTESGxGVaMOPxnB7+1cT9vkZ8 sr7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=SyVkvmK+K3EBmF0hBCWqcc0P4zoTY8r4GoaFifOa5Vk=; b=yIJln7KLyWHE4crKAdwgtn2d9qg6+kRDafjApJQJZ4DqVEe00xHpuE/VbSeWWgzAfX MA1DZleyjCZJZkvaAy76KM21mt6HgF5MTguQz+H6GC3cW+IcvoYfS36yIpt3BnrZfG+1 9oM9Vg1/fGO3U2/dHDRZCFctoH92iaPF0DS2WQziJOIskUwIBYd3wbqvoRvTsHLwLhYX ZSTevuGLBgixh2kIziciQKETt0PIMBZPuK1gX3AyE7bt+Cpez0eQowoBzI1RhcnFWh1p 832a7On31aQUPSYC8dQlTKSNmoJ5gL6dMQo1MaFDwhKRE/nqcTNitIngEwdr6/kXG01j 6yaA== X-Gm-Message-State: AJIora/aTUoMfuCO1R0df+oWVRDkni2OTfZgB9F4L6ycZtd7nAERfzu5 ltdpQpfY/MmThPgHJ7K6fovC6A7QaO4= X-Google-Smtp-Source: AGRyM1sZECj7EcNG4EM3vRDzDITRYugYQei1XJkJ7/ecHjQT/5Y+7ErkVI470Y860NUovCQmhm/Rew== X-Received: by 2002:a17:902:ea07:b0:16a:2833:3207 with SMTP id s7-20020a170902ea0700b0016a28333207mr2486719plg.86.1655696227260; Sun, 19 Jun 2022 20:37:07 -0700 (PDT) Received: from keaua.hsd1.ca.comcast.net (c-67-181-203-136.hsd1.ca.comcast.net. [67.181.203.136]) by smtp.gmail.com with ESMTPSA id n5-20020a170902d2c500b00163d6164889sm7425536plc.236.2022.06.19.20.37.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Jun 2022 20:37:06 -0700 (PDT) From: Armin Kuster To: yocto@lists.yoctoproject.org Subject: [meta-security][PATCH 1/3] oeqa/clamav drop depricated --list-mirror test Date: Sun, 19 Jun 2022 20:35:02 -0700 Message-Id: <20220620033504.994851-1-akuster808@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 20 Jun 2022 03:37:10 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/57356 Fix download test Signed-off-by: Armin Kuster --- lib/oeqa/runtime/cases/clamav.py | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/lib/oeqa/runtime/cases/clamav.py b/lib/oeqa/runtime/cases/clamav.py index cf83937..e0cad8f 100644 --- a/lib/oeqa/runtime/cases/clamav.py +++ b/lib/oeqa/runtime/cases/clamav.py @@ -1,4 +1,4 @@ -# Copyright (C) 2019 Armin Kuster +# Copyright (C) 2019 - 2022 Armin Kuster # import re from tempfile import mkstemp @@ -48,21 +48,8 @@ class ClamavTest(OERuntimeTestCase): self.assertEqual(status, 0, msg = msg) @OETestDepends(['clamav.ClamavTest.test_ping_clamav_net']) - def test_freshclam_check_mirrors(self): - status, output = self.target.run('freshclam --list-mirrors') - match = re.search('Failures: 0', output) - if not match: - msg = ('freshclam --list-mirrors: failed. ' - 'Status and output:%s and %s' % (status, output)) - self.assertEqual(status, 1, msg = msg) - - @OETestDepends(['clamav.ClamavTest.test_freshclam_check_mirrors']) def test_freshclam_download(self): status, output = self.target.run('freshclam --show-progress') - match = re.search('Database updated', output) - #match = re.search('main.cvd is up to date', output) - if not match: - msg = ('freshclam : DB dowbload failed. ' - 'Status and output:%s and %s' % (status, output)) - self.assertEqual(status, 1, msg = msg) - + msg = ('freshclam : DB dowbload failed. ' + 'Status and output:%s and %s' % (status, output)) + self.assertEqual(status, 0, msg = msg) From patchwork Mon Jun 20 03:35:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: akuster808 X-Patchwork-Id: 9367 X-Patchwork-Delegate: akuster808@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5921BCCA479 for ; Mon, 20 Jun 2022 03:37:10 +0000 (UTC) Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by mx.groups.io with SMTP id smtpd.web08.26231.1655696229471345846 for ; Sun, 19 Jun 2022 20:37:09 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NwHP7wwV; spf=pass (domain: gmail.com, ip: 209.85.214.173, mailfrom: akuster808@gmail.com) Received: by mail-pl1-f173.google.com with SMTP id m14so8600857plg.5 for ; Sun, 19 Jun 2022 20:37:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=wC1iwavS3EqgmrJOpfMcBMPGwzIAHMA58jgYP309X5k=; b=NwHP7wwVENXpjpllNFysPT+x/jG7nCkEc6sMa+43mRiwfo9r1PXdl5pm/3L7/9OEoT 2jje1qcDuE9sWNtoIqDz67scfQWuX3W33NiePAMyKtI/t51MQ2ZI9sntjl5QyEUCZrkM nx/LcrJPMSWJZxtX6a1JhUB11mpWs2svzfREpTFM7Dm24OiQP3gQ8nNQ1+so3gGq6AJm r2wqAMQtczzQMGWSBO5oTsJdm6cPD+BqRTMAyr7Zer0JTbcJrgC7NWtQZAWGf9IKGKvV dsr0B0um9E/T4YilGeg1ex/Eautziq48ZtU0S1QmQ2joQDoRM6cF2bueyt1//otHcmLJ 2haw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wC1iwavS3EqgmrJOpfMcBMPGwzIAHMA58jgYP309X5k=; b=2n7DSIhxDi6MlxEb5eqnXnvrcL8Kf61IP7l77eGVwB8CKK3Uyt6A5OSrZVpCxa6OZW +tjZ3QLa4l4f6+EIDVyyYK1HI9up3egQV/0+ZlDCUttZgg+WjN8ic24d0lH8bZwaCY7i GcYDlAWG0nx25WO2qrpbpcUyvH0znt03J6zHWuAGir765RUmmNIMhD2KCCtzfKsG2GDM ArV8CK9bhzWR7LTgaiUc9AF2+b53WgR72DAAZmPSaQVc4lh30/q/HZNphZXUjk+tohQo QsJnTHyOkEu0cErbF1mYPz1mvlRu4+heS3W6ZkVlDUqam3ya4PW6l4RQWzziS1FogKYt Ixvw== X-Gm-Message-State: AJIora9BINUS3xfZ6GOy8LslzKivyaNvy1DtLXEJMMX2+AC8l18ona92 +vXWvQ06ZhQIMf70bQf3LTpkG0slCeU= X-Google-Smtp-Source: AGRyM1savYJrGW3y9JFCxIZOibft/eGKDY2Z1IaIGtXIsw8h1lF948b2OwwdnOi5X8sKYRRKletxbA== X-Received: by 2002:a17:90b:1a86:b0:1e8:2b80:5e07 with SMTP id ng6-20020a17090b1a8600b001e82b805e07mr24591940pjb.31.1655696228644; Sun, 19 Jun 2022 20:37:08 -0700 (PDT) Received: from keaua.hsd1.ca.comcast.net (c-67-181-203-136.hsd1.ca.comcast.net. [67.181.203.136]) by smtp.gmail.com with ESMTPSA id n5-20020a170902d2c500b00163d6164889sm7425536plc.236.2022.06.19.20.37.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Jun 2022 20:37:07 -0700 (PDT) From: Armin Kuster To: yocto@lists.yoctoproject.org Subject: [meta-security][PATCH 2/3] oeqa: meta-tpm shut swtpm down before and after testing Date: Sun, 19 Jun 2022 20:35:03 -0700 Message-Id: <20220620033504.994851-2-akuster808@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220620033504.994851-1-akuster808@gmail.com> References: <20220620033504.994851-1-akuster808@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 20 Jun 2022 03:37:10 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/57357 fixes: swtpm: Could not open TCP socket: Address already in use Signed-off-by: Armin Kuster --- meta-tpm/lib/oeqa/runtime/cases/swtpm.py | 2 ++ meta-tpm/lib/oeqa/runtime/cases/tpm2.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/meta-tpm/lib/oeqa/runtime/cases/swtpm.py b/meta-tpm/lib/oeqa/runtime/cases/swtpm.py index df47b35..0be5c59 100644 --- a/meta-tpm/lib/oeqa/runtime/cases/swtpm.py +++ b/meta-tpm/lib/oeqa/runtime/cases/swtpm.py @@ -8,11 +8,13 @@ from oeqa.core.decorator.data import skipIfNotFeature class SwTpmTest(OERuntimeTestCase): @classmethod def setUpClass(cls): + cls.tc.target.run('swtpm_ioctl -s --tcp :2322') cls.tc.target.run('mkdir /tmp/myvtpm2') cls.tc.target.run('chown tss:root /tmp/myvtpm2') @classmethod def tearDownClass(cls): + cls.tc.target.run('swtpm_ioctl -s --tcp :2322') cls.tc.target.run('rm -fr /tmp/myvtpm2') @skipIfNotFeature('tpm2','Test tpm2_swtpm_socket requires tpm2 to be in DISTRO_FEATURES') diff --git a/meta-tpm/lib/oeqa/runtime/cases/tpm2.py b/meta-tpm/lib/oeqa/runtime/cases/tpm2.py index e64d19d..8e90dc9 100644 --- a/meta-tpm/lib/oeqa/runtime/cases/tpm2.py +++ b/meta-tpm/lib/oeqa/runtime/cases/tpm2.py @@ -8,10 +8,12 @@ from oeqa.core.decorator.data import skipIfNotFeature class Tpm2Test(OERuntimeTestCase): @classmethod def setUpClass(cls): + cls.tc.target.run('swtpm_ioctl -s --tcp :2322') cls.tc.target.run('mkdir /tmp/myvtpm2') @classmethod def tearDownClass(cls): + cls.tc.target.run('swtpm_ioctl -s --tcp :2322') cls.tc.target.run('rm -fr /tmp/myvtpm2') def check_endlines(self, results, expected_endlines): From patchwork Mon Jun 20 03:35:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: akuster808 X-Patchwork-Id: 9368 X-Patchwork-Delegate: akuster808@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F98EC43334 for ; Mon, 20 Jun 2022 03:37:20 +0000 (UTC) Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by mx.groups.io with SMTP id smtpd.web10.25940.1655696231292155597 for ; Sun, 19 Jun 2022 20:37:11 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YC1svQE0; spf=pass (domain: gmail.com, ip: 209.85.215.175, mailfrom: akuster808@gmail.com) Received: by mail-pg1-f175.google.com with SMTP id 31so9120652pgv.11 for ; Sun, 19 Jun 2022 20:37:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=CRCs4UyPBv+CnbRu16CBP8PsBtoo12TsJ4aDnVKNv0I=; b=YC1svQE0HjOExVOgWepUeNoMGlP9W8K1QJyBUDQ6Be0Cf452zmePgajjnGc1KtBpgN NKfqjhzrYuQm5sSmPlglvu/p1oVXjJ1xu+KOWIAQxCIZDC6S3egGeQy6jUKK4noWJG2e VciUXL13JLn174r84RyyJV6dj+WFqjnLfXEoV0CO5CAFYeWa95MASSZVRoaqv+nd4qvW d89qmseksn+7MUP7AzfM351A/T5DGqyj/8Wu2bvkvARyAlcDYnMhTPyZgH5hbHjLKaSX EECXj4tSm6SgC2eV2+Ehf+OSPslpNQBwXtK9jHfo2j002iDww/BSfopFbmcn3UqA9BdN RyKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CRCs4UyPBv+CnbRu16CBP8PsBtoo12TsJ4aDnVKNv0I=; b=yac9bJZUVKUhJ2ZMA+9TcKVRvQdPk1zdqLXRBYIC7Ep8Mt3dCOmG91FOtcV5p0FfkR QmKCslsiyF3A4kgkGIIjJeakylZiDoT3TTka6gZ6D9281qhqk/pxFl3Lrr6i//W0IeMV DdplUV96AX3NLXo7LJdZAMVglZUJpQs+wyDrX7tc0TBEVYU4bI0Gfzi19oX+jDHcRj0/ PGiAx+GxCbISOwvAONhzziUJWfk20N5PPt81Ig16DZ4yxDjTFRZ44Dl9mvbbUwWUrIQd gTVXFbCy11Wf7+dQ8oJsPDzRocbd55eBy1v6bdg4v0sT9PAlL3EThlV+h/x7PGRABg7U 5daw== X-Gm-Message-State: AJIora+b1TzSIQF1ViQJWw9Ncvhx4u0eMVoeoBvwhVByNemfYHm//qv8 hR6AAMDzCKQ1pzQ4ECL/yRl6XxSh/Rk= X-Google-Smtp-Source: AGRyM1vSTL7df2V2mS6ess2VNb8zkOGPrUDcNbafYi3123P9aQT7eVnRtk6ycWzrS0Km81LO6u2/mQ== X-Received: by 2002:a05:6a00:14c1:b0:51b:eed4:c571 with SMTP id w1-20020a056a0014c100b0051beed4c571mr22511481pfu.72.1655696230235; Sun, 19 Jun 2022 20:37:10 -0700 (PDT) Received: from keaua.hsd1.ca.comcast.net (c-67-181-203-136.hsd1.ca.comcast.net. [67.181.203.136]) by smtp.gmail.com with ESMTPSA id n5-20020a170902d2c500b00163d6164889sm7425536plc.236.2022.06.19.20.37.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Jun 2022 20:37:09 -0700 (PDT) From: Armin Kuster To: yocto@lists.yoctoproject.org Subject: [meta-security][PATCH 3/3] oeqa: shut done swtpm before and after testing Date: Sun, 19 Jun 2022 20:35:04 -0700 Message-Id: <20220620033504.994851-3-akuster808@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220620033504.994851-1-akuster808@gmail.com> References: <20220620033504.994851-1-akuster808@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 20 Jun 2022 03:37:20 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/57358 fixes: swtpm: Could not open TCP socket: Address already in use Signed-off-by: Armin Kuster --- meta-parsec/lib/oeqa/runtime/cases/parsec.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meta-parsec/lib/oeqa/runtime/cases/parsec.py b/meta-parsec/lib/oeqa/runtime/cases/parsec.py index d3d3f2e..11e5572 100644 --- a/meta-parsec/lib/oeqa/runtime/cases/parsec.py +++ b/meta-parsec/lib/oeqa/runtime/cases/parsec.py @@ -12,8 +12,13 @@ from oeqa.core.decorator.data import skipIfNotFeature class ParsecTest(OERuntimeTestCase): @classmethod def setUpClass(cls): + cls.tc.target.run('swtpm_ioctl -s --tcp :2322') cls.toml_file = '/etc/parsec/config.toml' + @classmethod + def tearDownClass(cls): + cls.tc.target.run('swtpm_ioctl -s --tcp :2322') + def setUp(self): super(ParsecTest, self).setUp() if 'systemd' in self.tc.td['DISTRO_FEATURES']: