From patchwork Tue Oct 1 08:28:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 49856 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 3AC9DCE7CF6 for ; Tue, 1 Oct 2024 08:29:18 +0000 (UTC) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) by mx.groups.io with SMTP id smtpd.web11.76653.1727771353474559408 for ; Tue, 01 Oct 2024 01:29:13 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=kw75vsp9; spf=pass (domain: linaro.org, ip: 209.85.208.177, mailfrom: mikko.rapeli@linaro.org) Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2fad5024b8dso15594831fa.1 for ; Tue, 01 Oct 2024 01:29:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727771351; x=1728376151; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YMQTWSW2pxYCYeqvg5XPpJ4xKvMr/05hM5ADcPNUguk=; b=kw75vsp9WhXnBPERb0sexDgUX5TjsoAZ2IgLvcS2vC9urBdrzslFQ6pkANTnMICnpV 7gQigrDCwd98dwP176w/Z2CjyhaCxZWpPe6ttErG0YV+9EmuAtjPnpcuE8v3qHDqKk0P ZsSZrEiIXzszvKkN/ZiZQsp2VVBIl5F8xP4KLfM4D65cARggecAE85elSd1r/LjGLmMs I6vpfDep4sPx/RQCC20WkkjAgNbqWXRcDrGh28wWjlxUtRCZ0cBG1u+J8oKSIouU4Yul 3XcjiDIcOSXflhfJWVG3CcCeKDZQ9W4IH2SKtQEJ7WSX53QvyfKiLmtLDKCgnEnb+a3e v79Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727771351; x=1728376151; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YMQTWSW2pxYCYeqvg5XPpJ4xKvMr/05hM5ADcPNUguk=; b=Z+aGGbugWT9rmWnq074SotVDaVUo5JVo2peUx8Veawzqw9lCFh7ZlakZ7VSXnN3I9O 2u9VbJP0rRC991SQYAtR2s9+FM8ZAW7xMdG6I6FrgYiZFd/wFS0toPehMVVoiPjkNA// F/pU10pfdsMglirwAqc9mlZC2xUljPnWYu6fFTRb4ST/iiZINgnIYkhPNHrWCVeLMqnH ya/wjxNVvLcGNQ6NCkQ6sKedRbmwP3Ewnc90UsVMC3B0Eqasynf4yqOifRAaz4fMR9ya YkW5lUpLucZpPj9SiioqU/cjbuzodAJW2vjgVFOuktxBynYfC9dQAQXDHCjg33Jn+dOj MhXA== X-Gm-Message-State: AOJu0YxiNo99BdlsRsmfKwql8aPUUSJcz/heWEXyuiSlWJqL1bje/HoB c9Xp0tML9XYxAehJlk4BbJ7jcYxLjkGbKEp9pGuG23mc9ph/+SImwpSceCSWiSGN901OIrS/PhR hIik= X-Google-Smtp-Source: AGHT+IFz9XSNszSQUPDhSvPKF8HXx+kge7br93KEuZoy+fXrttJWyyjnK3YhAH6ecf3/PVMvhn5Mmw== X-Received: by 2002:a2e:bc19:0:b0:2fa:c873:45ce with SMTP id 38308e7fff4ca-2fac873471cmr28369461fa.30.1727771351441; Tue, 01 Oct 2024 01:29:11 -0700 (PDT) Received: from localhost.localdomain (78-27-76-97.bb.dnainternet.fi. [78.27.76.97]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2facb2ce928sm7734221fa.76.2024.10.01.01.29.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2024 01:29:09 -0700 (PDT) From: Mikko Rapeli To: openembedded-core@lists.openembedded.org Cc: Mikko Rapeli Subject: [PATCH v5 10/11] oeqa selftest wic.py: add TEST_RUNQEMUPARAMS to runqemu Date: Tue, 1 Oct 2024 11:28:20 +0300 Message-ID: <20241001082821.26115-11-mikko.rapeli@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241001082821.26115-1-mikko.rapeli@linaro.org> References: <20241001082821.26115-1-mikko.rapeli@linaro.org> 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 ; Tue, 01 Oct 2024 08:29:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/205144 To support "slirp" networking on shared build machines instead of tun/tap devices. Users can set TEST_RUNQEMUPARAMS = "slirp" in their build/conf/local.conf to run selftests using "slirp" networking. The same works for testimage.bbclass and oeqa runtime tests. Signed-off-by: Mikko Rapeli --- meta/lib/oeqa/selftest/cases/wic.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index b616759209..f2a46c965b 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py @@ -939,7 +939,8 @@ class Wic2(WicTestCase): bitbake('wic-image-minimal') self.remove_config(config) - with runqemu('wic-image-minimal', ssh=False, runqemuparams='nographic') as qemu: + runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', 'wic-image-minimal') or "" + with runqemu('wic-image-minimal', ssh=False, runqemuparams='%s nographic' % (runqemu_params)) as qemu: cmd = "mount | grep '^/dev/' | cut -f1,3 -d ' ' | egrep -c -e '/dev/sda1 /boot' " \ "-e '/dev/root /|/dev/sda2 /' -e '/dev/sda3 /media' -e '/dev/sda4 /mnt'" status, output = qemu.run_serial(cmd) @@ -959,8 +960,9 @@ class Wic2(WicTestCase): bitbake('core-image-minimal ovmf') self.remove_config(config) + runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', 'core-image-minimal') or "" with runqemu('core-image-minimal', ssh=False, - runqemuparams='nographic ovmf', image_fstype='wic') as qemu: + runqemuparams='%s nographic ovmf' % (runqemu_params), image_fstype='wic') as qemu: cmd = "grep sda. /proc/partitions |wc -l" status, output = qemu.run_serial(cmd) self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) @@ -1154,8 +1156,9 @@ class Wic2(WicTestCase): bitbake('core-image-minimal-mtdutils') self.remove_config(config) + runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', 'core-image-minimal-mtdutils') or "" with runqemu('core-image-minimal-mtdutils', ssh=False, - runqemuparams='nographic', image_fstype='wic') as qemu: + runqemuparams='%s nographic' % (runqemu_params), image_fstype='wic') as qemu: cmd = "grep sda. /proc/partitions |wc -l" status, output = qemu.run_serial(cmd) self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) @@ -1214,8 +1217,9 @@ class Wic2(WicTestCase): bitbake('core-image-minimal') self.remove_config(config) + runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', 'core-image-minimal') or "" with runqemu('core-image-minimal', ssh=False, - runqemuparams='nographic', image_fstype='wic') as qemu: + runqemuparams='%s nographic' % (runqemu_params), image_fstype='wic') as qemu: # Check that we have ONLY two /dev/sda* partitions (/boot and /) cmd = "grep sda. /proc/partitions | wc -l" status, output = qemu.run_serial(cmd) @@ -1446,8 +1450,8 @@ class Wic2(WicTestCase): os.rename(image_path, image_path + '.bak') os.rename(new_image_path, image_path) - # Check if it boots in qemu - with runqemu('core-image-minimal', ssh=False, runqemuparams='nographic') as qemu: + runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', 'core-image-minimal') or "" + with runqemu('core-image-minimal', ssh=False, runqemuparams='%s nographic' % (runqemu_params)) as qemu: cmd = "ls /etc/" status, output = qemu.run_serial('true') self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output))