From patchwork Mon Nov 15 22:30:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34528 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 895E727BBE1; Mon, 15 Nov 2021 22:32:43 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id AA50327BBE3 for ; Mon, 15 Nov 2021 22:32:42 +0000 (GMT) Received: from localhost ([::1]:57656 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mmkWn-0001VT-SW for patchwork@mira.cbaines.net; Mon, 15 Nov 2021 17:32:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmkWB-00006J-OW for guix-patches@gnu.org; Mon, 15 Nov 2021 17:32:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44911) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmkWB-0002Ar-DQ for guix-patches@gnu.org; Mon, 15 Nov 2021 17:32:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mmkWB-0003lY-Ab for guix-patches@gnu.org; Mon, 15 Nov 2021 17:32:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51440] [PATCH v2 01/10] tests: Add 'static-networking' test. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 15 Nov 2021 22:32:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51440 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 51440@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 51440-submit@debbugs.gnu.org id=B51440.163701547514321 (code B ref 51440); Mon, 15 Nov 2021 22:32:03 +0000 Received: (at 51440) by debbugs.gnu.org; 15 Nov 2021 22:31:15 +0000 Received: from localhost ([127.0.0.1]:56440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVO-0003in-Hb for submit@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52512) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVA-0003gm-On for 51440@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:10 -0500 Received: from [2001:470:142:3::e] (port=52018 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmkV5-0001zT-HZ; Mon, 15 Nov 2021 17:30:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=nIMYMSxGuVBBp0yBxrJ8NiTzp8VkdLuICWMDvMaM/7M=; b=Pr0GAbckkbi4q1dFVrlj Nw3NxtPdWIxRd0EOxV2yj/aRdMM9Bpuphfc9YNQ/YLd1Th09+SIEAKVMIpnXtiwJndvgd0b5eOGH3 sHDw2bspNSxi3+ynJmx7JyNo8kBgy5wOWUUfLg9VccK8K/g427VCII6KZcSSwBsAOfVUR7SBw+5mo 1YRfl1/QT3vO9eAlXf8W8NUq8oJZUnmBaRYBPLtK4H1bRTC9n8T2/Z4ZTJoNSeME2XrNLrMUKd35+ OBKNX3i1YXuclhFFaE30+GEQYZCnZFBQzC6u8c3dfG0bS+6Fn9ur1XD/uYRaKvZCZUKmIQD9NFrN/ ErU8yqF9bGlosg==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=44414 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmkV5-0001jO-9Y; Mon, 15 Nov 2021 17:30:55 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 15 Nov 2021 23:30:35 +0100 Message-Id: <20211115223044.10943-2-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211115223044.10943-1-ludo@gnu.org> References: <20211027135918.18833-1-ludo@gnu.org> <20211115223044.10943-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/tests/networking.scm (run-static-networking-test): New procedure. (%test-static-networking): New variable. --- gnu/tests/networking.scm | 99 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 2 deletions(-) diff --git a/gnu/tests/networking.scm b/gnu/tests/networking.scm index 453e63f52d..5da1c91da6 100644 --- a/gnu/tests/networking.scm +++ b/gnu/tests/networking.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2018 Chris Marusich ;;; Copyright © 2018 Arun Isaac ;;; Copyright © 2021 Maxime Devos +;;; Copyright © 2021 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -37,8 +38,102 @@ (define-module (gnu tests networking) #:use-module (gnu packages guile) #:use-module (gnu services shepherd) #:use-module (ice-9 match) - #:export (%test-inetd %test-openvswitch %test-dhcpd %test-tor %test-iptables - %test-ipfs)) + #:export (%test-static-networking + %test-inetd + %test-openvswitch + %test-dhcpd + %test-tor + %test-iptables + %test-ipfs)) + + +;;; +;;; Static networking. +;;; + +(define (run-static-networking-test vm) + (define test + (with-imported-modules '((gnu build marionette) + (guix build syscalls)) + #~(begin + (use-modules (gnu build marionette) + (guix build syscalls) + (srfi srfi-64)) + + (define marionette + (make-marionette + '(#$vm "-nic" "user,model=virtio-net-pci"))) + + (mkdir #$output) + (chdir #$output) + + (test-begin "static-networking") + + (test-assert "service is up" + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (start-service 'networking)) + marionette)) + + (test-assert "network interfaces" + (marionette-eval + '(begin + (use-modules (guix build syscalls)) + (network-interface-names)) + marionette)) + + (test-equal "address of eth0" + "10.0.2.15" + (marionette-eval + '(let* ((sock (socket AF_INET SOCK_STREAM 0)) + (addr (network-interface-address sock "eth0"))) + (close-port sock) + (inet-ntop (sockaddr:fam addr) (sockaddr:addr addr))) + marionette)) + + (test-equal "netmask of eth0" + "255.255.255.0" + (marionette-eval + '(let* ((sock (socket AF_INET SOCK_STREAM 0)) + (mask (network-interface-netmask sock "eth0"))) + (close-port sock) + (inet-ntop (sockaddr:fam mask) (sockaddr:addr mask))) + marionette)) + + (test-equal "eth0 is up" + IFF_UP + (marionette-eval + '(let* ((sock (socket AF_INET SOCK_STREAM 0)) + (flags (network-interface-flags sock "eth0"))) + (logand flags IFF_UP)) + marionette)) + + (test-end) + + (exit (= (test-runner-fail-count (test-runner-current)) 0))))) + + (gexp->derivation "static-networking" test)) + +(define %test-static-networking + (system-test + (name "static-networking") + (description "Test the 'static-networking' service.") + (value + (let ((os (marionette-operating-system + (simple-operating-system + (static-networking-service "eth0" "10.0.2.15" + #:netmask "255.255.255.0" + #:gateway "10.0.2.2" + #:name-servers '("10.0.2.2"))) + #:imported-modules '((gnu services herd) + (guix combinators))))) + (run-static-networking-test (virtual-machine os)))))) + + +;;; +;;; Inetd. +;;; (define %inetd-os ;; Operating system with 2 inetd services. From patchwork Mon Nov 15 22:30:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34526 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8473427BBE3; Mon, 15 Nov 2021 22:32:36 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 573F527BBE1 for ; Mon, 15 Nov 2021 22:32:36 +0000 (GMT) Received: from localhost ([::1]:57148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mmkWh-0001B2-GV for patchwork@mira.cbaines.net; Mon, 15 Nov 2021 17:32:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53662) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmkWA-0008WS-UY for guix-patches@gnu.org; Mon, 15 Nov 2021 17:32:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44909) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmkWA-0002AW-Jw for guix-patches@gnu.org; Mon, 15 Nov 2021 17:32:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mmkWA-0003lJ-GZ for guix-patches@gnu.org; Mon, 15 Nov 2021 17:32:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51440] [PATCH v2 02/10] tests: openvswitch: Check whether ovs0 is up. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 15 Nov 2021 22:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51440 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 51440@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 51440-submit@debbugs.gnu.org id=B51440.163701547314303 (code B ref 51440); Mon, 15 Nov 2021 22:32:02 +0000 Received: (at 51440) by debbugs.gnu.org; 15 Nov 2021 22:31:13 +0000 Received: from localhost ([127.0.0.1]:56436 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVJ-0003i2-Gq for submit@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVB-0003gr-B3 for 51440@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:01 -0500 Received: from [2001:470:142:3::e] (port=52020 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmkV6-0001zn-4P; Mon, 15 Nov 2021 17:30:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=edqJOsScW5bI/S3HqRrJmuoSxiZ5+fBAqUe91M9zBi0=; b=HcBlaT/PT7AEI30x7nI5 tdxTWnTeu3S0+LyJ8EjqwPJ7FA1BPMiCQ+DLkiV3+gMu6WRJ12Pf5qJvtu4OiCzVgA8ureQ3KzqfF zv1Lw9J9F5E9/pTNNrkI1QOMS6uFjZVKJYeX0HRDA0SzNZAWmGxaJRXESHE4hqYNN2jfPCOAQr/lX C14IPzsTHVS0R3fnM+LgvpipQq+6jNSyI+tUayQAgFulJq+Q3qeDLyKecZb5HWgVKobyltL02vql2 FEfcX7Lw2fmY9SDMf63GPtWIxvAkUoklyh2PHV4GV0IFixPliFFQrEhzDBWr/NODssnypoAQRiH6j ukV1+Q0ZMQmz6A==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=44414 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmkV5-0001jO-T4; Mon, 15 Nov 2021 17:30:56 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 15 Nov 2021 23:30:36 +0100 Message-Id: <20211115223044.10943-3-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211115223044.10943-1-ludo@gnu.org> References: <20211027135918.18833-1-ludo@gnu.org> <20211115223044.10943-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/tests/networking.scm (run-openvswitch-test)["ovs0 is up"]: New test. --- gnu/tests/networking.scm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/gnu/tests/networking.scm b/gnu/tests/networking.scm index 5da1c91da6..131428c128 100644 --- a/gnu/tests/networking.scm +++ b/gnu/tests/networking.scm @@ -286,12 +286,15 @@ (define %openvswitch-os (define (run-openvswitch-test) (define os (marionette-operating-system %openvswitch-os - #:imported-modules '((gnu services herd)))) + #:imported-modules '((gnu services herd) + (guix build syscalls)))) (define test - (with-imported-modules '((gnu build marionette)) + (with-imported-modules '((gnu build marionette) + (guix build syscalls)) #~(begin (use-modules (gnu build marionette) + (guix build syscalls) (ice-9 popen) (ice-9 rdelim) (srfi srfi-64)) @@ -339,6 +342,18 @@ (define marionette (current-services)))) marionette)) + (test-equal "ovs0 is up" + IFF_UP + (marionette-eval + '(begin + (use-modules (guix build syscalls)) + + (let* ((sock (socket AF_INET SOCK_STREAM 0)) + (flags (network-interface-flags sock "ovs0"))) + (close-port sock) + (logand flags IFF_UP))) + marionette)) + (test-end) (exit (= (test-runner-fail-count (test-runner-current)) 0))))) From patchwork Mon Nov 15 22:30:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34527 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E5B0527BBE3; Mon, 15 Nov 2021 22:32:37 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9B83827BBE1 for ; Mon, 15 Nov 2021 22:32:37 +0000 (GMT) Received: from localhost ([::1]:57292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mmkWi-0001GW-RE for patchwork@mira.cbaines.net; Mon, 15 Nov 2021 17:32:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmkWG-0000AT-Qg for guix-patches@gnu.org; Mon, 15 Nov 2021 17:32:08 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44915) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmkWD-0002BQ-Fx for guix-patches@gnu.org; Mon, 15 Nov 2021 17:32:08 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mmkWD-0003m8-CX for guix-patches@gnu.org; Mon, 15 Nov 2021 17:32:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51440] [PATCH v2 04/10] gnu: guile-netlink: Allow cross-compilation. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 15 Nov 2021 22:32:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51440 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 51440@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 51440-submit@debbugs.gnu.org id=B51440.163701549514396 (code B ref 51440); Mon, 15 Nov 2021 22:32:05 +0000 Received: (at 51440) by debbugs.gnu.org; 15 Nov 2021 22:31:35 +0000 Received: from localhost ([127.0.0.1]:56450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVY-0003jw-OC for submit@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVC-0003gw-Oe for 51440@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:17 -0500 Received: from [2001:470:142:3::e] (port=52024 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmkV7-000202-BU; Mon, 15 Nov 2021 17:30:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=VCsKbkRYlQewCW3Fnn4DY4nZ9l1m//oFKWCUTLjvbOU=; b=rU1mbj7W7xpPUZL8m8VB EOs9O5Ad7xbfYMiNlf0xCG4nhkaMqgWETyUrsEAKG4hzzw5FHFdZakzS2CxLghv4a32D+ghpnSHj+ Tr7+BMUduCieZszMVsnWSH2EoM5ooB47Eo+fceCCxV75AjXlYDSiq/3egcfYGkwkmW7tQUq/ttfao kclw/zTZiC6Z+uBthabxcUoWwDvWQyuH+ZencqplkscAt4t9gPW3QVbqCN93dMfPCFPHWZQYSigsJ VhCUrARvMPjBdNo5ohP3ds8xpCORhROk43E4AI6nfmQxXWw83+ZDNrkXa3aVARn6t6InIf+4LVMgN mc01fQ3lPrR4/A==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=44414 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmkV7-0001jO-3i; Mon, 15 Nov 2021 17:30:57 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 15 Nov 2021 23:30:38 +0100 Message-Id: <20211115223044.10943-5-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211115223044.10943-1-ludo@gnu.org> References: <20211027135918.18833-1-ludo@gnu.org> <20211115223044.10943-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/guile-xyz.scm (guile-netlink)[arguments]: Remove, since #:tests? #f is unnecessary. [native-inputs]: Add GUILE-3.0. --- gnu/packages/guile-xyz.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm index 628d81710a..2751abc8e8 100644 --- a/gnu/packages/guile-xyz.scm +++ b/gnu/packages/guile-xyz.scm @@ -4777,14 +4777,13 @@ (define-public guile-netlink (base32 "1x1rx6agjdah56r50cfs41vyvycydyjdq0plq3jxgvl1q2dar1gw")))) (build-system gnu-build-system) - (arguments - `(#:tests? #f)); no tests (inputs `(("guile" ,guile-3.0))) (native-inputs `(("automake" ,automake) ("autoconf" ,autoconf) ("pkg-config" ,pkg-config) + ("guile" ,guile-3.0) ;for 'guild compile' + guile.m4 ("texinfo" ,texinfo))) (home-page "https://git.lepiller.eu/guile-netlink") (synopsis "Netlink protocol implementation for Guile") From patchwork Mon Nov 15 22:30:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34529 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id CB23C27BBE3; Mon, 15 Nov 2021 22:32:44 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 1A34D27BBE1 for ; Mon, 15 Nov 2021 22:32:44 +0000 (GMT) Received: from localhost ([::1]:57734 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mmkWp-0001Yh-9u for patchwork@mira.cbaines.net; Mon, 15 Nov 2021 17:32:43 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53694) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmkWG-0000AF-OJ for guix-patches@gnu.org; Mon, 15 Nov 2021 17:32:08 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44916) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmkWD-0002BT-S8 for guix-patches@gnu.org; Mon, 15 Nov 2021 17:32:08 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mmkWD-0003mF-PB for guix-patches@gnu.org; Mon, 15 Nov 2021 17:32:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51440] [PATCH v2 06/10] services: secret-service: Turn into a Shepherd service. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 15 Nov 2021 22:32:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51440 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 51440@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 51440-submit@debbugs.gnu.org id=B51440.163701549514405 (code B ref 51440); Mon, 15 Nov 2021 22:32:05 +0000 Received: (at 51440) by debbugs.gnu.org; 15 Nov 2021 22:31:35 +0000 Received: from localhost ([127.0.0.1]:56452 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVj-0003k9-6E for submit@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52534) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVD-0003h0-RE for 51440@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:19 -0500 Received: from [2001:470:142:3::e] (port=52028 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmkV8-00020I-KM; Mon, 15 Nov 2021 17:30:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=bcmo7xmK+6SxMv3uGAmGe4imHaZ1c5Pp8ko/UcmS2CM=; b=m6DhNfVqhClrWJyQSIWE b/f5S+EeYV/voc2ua+f7o79HVQy/W2Le4n3t6gI7DJiNfCrmAmszZwapeukQ/N3nRGS3TecN9T3nX 1SYDlUf8ZGzgPaApUghYx6vpKSzi3vuAfqQJ2hSjplMVtQ+ShvrMiD4SJ8MaUDG0e0P7kKBwelmOr qcl710LN0thv0EqZ+vByXEw0LX9DSJkhWD1iB6wOIxN9Dh2ZdEo7JkYpt+m5ALAZE19txqXKqAQQC H6zdXXFr7QSOZR0pAviieEltclqjrG6Ov41EhOkyHODsP6wwsjZgMG/xFAG3UrKLOe/sQbVTQ9gu9 DilnKFL4ZTqzsA==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=44414 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmkV8-0001jO-Cg; Mon, 15 Nov 2021 17:30:58 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 15 Nov 2021 23:30:40 +0100 Message-Id: <20211115223044.10943-7-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211115223044.10943-1-ludo@gnu.org> References: <20211027135918.18833-1-ludo@gnu.org> <20211115223044.10943-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/services/virtualization.scm (secret-service-activation): Remove. (secret-service-shepherd-services): New procedure. (secret-service-type)[extensions]: Remove ACTIVATION-SERVICE-TYPE extension. Add SHEPHERD-ROOT-SERVICE-TYPE and USER-PROCESSES-SERVICE-TYPE extensions. * gnu/build/secret-service.scm (delete-file*): New procedure. (secret-service-receive-secrets): Use it. --- gnu/build/secret-service.scm | 17 ++++++++++++- gnu/services/virtualization.scm | 45 ++++++++++++++++++++++++--------- 2 files changed, 49 insertions(+), 13 deletions(-) diff --git a/gnu/build/secret-service.scm b/gnu/build/secret-service.scm index 46dcf1b9c3..4e183e11e8 100644 --- a/gnu/build/secret-service.scm +++ b/gnu/build/secret-service.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2020 Ludovic Courtès +;;; Copyright © 2020, 2021 Ludovic Courtès ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. @@ -111,6 +111,15 @@ (define (send-files sock) (close-port sock) #f)))) +(define (delete-file* file) + "Ensure FILE does not exist." + (catch 'system-error + (lambda () + (delete-file file)) + (lambda args + (unless (= ENOENT (system-error-errno args)) + (apply throw args))))) + (define (secret-service-receive-secrets port) "Listen to local PORT and wait for a secret service client to send secrets. Write them to the file system. Return the list of files installed on success, @@ -170,6 +179,12 @@ (define (read-secrets port) (log "installing file '~a' (~a bytes)...~%" file size) (mkdir-p (dirname file)) + + ;; It could be that FILE already exists, for instance + ;; because it has been created by a service's activation + ;; snippet (e.g., SSH host keys). Delete it. + (delete-file* file) + (call-with-output-file file (lambda (output) (dump port output size) diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm index 1a5744ffbf..b1b10afed6 100644 --- a/gnu/services/virtualization.scm +++ b/gnu/services/virtualization.scm @@ -898,23 +898,44 @@ (define qemu-guest-agent-service-type ;;; Secrets for guest VMs. ;;; -(define (secret-service-activation port) - "Return an activation snippet that fetches sensitive material at local PORT, +(define (secret-service-shepherd-services port) + "Return a Shepherd service that fetches sensitive material at local PORT, over TCP. Reboot upon failure." - (with-imported-modules '((gnu build secret-service) - (guix build utils)) - #~(begin - (use-modules (gnu build secret-service)) - (let ((sent (secret-service-receive-secrets #$port))) - (unless sent - (sleep 3) - (reboot)))))) + ;; This is a Shepherd service, rather than an activation snippet, to make + ;; sure it is started once 'networking' is up so it can accept incoming + ;; connections. + (list + (shepherd-service + (documentation "Fetch secrets from the host at startup time.") + (provision '(secret-service-client)) + (requirement '(loopback networking)) + (modules '((gnu build secret-service) + (guix build utils))) + (start (with-imported-modules '((gnu build secret-service) + (guix build utils)) + #~(lambda () + ;; Since shepherd's output port goes to /dev/log, write this + ;; message to stderr so it's visible on the Mach console. + (format (current-error-port) + "receiving secrets from the host...~%") + (force-output (current-error-port)) + + (let ((sent (secret-service-receive-secrets #$port))) + (unless sent + (sleep 3) + (reboot)))))) + (stop #~(const #f))))) (define secret-service-type (service-type (name 'secret-service) - (extensions (list (service-extension activation-service-type - secret-service-activation))) + (extensions (list (service-extension shepherd-root-service-type + secret-service-shepherd-services) + + ;; Make every Shepherd service depend on + ;; 'secret-service-client'. + (service-extension user-processes-service-type + (const '(secret-service-client))))) (description "This service fetches secret key and other sensitive material over TCP at boot time. This service is meant to be used by virtual machines (VMs) that From patchwork Mon Nov 15 22:30:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34530 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 56D9A27BBE3; Mon, 15 Nov 2021 22:32:50 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id DF7CC27BBE1 for ; Mon, 15 Nov 2021 22:32:49 +0000 (GMT) Received: from localhost ([::1]:58090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mmkWv-0001n5-40 for patchwork@mira.cbaines.net; Mon, 15 Nov 2021 17:32:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53684) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmkWC-00007r-6Y for guix-patches@gnu.org; Mon, 15 Nov 2021 17:32:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44912) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmkWB-0002B8-TZ for guix-patches@gnu.org; Mon, 15 Nov 2021 17:32:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mmkWB-0003lf-PT for guix-patches@gnu.org; Mon, 15 Nov 2021 17:32:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51440] [PATCH v2 08/10] services: Define '%qemu-static-networking'. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 15 Nov 2021 22:32:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51440 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 51440@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 51440-submit@debbugs.gnu.org id=B51440.163701547614330 (code B ref 51440); Mon, 15 Nov 2021 22:32:03 +0000 Received: (at 51440) by debbugs.gnu.org; 15 Nov 2021 22:31:16 +0000 Received: from localhost ([127.0.0.1]:56442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVQ-0003iw-7V for submit@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52542) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVF-0003h3-9M for 51440@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:11 -0500 Received: from [2001:470:142:3::e] (port=52032 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmkVA-00020Y-2x; Mon, 15 Nov 2021 17:31:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=RGZGk2T8KUz5/i5BnLz684J2l78w5TL3HmxXzTYaXOw=; b=fs/o1NNO78BsCbh6Q0br 66sSail2XXT6TmD4wYSGrYAK4nBfwLaI91iDRarqprCifggyt4tCDO1G/z3BpGcV9H1XNVNnIzTKz exsYBuIJoOx/ZoY8q6rJLOMyYidX+a4giEtnQA8r0Lv8juPRnBKKzcf37W5zhswWh5Y2NO//H3xUC JWcYKDgj6GgeDh5tODjaTiahK2fdKaO0cf5faJfG4K070oIBCJ3BVfe0Mndjgh/9sJxP4HxVB1yKP ovO0W7qtE2wCpTB1t3t+DPEGeNcj/4b5BeEvwjr2TqUI4bJsHnX4IDV8fa5ImAbpc/ZMo8Af6cZEd TQLsHWjj7cjt9g==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=44414 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmkV9-0001jO-N3; Mon, 15 Nov 2021 17:31:00 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 15 Nov 2021 23:30:42 +0100 Message-Id: <20211115223044.10943-9-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211115223044.10943-1-ludo@gnu.org> References: <20211027135918.18833-1-ludo@gnu.org> <20211115223044.10943-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/services/base.scm (%qemu-static-networking): New variable. * gnu/system/hurd.scm (%base-services/hurd): Use it. * doc/guix.texi (Networking Setup): Document it. --- doc/guix.texi | 8 ++++++++ gnu/services/base.scm | 16 ++++++++++++++++ gnu/system/hurd.scm | 21 ++++++--------------- 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 439ef28e96..85e76991d9 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -16940,6 +16940,14 @@ List of arguments for this type of link. @end table @end deftp +@cindex networking, with QEMU +@cindex QEMU, networking +@defvr {Scheme Variable} %qemu-static-networking +This is the @code{static-networking} record representing network setup +when using QEMU's user-mode network stack on @code{eth0} (@pxref{Using +the user mode network stack,,, QEMU, QEMU Documentation}). +@end defvr + @cindex DHCP, networking service @defvr {Scheme Variable} dhcp-client-service-type This is the type of services that run @var{dhcp}, a Dynamic Host Configuration diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 112c6ab065..e78add4e20 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -113,6 +113,8 @@ (define-module (gnu services base) static-networking-service static-networking-service-type + %qemu-static-networking + udev-configuration udev-configuration? udev-configuration-rules @@ -2669,6 +2671,20 @@ (define-deprecated (static-networking-service interface ip (provision (or provision '(networking))) (name-servers name-servers))))) +(define %qemu-static-networking + ;; Networking configuration for QEMU's user-mode network stack (info "(QEMU) + ;; Using the user mode network stack"). + (static-networking + (addresses (list (network-address + (device "eth0") + (value "10.0.2.15/24")))) + (routes (list (network-route + (destination "default") + (gateway "10.0.2.2")))) + (requirement '()) + (provision '(networking)) + (name-servers '("10.0.2.3")))) + (define %base-services ;; Convenience variable holding the basic services. diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index 0e73ca0d99..ec8484d746 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -86,21 +86,12 @@ (define %base-services/hurd (value "127.0.0.1")))) (requirement '()) (provision '(loopback))) - (static-networking - (addresses - ;; The default QEMU guest address. To get "eth0", - ;; you need QEMU to emulate a device for which Mach - ;; has an in-kernel driver, for instance with: - ;; --device rtl8139,netdev=net0 --netdev user,id=net0 - (list (network-address - (device "eth0") - (value "10.0.2.15/24")))) - (routes - (list (network-route - (destination "default") - (gateway "10.0.2.2")))) - (provision '(networking)) - (name-servers '("10.0.2.3"))))) + + ;; QEMU user-mode networking. To get "eth0", you need + ;; QEMU to emulate a device for which Mach has an + ;; in-kernel driver, for instance with: + ;; --device rtl8139,netdev=net0 --netdev user,id=net0 + %qemu-static-networking)) (syslog-service) (service guix-service-type (guix-configuration From patchwork Mon Nov 15 22:30:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34525 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4262227BBE3; Mon, 15 Nov 2021 22:32:32 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id C848027BBE1 for ; Mon, 15 Nov 2021 22:32:31 +0000 (GMT) Received: from localhost ([::1]:56598 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mmkWc-0000ob-Vy for patchwork@mira.cbaines.net; Mon, 15 Nov 2021 17:32:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53696) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmkWG-0000AL-Pu for guix-patches@gnu.org; Mon, 15 Nov 2021 17:32:08 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44917) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmkWE-0002BW-23 for guix-patches@gnu.org; Mon, 15 Nov 2021 17:32:08 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mmkWC-0003m1-VH for guix-patches@gnu.org; Mon, 15 Nov 2021 17:32:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51440] [PATCH v2 09/10] services: Define '%loopback-static-networking'. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 15 Nov 2021 22:32:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51440 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 51440@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 51440-submit@debbugs.gnu.org id=B51440.163701547914363 (code B ref 51440); Mon, 15 Nov 2021 22:32:04 +0000 Received: (at 51440) by debbugs.gnu.org; 15 Nov 2021 22:31:19 +0000 Received: from localhost ([127.0.0.1]:56448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVT-0003jV-7b for submit@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52562) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVG-0003hU-TQ for 51440@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:12 -0500 Received: from [2001:470:142:3::e] (port=52034 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmkVA-00020f-MO; Mon, 15 Nov 2021 17:31:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=UIkbXTI2A46uLQe+s//tWj5frJIcM+VVSoLKmmhCNcE=; b=r0rBwvsKKqMTKl3hnI9F AyrwhGIReAJmEwnDJtdF536Xbse0Y8Vri9ooPEkR7p4jsqfZXGHiTn5BT65K90WXfQ9XGGPILTi2q 81Rb8a3qlojzlq54DfgR+37r1bOyBl8QbERKhByjsBKt+427UfdGJOUSqByzFJf2pEe7mr0S5QEZz yroXxNU+usjYhz8hytyw+cgYvN0IP98ZUBwabqDBQ6+5fCV+9M5J6Z6O0L1CK+cFGPnKuFQxx+TE0 QCQB2+f9iKagTRWT31bk/P7n4oNKwfpRt5aaVblGX758RnBF7mA5EhjNP6Ykdt22e0rrKSgOHNkrz Y8ZoVL8G6KAbXw==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=44414 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmkVA-0001jO-EU; Mon, 15 Nov 2021 17:31:00 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 15 Nov 2021 23:30:43 +0100 Message-Id: <20211115223044.10943-10-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211115223044.10943-1-ludo@gnu.org> References: <20211027135918.18833-1-ludo@gnu.org> <20211115223044.10943-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/services/base.scm (%loopback-static-networking): New variable. (%base-services): Use it. * gnu/system/hurd.scm (%base-services/hurd): Use it. * gnu/system/install.scm (%installation-services): Use it. * doc/guix.texi (Networking Setup): Document it. --- doc/guix.texi | 7 +++++++ gnu/services/base.scm | 17 +++++++++++------ gnu/system/hurd.scm | 8 +------- gnu/system/install.scm | 8 +------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 85e76991d9..2e72eb64d2 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -16940,6 +16940,13 @@ List of arguments for this type of link. @end table @end deftp +@cindex loopback device +@defvr {Scheme Variable} %loopback-static-networking +This is the @code{static-networking} record representing the ``loopback +device'', @code{lo}, for IP addresses 127.0.0.1 and ::1, and providing +the @code{loopback} Shepherd service. +@end defvr + @cindex networking, with QEMU @cindex QEMU, networking @defvr {Scheme Variable} %qemu-static-networking diff --git a/gnu/services/base.scm b/gnu/services/base.scm index e78add4e20..d996a7b07c 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -113,6 +113,7 @@ (define-module (gnu services base) static-networking-service static-networking-service-type + %loopback-static-networking %qemu-static-networking udev-configuration @@ -2671,6 +2672,15 @@ (define-deprecated (static-networking-service interface ip (provision (or provision '(networking))) (name-servers name-servers))))) +(define %loopback-static-networking + ;; The loopback device. + (static-networking + (addresses (list (network-address + (device "lo") + (value "127.0.0.1")))) + (requirement '()) + (provision '(loopback)))) + (define %qemu-static-networking ;; Networking configuration for QEMU's user-mode network stack (info "(QEMU) ;; Using the user mode network stack"). @@ -2715,12 +2725,7 @@ (define %base-services (tty "tty6"))) (service static-networking-service-type - (list (static-networking - (addresses (list (network-address - (device "lo") - (value "127.0.0.1")))) - (requirement '()) - (provision '(loopback))))) + (list %loopback-static-networking)) (syslog-service) (service urandom-seed-service-type) (service guix-service-type) diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index ec8484d746..2acc7b7e11 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -79,13 +79,7 @@ (define %base-services/hurd (service hurd-getty-service-type (hurd-getty-configuration (tty "tty2"))) (service static-networking-service-type - (list (static-networking - (addresses - (list (network-address - (device "lo") - (value "127.0.0.1")))) - (requirement '()) - (provision '(loopback))) + (list %loopback-static-networking ;; QEMU user-mode networking. To get "eth0", you need ;; QEMU to emulate a device for which Mach has an diff --git a/gnu/system/install.scm b/gnu/system/install.scm index bdfe580145..073d7df1db 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -408,13 +408,7 @@ (define bare-bones-os ;; Loopback device, needed by OpenSSH notably. (service static-networking-service-type - (list (static-networking - (addresses - (list (network-address - (device "lo") - (value "127.0.0.1")))) - (requirement '()) - (provision '(loopback))))) + (list %loopback-static-networking)) (service wpa-supplicant-service-type) (dbus-service) From patchwork Mon Nov 15 22:30:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34524 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 9082E27BBE3; Mon, 15 Nov 2021 22:32:31 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 2378B27BBE1 for ; Mon, 15 Nov 2021 22:32:31 +0000 (GMT) Received: from localhost ([::1]:56586 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mmkWc-0000o6-Bf for patchwork@mira.cbaines.net; Mon, 15 Nov 2021 17:32:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53686) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmkWC-00008b-IR for guix-patches@gnu.org; Mon, 15 Nov 2021 17:32:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44913) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmkWC-0002BF-8p for guix-patches@gnu.org; Mon, 15 Nov 2021 17:32:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mmkWC-0003ln-5m for guix-patches@gnu.org; Mon, 15 Nov 2021 17:32:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51440] [PATCH v2 10/10] tests: Replace uses of deprecated 'static-networking-service'. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 15 Nov 2021 22:32:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51440 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 51440@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 51440-submit@debbugs.gnu.org id=B51440.163701547714342 (code B ref 51440); Mon, 15 Nov 2021 22:32:04 +0000 Received: (at 51440) by debbugs.gnu.org; 15 Nov 2021 22:31:17 +0000 Received: from localhost ([127.0.0.1]:56444 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVQ-0003j5-OI for submit@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52558) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVG-0003hG-Gm for 51440@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:12 -0500 Received: from [2001:470:142:3::e] (port=52036 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmkVB-00020m-9p; Mon, 15 Nov 2021 17:31:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=f0T5dgslaHqaANUOThtzyqZWhOicRkOBGFHzUtH5IrY=; b=YjMU1aERlOUF5GJ5G7iZ Wm+mZUjIbij6B08cq7hrwlMEQvE+ynllyrnqItB2+qebFCT/SWfNV7hIl06SHvSjgPMmrxyOIkQry fveTEVHr5+tiX5VPUtS2OPBJAXt3KwhqAZME5ugCPlWNo4+rOrLuYzEWnYxhHnnCt4/cWKLRh2fnJ EZZGrt+AQ27Vhxj9cahxe56yDm8Tc0i7zYXF6AuiJpqOcVzcpkBitfUdiEIjueu6WIQ3iXkDsMTYW h6v43TZ/QE3TsB+aOiJgj3wwc9TLqca8pQx8+/Hx7v3bEGaT/gwa4IhpJAkKg5AzwqtMY2fK1VxuR nEC2dkH5cFoAKw==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=44414 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmkVB-0001jO-1p; Mon, 15 Nov 2021 17:31:01 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 15 Nov 2021 23:30:44 +0100 Message-Id: <20211115223044.10943-11-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211115223044.10943-1-ludo@gnu.org> References: <20211027135918.18833-1-ludo@gnu.org> <20211115223044.10943-1-ludo@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/tests/ganeti.scm (%ganeti-os): Replace call to 'static-networking-service' by instantiating STATIC-NETWORKING-SERVICE-TYPE. * gnu/tests/networking.scm (%test-static-networking) (%openvswitch-os, %dhcpd-os): Likewise. --- gnu/tests/ganeti.scm | 7 ++----- gnu/tests/networking.scm | 29 ++++++++++++++++++----------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/gnu/tests/ganeti.scm b/gnu/tests/ganeti.scm index 5ac2fd48dd..c29b885a5e 100644 --- a/gnu/tests/ganeti.scm +++ b/gnu/tests/ganeti.scm @@ -59,11 +59,8 @@ (define %ganeti-os (packages (append (list ganeti-instance-debootstrap ganeti-instance-guix) %base-packages)) (services - (append (list (static-networking-service "eth0" "10.0.2.15" - #:netmask "255.255.255.0" - #:gateway "10.0.2.2" - #:name-servers '("10.0.2.3")) - + (append (list (service static-networking-service-type + (list %qemu-static-networking)) (service openssh-service-type (openssh-configuration (permit-root-login 'prohibit-password))) diff --git a/gnu/tests/networking.scm b/gnu/tests/networking.scm index c66af279f2..246e0a15fa 100644 --- a/gnu/tests/networking.scm +++ b/gnu/tests/networking.scm @@ -122,10 +122,8 @@ (define %test-static-networking (value (let ((os (marionette-operating-system (simple-operating-system - (static-networking-service "eth0" "10.0.2.15" - #:netmask "255.255.255.0" - #:gateway "10.0.2.2" - #:name-servers '("10.0.2.2"))) + (service static-networking-service-type + (list %qemu-static-networking))) #:imported-modules '((gnu services herd) (guix combinators))))) (run-static-networking-test (virtual-machine os)))))) @@ -275,9 +273,13 @@ (define openvswitch-configuration-service (define %openvswitch-os (operating-system (inherit (simple-operating-system - (static-networking-service "ovs0" "10.1.1.1" - #:netmask "255.255.255.252" - #:requirement '(openvswitch-configuration)) + (simple-service 'openswitch-networking + static-networking-service-type + (list (static-networking + (addresses (list (network-address + (value "10.1.1.1/24") + (device "ovs0")))) + (requirement '(openvswitch-configuration))))) (service openvswitch-service-type) openvswitch-configuration-service)) ;; Ensure the interface name does not change depending on the driver. @@ -392,10 +394,15 @@ (define dhcpd-v4-configuration (define %dhcpd-os (simple-operating-system - (static-networking-service "ens3" "192.168.1.4" - #:netmask "255.255.255.0" - #:gateway "192.168.1.1" - #:name-servers '("192.168.1.2" "192.168.1.3")) + (service static-networking-service-type + (list (static-networking + (addresses (list (network-address + (value "192.168.1.4/24") + (device "ens3")))) + (routes (list (network-route + (destination "default") + (gateway "192.168.1.1")))) + (name-servers '("192.168.1.2" "192.168.1.3"))))) (service dhcpd-service-type dhcpd-v4-configuration))) (define (run-dhcpd-test)