From patchwork Sun Jul 5 10:23:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 1323015 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=free.fr Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=E798a6LG; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B04YG2gfgz9sSJ for ; Sun, 5 Jul 2020 20:23:46 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id DFA3F86BCF; Sun, 5 Jul 2020 10:23:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0MssQNPTg0QG; Sun, 5 Jul 2020 10:23:44 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 457BD86CA1; Sun, 5 Jul 2020 10:23:44 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id B44DA1BF321 for ; Sun, 5 Jul 2020 10:23:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id B12A186CA1 for ; Sun, 5 Jul 2020 10:23:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KTd7IfKN7UQk for ; Sun, 5 Jul 2020 10:23:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 0269086BCF for ; Sun, 5 Jul 2020 10:23:43 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id z2so15373623wrp.2 for ; Sun, 05 Jul 2020 03:23:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BZP0hUDiBn8TMLaHZ9GYi7/pJCeqxW3AMXw3Al6It3M=; b=E798a6LGz3ihsNcYcwE3dvWQdkcbTrSh68aedV9aZBDXjlkmnY9/7R4EPWSoyeBwoJ 41MqiU1XTwHjGIHni7vu9fLyI0zqCIdyt907dhWdcH5FuGcntcgi8xtbaID8lk+qexqp XvRPy+nwoE5SbPs+rk2QTQeh5N7QtuCLBSLLwMVqIDXQHAaJT5vmCCwpTcp+wihGedfq RV+SfAgTsHHVeKkgfuFCbILR8mS8P+V0+zwU7pnhLEWl/lGjvCkjX7sSHIDtvpzqN7u0 GTRQcSbWcfzGbTebxCX4W+ZGM2mT0Ebm4/DulxkgduBSihW47ReVuGOn16CFQOD6McdH iQSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=BZP0hUDiBn8TMLaHZ9GYi7/pJCeqxW3AMXw3Al6It3M=; b=tOxq0V11IBhGxL2sJOS23KPh8c80TpXSrLYGpM3eyyaw7a2e7Vj1BhDt3yXp+edLlj SjTCUFLpUl0pmfOs2qhvZGPvV6fRgsAIP/lTSEFKsiPqeQrKbvprzXY9ZiNO8EZqYF20 0Q0wJIe9F3XqkUWT82Cy6G2NhtdiBJxoW1XEHmkjhzGK6y4t3N1KHizH16ELnmnvVWsv 4N4q04z7J3ARhnr2jli7xwDeEYPpmVfypz1E2nxSr4hBNlTk7ZRzwpope8n4zOlHP/5i KGzyCJwK3oL0+zHdrXDgli005wvVbMBjaxFoGIOCy1frV1fY3k2AgxP2cFvIRNsNXVQa tw4Q== X-Gm-Message-State: AOAM532ZFESEkTFYRs7DGbBHnd8OVVz3Hj1kGhNrEkvQw5gynNUnlEyv +phD7XxUeSVqUVAWzD2oltm7kkJS X-Google-Smtp-Source: ABdhPJyPPsKOtfyHpt5gXUiiykG9HLXVSbyBW13XmetElE5TIu05vQ5GUXkGvMAl9Fc4/cHPveWUiA== X-Received: by 2002:adf:8b5a:: with SMTP id v26mr43429154wra.165.1593944621348; Sun, 05 Jul 2020 03:23:41 -0700 (PDT) Received: from scaer.home ([2a01:cb19:8b51:cb00:6d33:104b:d5db:8d8a]) by smtp.gmail.com with ESMTPSA id u20sm18215471wmm.15.2020.07.05.03.23.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jul 2020 03:23:40 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 5 Jul 2020 12:23:37 +0200 Message-Id: X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [Buildroot] [PATCH 3/4 v4] support/testsuite: de-duplicate the systemd runtime tests X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Norbert Lange , "Yann E. MORIN" Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Of all the systemd init tests, only one does some additional tests, and for just this lone wolf, we duplicate the test function. Signed-off-by: Yann E. MORIN --- support/testing/tests/init/test_systemd.py | 32 ++++++++-------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/support/testing/tests/init/test_systemd.py b/support/testing/tests/init/test_systemd.py index 371be4ad7d..cf952bef44 100644 --- a/support/testing/tests/init/test_systemd.py +++ b/support/testing/tests/init/test_systemd.py @@ -21,8 +21,9 @@ class InitSystemSystemdBase(InitSystemBase): # BR2_TARGET_ROOTFS_TAR is not set """.format(infra.filepath("conf/binfmt-misc-kernel-fragment.config")) - def check_init(self): - super(InitSystemSystemdBase, self).check_init("/lib/systemd/systemd") + def check_systemd(self, fs): + self.start_emulator(fs, "zImage", "vexpress-v2p-ca9") + self.check_init("/lib/systemd/systemd") # Test all units are OK output, _ = self.emulator.run("systemctl --no-pager --failed --no-legend") @@ -36,6 +37,9 @@ class InitSystemSystemdBase(InitSystemBase): output, _ = self.emulator.run("journalctl --no-pager --lines 1 --quiet") self.assertEqual(len(output), 1) + # Check the network is up + self.check_network("eth0") + class TestInitSystemSystemdRoNetworkd(InitSystemSystemdBase): config = InitSystemSystemdBase.config + \ @@ -47,9 +51,7 @@ class TestInitSystemSystemdRoNetworkd(InitSystemSystemdBase): """.format(infra.filepath("tests/init/systemd-factory")) def test_run(self): - self.start_emulator("squashfs", "zImage", "vexpress-v2p-ca9") - self.check_init() - self.check_network("eth0") + self.check_systemd("squashfs") # This one must be executed on the target, to check that # the factory feature works as expected @@ -66,9 +68,7 @@ class TestInitSystemSystemdRwNetworkd(InitSystemSystemdBase): """ def test_run(self): - self.start_emulator("ext2", "zImage", "vexpress-v2p-ca9") - self.check_init() - self.check_network("eth0") + self.check_systemd("ext2") class TestInitSystemSystemdRoIfupdown(InitSystemSystemdBase): @@ -81,9 +81,7 @@ class TestInitSystemSystemdRoIfupdown(InitSystemSystemdBase): """ def test_run(self): - self.start_emulator("squashfs", "zImage", "vexpress-v2p-ca9") - self.check_init() - self.check_network("eth0") + self.check_systemd("squashfs") class TestInitSystemSystemdRwIfupdown(InitSystemSystemdBase): @@ -96,9 +94,7 @@ class TestInitSystemSystemdRwIfupdown(InitSystemSystemdBase): """ def test_run(self): - self.start_emulator("ext2", "zImage", "vexpress-v2p-ca9") - self.check_init() - self.check_network("eth0") + self.check_systemd("ext2") class TestInitSystemSystemdRoFull(InitSystemSystemdBase): @@ -127,9 +123,7 @@ class TestInitSystemSystemdRoFull(InitSystemSystemdBase): """ def test_run(self): - self.start_emulator("squashfs", "zImage", "vexpress-v2p-ca9") - self.check_init() - self.check_network("eth0") + self.check_systemd("squashfs") class TestInitSystemSystemdRwFull(InitSystemSystemdBase): @@ -157,6 +151,4 @@ class TestInitSystemSystemdRwFull(InitSystemSystemdBase): """ def test_run(self): - self.start_emulator("ext2", "zImage", "vexpress-v2p-ca9") - self.check_init() - self.check_network("eth0") + self.check_systemd("ext2")