tests: openvswitch: Check whether ovs0 is up.
* gnu/tests/networking.scm (run-openvswitch-test)["ovs0 is up"]: New test.
This commit is contained in:
parent
72f140c253
commit
33c498b9ee
1 changed files with 17 additions and 2 deletions
|
@ -286,12 +286,15 @@ port 7, and a dict service on port 2628."
|
||||||
(define (run-openvswitch-test)
|
(define (run-openvswitch-test)
|
||||||
(define os
|
(define os
|
||||||
(marionette-operating-system %openvswitch-os
|
(marionette-operating-system %openvswitch-os
|
||||||
#:imported-modules '((gnu services herd))))
|
#:imported-modules '((gnu services herd)
|
||||||
|
(guix build syscalls))))
|
||||||
|
|
||||||
(define test
|
(define test
|
||||||
(with-imported-modules '((gnu build marionette))
|
(with-imported-modules '((gnu build marionette)
|
||||||
|
(guix build syscalls))
|
||||||
#~(begin
|
#~(begin
|
||||||
(use-modules (gnu build marionette)
|
(use-modules (gnu build marionette)
|
||||||
|
(guix build syscalls)
|
||||||
(ice-9 popen)
|
(ice-9 popen)
|
||||||
(ice-9 rdelim)
|
(ice-9 rdelim)
|
||||||
(srfi srfi-64))
|
(srfi srfi-64))
|
||||||
|
@ -339,6 +342,18 @@ port 7, and a dict service on port 2628."
|
||||||
(current-services))))
|
(current-services))))
|
||||||
marionette))
|
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)
|
(test-end)
|
||||||
(exit (= (test-runner-fail-count (test-runner-current)) 0)))))
|
(exit (= (test-runner-fail-count (test-runner-current)) 0)))))
|
||||||
|
|
||||||
|
|
Reference in a new issue