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")