summaryrefslogtreecommitdiff
path: root/tests/reverse
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-08-16 22:00:40 +0200
committerJakob Unterwurzacher2021-08-16 22:05:33 +0200
commiteeb267950a111e4b5169a10ad723b14963667845 (patch)
treee5a8ea599db15a27bbb732b5b3d7b93aba5460f1 /tests/reverse
parente2d3834b1c4aec2544369361f4b572c4f80dc544 (diff)
tests/reverse: replace os.ReadDir to support older Go versions
Diffstat (limited to 'tests/reverse')
-rw-r--r--tests/reverse/one_file_system_test.go11
1 files changed, 3 insertions, 8 deletions
diff --git a/tests/reverse/one_file_system_test.go b/tests/reverse/one_file_system_test.go
index 5d8b76b..61fdb61 100644
--- a/tests/reverse/one_file_system_test.go
+++ b/tests/reverse/one_file_system_test.go
@@ -3,7 +3,6 @@ package reverse
import (
"io/ioutil"
"net/url"
- "os"
"runtime"
"syscall"
"testing"
@@ -28,21 +27,17 @@ func doTestOneFileSystem(t *testing.T, plaintextnames bool) {
// Copied from inomap
const maxPassthruIno = 1<<48 - 1
- entries, err := os.ReadDir(mnt)
+ entries, err := ioutil.ReadDir(mnt)
if err != nil {
t.Fatal(err)
}
mountpoints := []string{}
for _, e := range entries {
- i, err := e.Info()
- if err != nil {
- continue
- }
if !e.IsDir() {
// We are only interested in directories
continue
}
- st := i.Sys().(*syscall.Stat_t)
+ st := e.Sys().(*syscall.Stat_t)
// The inode numbers of files with a different device number are remapped
// to something above maxPassthruIno
if st.Ino > maxPassthruIno {
@@ -53,7 +48,7 @@ func doTestOneFileSystem(t *testing.T, plaintextnames bool) {
t.Skip("no mountpoints found, nothing to test")
}
for _, m := range mountpoints {
- e, err := os.ReadDir(mnt + "/" + m)
+ e, err := ioutil.ReadDir(mnt + "/" + m)
if err != nil {
t.Error(err)
}