From patchwork Sun May 2 08:17:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Olsson" X-Patchwork-Id: 1472748 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=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=senzilla.io header.i=@senzilla.io header.a=rsa-sha256 header.s=protonmail3 header.b=N85pety2; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FXzVj3Nkdz9rx6 for ; Sun, 2 May 2021 18:17:33 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 183564017C; Sun, 2 May 2021 08:17:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yqrmL7lWmlsl; Sun, 2 May 2021 08:17:30 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 4E15B40401; Sun, 2 May 2021 08:17:29 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 5D5411BF3F0 for ; Sun, 2 May 2021 08:17:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 4C7D460AE2 for ; Sun, 2 May 2021 08:17:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=senzilla.io Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8nFe6ROlJhyL for ; Sun, 2 May 2021 08:17:17 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail-40133.protonmail.ch (mail-40133.protonmail.ch [185.70.40.133]) by smtp3.osuosl.org (Postfix) with ESMTPS id 81FA9608B0 for ; Sun, 2 May 2021 08:17:17 +0000 (UTC) Date: Sun, 02 May 2021 08:17:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senzilla.io; s=protonmail3; t=1619943434; bh=C9UNW0Ey8vFJEIKKcVDCFhYJEN2nQHtkMxFJsNfkBcQ=; h=Date:To:From:Cc:Reply-To:Subject:From; b=N85pety2MBqGCmHH/hJ766BEgaMT7HWa5+H8UsSaWGjdr461bp+UAc8R0918DQjyn U4bgrGjIP9B5Q4q1qN4c2CyKJIQyfIi2icFZTu0zBObGLTZN8cCB2tkuZbY47oxQc3 9B02BhKSFkcXnes9iWw8EwjTOqPC8bmFtOs973WaEvwlouoKln75HqmD4sTwgIbgBn BxOV8FVowv9LWtJABFAjALeMEQVmmKiI1mYMvNLzolzmzlCcxDH1nILey48ZZdjl6S pu+9fY9nVoZmIDgRJ13ttXvp8UIf7xVAFq0YyKxtUrdM3M93DP2PAM8+Z/1yJ6QzQW Qdg5qxAsZyUWg== To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/5] support/testing: add execline 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: , From: Dick Olsson via buildroot Reply-To: Dick Olsson Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Test that the interpreter can run a basic command. Signed-off-by: Dick Olsson --- .../testing/tests/package/test_execline.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 support/testing/tests/package/test_execline.py diff --git a/support/testing/tests/package/test_execline.py b/support/testing/tests/package/test_execline.py new file mode 100644 index 0000000000..e655b501ea --- /dev/null +++ b/support/testing/tests/package/test_execline.py @@ -0,0 +1,22 @@ +import os + +import infra.basetest + + +class TestExecline(infra.basetest.BRTest): + config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + """ + BR2_PACKAGE_EXECLINE=y + BR2_TARGET_ROOTFS_CPIO=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + + def test_run(self): + img = os.path.join(self.builddir, "images", "rootfs.cpio") + self.emulator.boot(arch="armv5", + kernel="builtin", + options=["-initrd", img]) + self.emulator.login() + + output, exit_code = self.emulator.run("execlineb -c 'echo hello world'") + self.assertEqual(exit_code, 0) + self.assertEqual(output[0].strip(), "hello world") From patchwork Sun May 2 08:17:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Olsson" X-Patchwork-Id: 1472749 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=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=senzilla.io header.i=@senzilla.io header.a=rsa-sha256 header.s=protonmail3 header.b=IM8yJ69f; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FXzW06gRqz9rx6 for ; Sun, 2 May 2021 18:17:48 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id CB16360AEA; Sun, 2 May 2021 08:17:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fvFH-ws0R-Ap; Sun, 2 May 2021 08:17:43 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 1584460AE2; Sun, 2 May 2021 08:17:42 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id AA7181BF3F0 for ; Sun, 2 May 2021 08:17:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 99E7F403A7 for ; Sun, 2 May 2021 08:17:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp2.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=senzilla.io Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id O6LJ6VmsK29F for ; Sun, 2 May 2021 08:17:24 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail-40136.protonmail.ch (mail-40136.protonmail.ch [185.70.40.136]) by smtp2.osuosl.org (Postfix) with ESMTPS id B8DBA40002 for ; Sun, 2 May 2021 08:17:24 +0000 (UTC) Date: Sun, 02 May 2021 08:17:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senzilla.io; s=protonmail3; t=1619943442; bh=mCUDIRmAnQ8c80bYagF0LvFzIYGn82ng0UIxZJjDeWU=; h=Date:To:From:Cc:Reply-To:Subject:From; b=IM8yJ69f/gCBuUF9mDf6zSYSj9/rkBkAf76cU1UD4rQV1vx5dnksUPCNQDG3fU4Fg 3Bjpzp2Ov/GV1sS66FsoBhqKbsAHkxEhsWppvd/jtYYDhKJyAxfGRBen+qaQP65TJ0 sj0nHFNAzhAAkw+ukfQo9UF2T41/LUze/qFUsByo0F7PVyv6Pw4k7N1Op8nZSW5Fxr rYBJg+91opsTe6JLcWz7okRLj02tx7wc64BUAMWJ+dAXbZqM8641HhS/xxueel7Q6Y w0+PyE2eebhS/vVeeVbgpocNRxCFWKmJK9BVq4YWmdLghd43GrzZ99wnNUpk7Q2flH xQSgiNCB/RBJw== To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2/5] support/testing: add s6 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: , From: Dick Olsson via buildroot Reply-To: Dick Olsson Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Test that directory scanning and supervision is working. Signed-off-by: Dick Olsson --- support/testing/tests/package/test_s6.py | 54 ++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 support/testing/tests/package/test_s6.py diff --git a/support/testing/tests/package/test_s6.py b/support/testing/tests/package/test_s6.py new file mode 100644 index 0000000000..4c6f3c0976 --- /dev/null +++ b/support/testing/tests/package/test_s6.py @@ -0,0 +1,54 @@ +import os + +import infra.basetest + + +class TestS6(infra.basetest.BRTest): + config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + """ + BR2_PACKAGE_S6=y + BR2_TARGET_ROOTFS_CPIO=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + + def test_run(self): + img = os.path.join(self.builddir, "images", "rootfs.cpio") + self.emulator.boot(arch="armv5", + kernel="builtin", + options=["-initrd", img]) + self.emulator.login() + + _, exit_code = self.emulator.run("s6-svscan -h") + self.assertEqual(exit_code, 100) + + script = """ +#!/bin/execlineb -P +s6-ipcserver-socketbinder /tmp/socket +s6-ipcserverd +cat +""" + + # Set up scanning and service directories + self.emulator.run("mkdir -p source/testsv") + self.emulator.run("cat > source/testsv/run < X-Patchwork-Id: 1472750 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=smtp4.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=senzilla.io header.i=@senzilla.io header.a=rsa-sha256 header.s=protonmail3 header.b=UBsa2Qwg; dkim-atps=neutral Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FXzWB6xWkz9rx6 for ; Sun, 2 May 2021 18:17:58 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 977FC41E51; Sun, 2 May 2021 08:17:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mFw1gOXGOO_l; Sun, 2 May 2021 08:17:55 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id E6E1341D29; Sun, 2 May 2021 08:17:54 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 6403D1BF3F0 for ; Sun, 2 May 2021 08:17:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 5254241D29 for ; Sun, 2 May 2021 08:17:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KHJqK0purgQ8 for ; Sun, 2 May 2021 08:17:29 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail2.protonmail.ch (mail2.protonmail.ch [185.70.40.22]) by smtp4.osuosl.org (Postfix) with ESMTPS id 84C1C41D26 for ; Sun, 2 May 2021 08:17:29 +0000 (UTC) Date: Sun, 02 May 2021 08:17:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senzilla.io; s=protonmail3; t=1619943446; bh=qGGIIjt+GFzmarXfGjrcQBmGeY4AF0rcTnCKr0MwYk0=; h=Date:To:From:Cc:Reply-To:Subject:From; b=UBsa2Qwg826WpalXTvk1aRlo8VD2mEuf6IZja5hx4lpcF4nYPAC6lxOuhHbbzjAoB /sf3w8aKZR20NUi3BzrnZEuqWv8OCkvNsi0iJJ/eLd4mfqoyCbX7g7/Uq0rSLwkL94 jPCyGELSkKc8LelEGx++j3DDsboPEpJ7YdNaonmsJH1Pe1NDnhDnaB5KjT00PxcR1H xsz+9DRH9tzXmapC1/bY+Om6Vm4jCq11sAoRmxyyPG4c6+ntkGBwO0e/fuOR1jlsK0 /9D6R/ymOr7vhIzhm/EuVlLhWURd2W1rEkHSZtxJNjz+ZNJHGUSJJBJ3IQ9mocWDCk jHh2NH9Nim8+Q== To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Subject: [Buildroot] [PATCH 3/5] support/testing: add s6-portable-utils 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: , From: Dick Olsson via buildroot Reply-To: Dick Olsson Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Test that a few basis utilities are working. Signed-off-by: Dick Olsson --- .../tests/package/test_s6_portable_utils.py | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 support/testing/tests/package/test_s6_portable_utils.py diff --git a/support/testing/tests/package/test_s6_portable_utils.py b/support/testing/tests/package/test_s6_portable_utils.py new file mode 100644 index 0000000000..2fb45aefbc --- /dev/null +++ b/support/testing/tests/package/test_s6_portable_utils.py @@ -0,0 +1,31 @@ +import os + +import infra.basetest + + +class TestS6PortableUtils(infra.basetest.BRTest): + config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + """ + BR2_PACKAGE_S6_PORTABLE_UTILS=y + BR2_TARGET_ROOTFS_CPIO=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + + def test_run(self): + img = os.path.join(self.builddir, "images", "rootfs.cpio") + self.emulator.boot(arch="armv5", + kernel="builtin", + options=["-initrd", img]) + self.emulator.login() + + output, exit_code = self.emulator.run("s6-basename /sbin/init") + self.assertEqual(exit_code, 0) + self.assertEqual(output[0].strip(), "init") + + output, exit_code = self.emulator.run("s6-echo hello world | s6-cut -d' ' -f2") + self.assertEqual(exit_code, 0) + self.assertEqual(output[0].strip(), "world") + + _, exit_code = self.emulator.run("s6-mkfifo testpipe") + self.assertEqual(exit_code, 0) + _, exit_code = self.emulator.run("s6-test -p testpipe") + self.assertEqual(exit_code, 0) From patchwork Sun May 2 08:17:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Olsson" X-Patchwork-Id: 1472751 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.138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=senzilla.io header.i=@senzilla.io header.a=rsa-sha256 header.s=protonmail3 header.b=LVIE449x; dkim-atps=neutral Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FXzWR5S4Cz9rx6 for ; Sun, 2 May 2021 18:18:11 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id D5ECD84C74; Sun, 2 May 2021 08:18:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 79hVMPAuNMxS; Sun, 2 May 2021 08:18:09 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 232C084C73; Sun, 2 May 2021 08:18:08 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 6E03D1BF3F0 for ; Sun, 2 May 2021 08:17:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 5C66441D29 for ; Sun, 2 May 2021 08:17:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=senzilla.io Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yLrsU0Wmwef1 for ; Sun, 2 May 2021 08:17:35 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail1.protonmail.ch (mail1.protonmail.ch [185.70.40.18]) by smtp4.osuosl.org (Postfix) with ESMTPS id 5983641D26 for ; Sun, 2 May 2021 08:17:35 +0000 (UTC) Date: Sun, 02 May 2021 08:17:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senzilla.io; s=protonmail3; t=1619943452; bh=TQKePgUqXzafv3ErvOZZHDBOGQXB0Uguoh/n79zkQIY=; h=Date:To:From:Cc:Reply-To:Subject:From; b=LVIE449x7+57HssAGGRlJObvVv2rCZ9wcQmIXRcdib1QgyvOhxZJwcMWwm07d3fX+ oMXxJ61JKy5GLp60SkQGqfefewdBn/06OtTLrkRdh305x7mzcqx4kWIY2btvMMpfrE 2JeYN2LnWcRZs1ah1M23xVsmMldKSJ6QwqO3I5MGNa3CKz5ZBN09yaC9SK7ix/Z80I 6nO4h/kmuJMbEDZwuyAzCs3uZiiln4LyfDVVShHfmjzAATrmEcXamNcekLp5QZ3q7j YSUMPnnMLJBt8nB9u98DOOOJcbwaIqxwcI1g7DMpB9vSfBpFGkCJZj6CP7GEyl2KH/ lpvf51lFX6afw== To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Subject: [Buildroot] [PATCH 4/5] support/testing: add s6-rc 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: , From: Dick Olsson via buildroot Reply-To: Dick Olsson Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Test that s6-rc service database compilation is working. Signed-off-by: Dick Olsson --- support/testing/tests/package/test_s6_rc.py | 46 +++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 support/testing/tests/package/test_s6_rc.py diff --git a/support/testing/tests/package/test_s6_rc.py b/support/testing/tests/package/test_s6_rc.py new file mode 100644 index 0000000000..299f982cd0 --- /dev/null +++ b/support/testing/tests/package/test_s6_rc.py @@ -0,0 +1,46 @@ +import os + +import infra.basetest + + +class TestS6Rc(infra.basetest.BRTest): + config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + """ + BR2_PACKAGE_S6_RC=y + BR2_TARGET_ROOTFS_CPIO=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + + def test_run(self): + img = os.path.join(self.builddir, "images", "rootfs.cpio") + self.emulator.boot(arch="armv5", + kernel="builtin", + options=["-initrd", img]) + self.emulator.login() + + _, exit_code = self.emulator.run("s6-svscan -h") + self.assertEqual(exit_code, 100) + + # Set up two service directories with a dependency + self.emulator.run("mkdir -p source/testsv1") + self.emulator.run("mkdir -p source/testsv2") + self.emulator.run("echo oneshot > source/testsv1/type") + self.emulator.run("echo oneshot > source/testsv2/type") + self.emulator.run("echo 'echo foo' > source/testsv1/up") + self.emulator.run("echo 'echo bar' > source/testsv2/up") + self.emulator.run("echo testsv1 > source/testsv2/dependencies") + self.emulator.run("chmod +x source/testsv1/up") + self.emulator.run("chmod +x source/testsv2/up") + + # Compile the service database + _, exit_code = self.emulator.run("s6-rc-compile compiled source") + self.assertEqual(exit_code, 0) + + # Inspect dependencies + cmd = "s6-rc-db -c compiled -d dependencies testsv1" + output, exit_code = self.emulator.run(cmd) + self.assertEqual(exit_code, 0) + self.assertEqual(output[0], "testsv2") + cmd = "s6-rc-db -c compiled dependencies testsv2" + output, exit_code = self.emulator.run(cmd) + self.assertEqual(exit_code, 0) + self.assertEqual(output[0], "testsv1") From patchwork Sun May 2 08:17:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Olsson" X-Patchwork-Id: 1472752 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=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=senzilla.io header.i=@senzilla.io header.a=rsa-sha256 header.s=protonmail3 header.b=o/yj/BDn; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FXzWh2L1lz9rx6 for ; Sun, 2 May 2021 18:18:24 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 3940F403F6; Sun, 2 May 2021 08:18:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tpLF7wfa5WHK; Sun, 2 May 2021 08:18:21 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 8BF49403A7; Sun, 2 May 2021 08:18:20 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 38B591BF3F0 for ; Sun, 2 May 2021 08:17:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 287FC400C0 for ; Sun, 2 May 2021 08:17:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OaDOHt7MmS4k for ; Sun, 2 May 2021 08:17:40 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail-40134.protonmail.ch (mail-40134.protonmail.ch [185.70.40.134]) by smtp2.osuosl.org (Postfix) with ESMTPS id 4B4B04040A for ; Sun, 2 May 2021 08:17:40 +0000 (UTC) Date: Sun, 02 May 2021 08:17:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senzilla.io; s=protonmail3; t=1619943457; bh=YQqP0vBMMxJNwun+OJk+DkfbQBOQnX0BvZd96c0Drco=; h=Date:To:From:Cc:Reply-To:Subject:From; b=o/yj/BDnKJcvK0mmYfapC7r2quAz3xHfNWDGbYK+CLqoG+O2XXO3KLaO1CPcX18Sf oFj07cZkZT99U988HixDHQ3TY3XfZJK3t2smjngQZvTxiEr6nLZdeD3eOShfPAoPvr znX6SJ48t2+NFcS3a7PYRVE5rSrTw9nOGJTasBjjma8g65TgVWeW08EmfjRhpX6Ng+ +PRWxmDoNM5BfvIPzjvG1x3Te6d/0UIXB+tkLfg/MqSRmSpNGeDsQVKaBM1z96rFWF FBPlKHWFNkIt17CfgaWonqPBSQJGDgaDUyB/B04jB9Iq8S794Pl4KrZ0gryB48nH3W F+09XxFfOLZLg== To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Subject: [Buildroot] [PATCH 5/5] support/testing: add s6-networking 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: , From: Dick Olsson via buildroot Reply-To: Dick Olsson Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Test that the TAICLOCK and TCP servers are working. Signed-off-by: Dick Olsson --- .../tests/package/test_s6_networking.py | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 support/testing/tests/package/test_s6_networking.py diff --git a/support/testing/tests/package/test_s6_networking.py b/support/testing/tests/package/test_s6_networking.py new file mode 100644 index 0000000000..ae008f7a4b --- /dev/null +++ b/support/testing/tests/package/test_s6_networking.py @@ -0,0 +1,35 @@ +import os + +import infra.basetest + + +class TestS6Networking(infra.basetest.BRTest): + config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + """ + BR2_PACKAGE_S6_NETWORKING=y + BR2_TARGET_ROOTFS_CPIO=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + + def test_run(self): + img = os.path.join(self.builddir, "images", "rootfs.cpio") + self.emulator.boot(arch="armv5", + kernel="builtin", + options=["-initrd", img]) + self.emulator.login() + + # Test the TAICLOCK server and client + _, exit_code = self.emulator.run("s6-taiclockd &") + self.emulator.run("sleep 2") + cmd = "s6-taiclock 127.0.0.1 | s6-clockview" + output, exit_code = self.emulator.run(cmd) + self.assertEqual(exit_code, 0) + self.assertEqual(output[0][0:6], "before") + self.assertEqual(output[1][0:5], "after") + + # Test the TCP server and client + _, exit_code = self.emulator.run("s6-tcpserver4 127.0.0.1 1024 cat &") + self.emulator.run("sleep 2") + cmd = "echo foobar | s6-tcpclient 127.0.0.1 1024 s6-ioconnect -67" + output, exit_code = self.emulator.run(cmd) + self.assertEqual(exit_code, 0) + self.assertEqual(output[0], "foobar")