[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#51440] [PATCH 02/10] tests: openvswitch: Check whether ovs0 is up.
From: |
Ludovic Courtès |
Subject: |
[bug#51440] [PATCH 02/10] tests: openvswitch: Check whether ovs0 is up. |
Date: |
Wed, 27 Oct 2021 16:02:37 +0200 |
* 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)))))
--
2.33.0
[bug#51440] [PATCH 03/10] doc: Add new "Networking Setup" node for the main setup options., Ludovic Courtès, 2021/10/27
[bug#51440] [PATCH 08/10] services: Define '%qemu-static-networking'., Ludovic Courtès, 2021/10/27
[bug#51440] [PATCH 09/10] services: Define '%loopback-static-networking'., Ludovic Courtès, 2021/10/27
[bug#51440] [PATCH 02/10] tests: openvswitch: Check whether ovs0 is up.,
Ludovic Courtès <=
[bug#51440] [PATCH 05/10] services: static-networking: Use Guile-Netlink on GNU/Linux., Ludovic Courtès, 2021/10/27
[bug#51440] [PATCH 10/10] tests: Replace uses of deprecated 'static-networking-service'., Ludovic Courtès, 2021/10/27
[bug#51440] [PATCH 00/10] Declarative static networking interface, Julien Lepiller, 2021/10/27