Fix fs error handling
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package netenv
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"io/fs"
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
@@ -12,7 +14,7 @@ func TestDbus(t *testing.T) {
|
||||
t.Skip("skipping test in short mode because it fails in the CI")
|
||||
}
|
||||
|
||||
if _, err := os.Stat("/var/run/dbus/system_bus_socket"); os.IsNotExist(err) {
|
||||
if _, err := os.Stat("/var/run/dbus/system_bus_socket"); errors.Is(err, fs.ErrNotExist) {
|
||||
t.Logf("skipping dbus tests, as dbus does not seem to be installed: %s", err)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user