summaryrefslogtreecommitdiff
path: root/src/syscall/syscall_linux_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/syscall/syscall_linux_test.go')
-rw-r--r--src/syscall/syscall_linux_test.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/syscall/syscall_linux_test.go b/src/syscall/syscall_linux_test.go
index 92764323ee..153d0efef1 100644
--- a/src/syscall/syscall_linux_test.go
+++ b/src/syscall/syscall_linux_test.go
@@ -9,7 +9,6 @@ import (
"fmt"
"io"
"io/fs"
- "io/ioutil"
"os"
"os/exec"
"os/signal"
@@ -30,7 +29,7 @@ func chtmpdir(t *testing.T) func() {
if err != nil {
t.Fatalf("chtmpdir: %v", err)
}
- d, err := ioutil.TempDir("", "test")
+ d, err := os.MkdirTemp("", "test")
if err != nil {
t.Fatalf("chtmpdir: %v", err)
}
@@ -160,7 +159,7 @@ func TestLinuxDeathSignal(t *testing.T) {
// Copy the test binary to a location that a non-root user can read/execute
// after we drop privileges
- tempDir, err := ioutil.TempDir("", "TestDeathSignal")
+ tempDir, err := os.MkdirTemp("", "TestDeathSignal")
if err != nil {
t.Fatalf("cannot create temporary directory: %v", err)
}
@@ -321,7 +320,7 @@ func TestSyscallNoError(t *testing.T) {
// Copy the test binary to a location that a non-root user can read/execute
// after we drop privileges
- tempDir, err := ioutil.TempDir("", "TestSyscallNoError")
+ tempDir, err := os.MkdirTemp("", "TestSyscallNoError")
if err != nil {
t.Fatalf("cannot create temporary directory: %v", err)
}
@@ -543,7 +542,7 @@ func TestAllThreadsSyscall(t *testing.T) {
func compareStatus(filter, expect string) error {
expected := filter + expect
pid := syscall.Getpid()
- fs, err := ioutil.ReadDir(fmt.Sprintf("/proc/%d/task", pid))
+ fs, err := os.ReadDir(fmt.Sprintf("/proc/%d/task", pid))
if err != nil {
return fmt.Errorf("unable to find %d tasks: %v", pid, err)
}
@@ -551,7 +550,7 @@ func compareStatus(filter, expect string) error {
foundAThread := false
for _, f := range fs {
tf := fmt.Sprintf("/proc/%s/status", f.Name())
- d, err := ioutil.ReadFile(tf)
+ d, err := os.ReadFile(tf)
if err != nil {
// There are a surprising number of ways this
// can error out on linux. We've seen all of