lib9p

Go 9P library.
Log | Files | Refs | LICENSE

commit 1c1350af11687f183d26b16c8a50c76c7f0726db
parent f4a448d96dca91cfc19d4f463426518213d1cbd3
Author: Matsuda <info@mtkn.jp>
Date:   Sat, 27 Jan 2024 07:17:14 +0900

delete diskfs.TestChgrp which depends on specific user and group

Diffstat:
Mdiskfs/stat_unix_test.go | 59-----------------------------------------------------------
1 file changed, 0 insertions(+), 59 deletions(-)

diff --git a/diskfs/stat_unix_test.go b/diskfs/stat_unix_test.go @@ -40,62 +40,3 @@ func BenchmarkGID(b *testing.B) { } } } - -func TestChgrp(t *testing.T) { - cr, sw := io.Pipe() - defer cr.Close() - defer sw.Close() - sr, cw := io.Pipe() - defer sr.Close() - defer cw.Close() - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - disk, err := Open(testdir) - if err != nil { - t.Fatalf("open dir: %v", err) - } - s := lib9p.NewServer(disk) - go s.Serve(ctx, sr, sw) - c := client.NewClient(ctx, 8*1024, "kenji", cr, cw) - _, err = c.Attach(^uint16(0), 0, lib9p.NOFID, "kenji", "") - if err != nil { - t.Fatalf("attach: %v", err) - } - wname := []string{"a"} - wqid, err := c.Walk(0, 0, 1, wname) - if len(wqid) != len(wname) || err != nil { - t.Fatalf("file not found: %v", err) - } - st, err := c.Stat(0, 1) - if err != nil { - t.Fatalf("stat: %v", err) - } - oldGid := st.Gid - t.Logf("old stat: %v", st) - st.Gid = "wheel" - err = c.Wstat(0, 1, st) - if err != nil { - t.Fatalf("wstat: %v", err) - } - st, err = c.Stat(0, 1) - if err != nil { - t.Fatalf("stat: %v", err) - } - t.Logf("new stat: %v", st) - if st.Gid != "wheel" { - t.Fatal("gid not changed to wheel.") - } - st.Gid = oldGid - err = c.Wstat(0, 1, st) - if err != nil { - t.Fatalf("wstat: %v", err) - } - st, err = c.Stat(0, 1) - if err != nil { - t.Fatalf("stat: %v", err) - } - t.Logf("restored stat: %v", st) - if st.Gid != oldGid { - t.Fatalf("gid not restored to %v.", oldGid) - } -}