mirror of
https://github.com/octoleo/restic.git
synced 2024-12-27 12:42:49 +00:00
Skip /dev/null on darwin
This commit is contained in:
parent
10a395ca33
commit
db7e23b423
@ -4,6 +4,7 @@ package restic
|
||||
|
||||
import (
|
||||
"os"
|
||||
"runtime"
|
||||
"syscall"
|
||||
"testing"
|
||||
"time"
|
||||
@ -81,15 +82,21 @@ func checkDevice(t testing.TB, stat *syscall.Stat_t, node *Node) {
|
||||
}
|
||||
|
||||
func TestNodeFromFileInfo(t *testing.T) {
|
||||
var tests = []struct {
|
||||
type Test struct {
|
||||
filename string
|
||||
canSkip bool
|
||||
}{
|
||||
}
|
||||
var tests = []Test{
|
||||
{"node_test.go", false},
|
||||
{"/dev/null", true},
|
||||
{"/dev/sda", true},
|
||||
}
|
||||
|
||||
// on darwin, users are not permitted to list the extended attributes of
|
||||
// /dev/null, therefore skip it.
|
||||
if runtime.GOOS != "darwin" {
|
||||
tests = append(tests, Test{"/dev/null", true})
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
t.Run("", func(t *testing.T) {
|
||||
fi, found := stat(t, test.filename)
|
||||
|
Loading…
Reference in New Issue
Block a user