[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: tests: vnstat: Avoid call to 'getservbyname'.
From: |
guix-commits |
Subject: |
branch master updated: tests: vnstat: Avoid call to 'getservbyname'. |
Date: |
Thu, 11 May 2023 12:10:48 -0400 |
This is an automated email from the git hooks/post-receive script.
civodul pushed a commit to branch master
in repository guix.
The following commit(s) were added to refs/heads/master by this push:
new d6f6b57766 tests: vnstat: Avoid call to 'getservbyname'.
d6f6b57766 is described below
commit d6f6b57766e95d2fa8af63d4460a2b303ca4d867
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Thu May 11 18:07:21 2023 +0200
tests: vnstat: Avoid call to 'getservbyname'.
This would break "make as-derivation" because /etc/services is
unavailable in the build environment:
[ 38/ 80] loading... 95.0% of 40 filesBacktrace:
In guix/build/compile.scm:
249:8 19 (compile-files "."
"/gnu/store/s5nadqd6hkzivkxp33svwqslfn608ng5-guix-system-tests"
("gnu/tests/audio.scm" "gnu/tests/base.scm" "gnu/tests/ci.scm"
"gnu/tests/cups.scm" "gnu/tests/d…" …) …)
[…]
In unknown file:
0 (getserv "discard" "tcp")
ERROR: In procedure getserv:
In procedure getserv: no such service discard
builder for `/gnu/store/…-guix-system-tests.drv' failed with exit code 1
* gnu/tests/vnstat.scm (run-vnstat-test): Hard-code 'guest-port' instead
of calling 'getservbyname'.
---
gnu/tests/vnstat.scm | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/gnu/tests/vnstat.scm b/gnu/tests/vnstat.scm
index d1be98e342..c498b987ff 100644
--- a/gnu/tests/vnstat.scm
+++ b/gnu/tests/vnstat.scm
@@ -61,12 +61,9 @@
(define forwarded-port 9999)
(define vm
- (let* ((inetd-service-name "discard")
- (inetd-service-proto
- (inetd-entry-protocol inetd-service-entry-config))
- (guest-port
- (servent:port (getservbyname inetd-service-name
- inetd-service-proto))))
+ ;; The 'discard' port is 9. Avoid using 'getservbyname' as that might
+ ;; fail depending on what /etc/services has (if it's available).
+ (let ((guest-port 9))
(virtual-machine
(operating-system os)
(port-forwardings `((,forwarded-port . ,guest-port))))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: tests: vnstat: Avoid call to 'getservbyname'.,
guix-commits <=