File: Skip-missing-utmp.patch

package info (click to toggle)
golang-github-shirou-gopsutil 4.25.2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid, trixie
  • size: 1,824 kB
  • sloc: makefile: 76; ansic: 19; sh: 11
file content (27 lines) | stat: -rw-r--r-- 743 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From: Guillem Jover <gjover@sipwise.com>
Date: Mon, 7 Oct 2024 15:45:35 +0200
Subject: Skip test if /run/utmp is missing

On some Linux systems this file is no longer present, and it is replaced by
alternative interfaces such as systemd's logind.

Origin: vendor, Sipwise
Forwarded: no
---
 host/host_test.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/host/host_test.go b/host/host_test.go
index 24b1371..341dc55 100644
--- a/host/host_test.go
+++ b/host/host_test.go
@@ -91,6 +91,9 @@ func TestBootTime(t *testing.T) {
 func TestUsers(t *testing.T) {
 	v, err := Users()
 	skipIfNotImplementedErr(t, err)
+	if errors.Is(err, os.ErrNotExist) {
+		t.Skip("Users file missing")
+	}
 	if err != nil {
 		t.Errorf("error %v", err)
 	}