github.com/cilium/ebpf@v0.15.1-0.20240517100537-8079b37aa138/internal/statfs_test.go (about) 1 package internal 2 3 import ( 4 "testing" 5 6 "github.com/cilium/ebpf/internal/unix" 7 8 "github.com/go-quicktest/qt" 9 ) 10 11 func TestFSType(t *testing.T) { 12 for _, fs := range []struct { 13 path string 14 magic int64 15 }{ 16 {"/sys/kernel/tracing", unix.TRACEFS_MAGIC}, 17 {"/sys/fs/bpf", unix.BPF_FS_MAGIC}, 18 } { 19 fst, err := FSType(fs.path) 20 qt.Assert(t, qt.IsNil(err)) 21 qt.Assert(t, qt.Equals(fst, fs.magic)) 22 } 23 }