Skip to content

Commit 0514fec

Browse files
kolyshkingopherbot
authored andcommitted
unix: rm unused zos test helper functions
These functions are not used anywhere in zos tests. Checked with: git grep -wE 'mktmpfifo|touch|chtmpdir' \ $(git grep -lw zos | grep _test.go; ls *_zos_test.go) Change-Id: Ie8b25640578e1c607dd4e4f0fe4e7869f8e3f5d3 Reviewed-on: https://go-review.googlesource.com/c/sys/+/526296 Reviewed-by: Tobias Klauser <[email protected]> Reviewed-by: Cherry Mui <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Dustin Ward <[email protected]>
1 parent bfd1ebb commit 0514fec

File tree

1 file changed

+0
-53
lines changed

1 file changed

+0
-53
lines changed

unix/syscall_zos_test.go

-53
Original file line numberDiff line numberDiff line change
@@ -553,59 +553,6 @@ func TestMkdev(t *testing.T) {
553553
}
554554
}
555555

556-
// mktmpfifo creates a temporary FIFO and provides a cleanup function.
557-
func mktmpfifo(t *testing.T) (*os.File, func()) {
558-
err := unix.Mkfifo("fifo", 0666)
559-
if err != nil {
560-
t.Fatalf("mktmpfifo: failed to create FIFO: %v", err)
561-
}
562-
563-
f, err := os.OpenFile("fifo", os.O_RDWR, 0666)
564-
if err != nil {
565-
os.Remove("fifo")
566-
t.Fatalf("mktmpfifo: failed to open FIFO: %v", err)
567-
}
568-
569-
return f, func() {
570-
f.Close()
571-
os.Remove("fifo")
572-
}
573-
}
574-
575-
// utilities taken from os/os_test.go
576-
577-
func touch(t *testing.T, name string) {
578-
f, err := os.Create(name)
579-
if err != nil {
580-
t.Fatal(err)
581-
}
582-
if err := f.Close(); err != nil {
583-
t.Fatal(err)
584-
}
585-
}
586-
587-
// chtmpdir changes the working directory to a new temporary directory and
588-
// provides a cleanup function. Used when PWD is read-only.
589-
func chtmpdir(t *testing.T) func() {
590-
oldwd, err := os.Getwd()
591-
if err != nil {
592-
t.Fatalf("chtmpdir: %v", err)
593-
}
594-
d, err := ioutil.TempDir("", "test")
595-
if err != nil {
596-
t.Fatalf("chtmpdir: %v", err)
597-
}
598-
if err := os.Chdir(d); err != nil {
599-
t.Fatalf("chtmpdir: %v", err)
600-
}
601-
return func() {
602-
if err := os.Chdir(oldwd); err != nil {
603-
t.Fatalf("chtmpdir: %v", err)
604-
}
605-
os.RemoveAll(d)
606-
}
607-
}
608-
609556
func TestMountUnmount(t *testing.T) {
610557
// use an available fs
611558
var buffer struct {

0 commit comments

Comments
 (0)