From c35ea6b2cda8ac68f2b4a9f6471ca7e09865a6ee Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Fri, 2 Jun 2017 12:27:10 +1000 Subject: [PATCH] Use octal values for file mode in filenotify poller and sysinfo_linux tests Closes #33484. Signed-off-by: Tim Potter --- pkg/filenotify/poller_test.go | 2 +- pkg/sysinfo/sysinfo_linux_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/filenotify/poller_test.go b/pkg/filenotify/poller_test.go index b74bd935a0..d854201991 100644 --- a/pkg/filenotify/poller_test.go +++ b/pkg/filenotify/poller_test.go @@ -61,7 +61,7 @@ func TestPollerEvent(t *testing.T) { default: } - if err := ioutil.WriteFile(f.Name(), []byte("hello"), 644); err != nil { + if err := ioutil.WriteFile(f.Name(), []byte("hello"), 0644); err != nil { t.Fatal(err) } if err := assertEvent(w, fsnotify.Write); err != nil { diff --git a/pkg/sysinfo/sysinfo_linux_test.go b/pkg/sysinfo/sysinfo_linux_test.go index fae0fdffbb..849e8f5cdc 100644 --- a/pkg/sysinfo/sysinfo_linux_test.go +++ b/pkg/sysinfo/sysinfo_linux_test.go @@ -16,7 +16,7 @@ func TestReadProcBool(t *testing.T) { defer os.RemoveAll(tmpDir) procFile := filepath.Join(tmpDir, "read-proc-bool") - if err := ioutil.WriteFile(procFile, []byte("1"), 644); err != nil { + if err := ioutil.WriteFile(procFile, []byte("1"), 0644); err != nil { t.Fatal(err) } @@ -24,7 +24,7 @@ func TestReadProcBool(t *testing.T) { t.Fatal("expected proc bool to be true, got false") } - if err := ioutil.WriteFile(procFile, []byte("0"), 644); err != nil { + if err := ioutil.WriteFile(procFile, []byte("0"), 0644); err != nil { t.Fatal(err) } if readProcBool(procFile) { @@ -48,7 +48,7 @@ func TestCgroupEnabled(t *testing.T) { t.Fatal("cgroupEnabled should be false") } - if err := ioutil.WriteFile(path.Join(cgroupDir, "test"), []byte{}, 644); err != nil { + if err := ioutil.WriteFile(path.Join(cgroupDir, "test"), []byte{}, 0644); err != nil { t.Fatal(err) }