From patchwork Wed Oct 27 14:02:37 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: 34114 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 2B2CD27BBE3; Wed, 27 Oct 2021 16:08:11 +0100 (BST) 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 C1DFD27BBE1 for ; Wed, 27 Oct 2021 16:08:10 +0100 (BST) Received: from localhost ([::1]:33204 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfkXB-0000FK-S7 for patchwork@mira.cbaines.net; Wed, 27 Oct 2021 11:08:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43122) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfjX8-0008Jj-Pa for guix-patches@gnu.org; Wed, 27 Oct 2021 10:04:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38541) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfjX8-0005Fi-GD for guix-patches@gnu.org; Wed, 27 Oct 2021 10:04:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mfjX8-0002Yt-Ba for guix-patches@gnu.org; Wed, 27 Oct 2021 10:04:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#51440] [PATCH 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: Wed, 27 Oct 2021 14:04: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.16353433879660 (code B ref 51440); Wed, 27 Oct 2021 14:04:02 +0000 Received: (at 51440) by debbugs.gnu.org; 27 Oct 2021 14:03:07 +0000 Received: from localhost ([127.0.0.1]:50058 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfjWE-0002Vc-Mt for submit@debbugs.gnu.org; Wed, 27 Oct 2021 10:03:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45536) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfjWA-0002Ue-W9 for 51440@debbugs.gnu.org; Wed, 27 Oct 2021 10:03:03 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37964) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfjW5-00057L-8r; Wed, 27 Oct 2021 10:02:57 -0400 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=hO1wrPq/fnoi7zljCB+V r/0ndYaQF51tWbdJjFwrjDw4kglBct13GXKELej1uAJiutZY5xgegz7z512IIgNWKA+L62ph9NhAk oQOli0+XiHgvmYLOyAKRlyLCDdHw3DQyZCmXmOjmdGB9hm1yobPX5HiWv6Tgm2DV1av/nSkynq2HK XTeu3WtbNniIUhLC9qtb2HrCOsZcBlXWv1AYf5Cm5ZLwM4bT7ONIU+cVbH6OsbPzWIKCQvxxB6WmK 9qDCN26fzk2pNVwZWkS3jVtOPXs+5gylRXvlgs8UzEOJdj5D/bxidw6t9JMTY7Tfaf3eBNGgzEuyf 5okRlqP3KFyStw==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=55004 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 1mfjW3-0002Tf-Rs; Wed, 27 Oct 2021 10:02:56 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Wed, 27 Oct 2021 16:02:37 +0200 Message-Id: <20211027140245.18970-2-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211027140245.18970-1-ludo@gnu.org> References: <20211027140245.18970-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)))))