File: statfs_test.go

package info (click to toggle)
golang-github-cilium-ebpf 0.11.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,776 kB
  • sloc: ansic: 1,046; makefile: 103; sh: 100
file content (23 lines) | stat: -rw-r--r-- 411 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package internal

import (
	"testing"

	"github.com/cilium/ebpf/internal/unix"

	qt "github.com/frankban/quicktest"
)

func TestFSType(t *testing.T) {
	for _, fs := range []struct {
		path  string
		magic int64
	}{
		{"/sys/kernel/tracing", unix.TRACEFS_MAGIC},
		{"/sys/fs/bpf", unix.BPF_FS_MAGIC},
	} {
		fst, err := FSType(fs.path)
		qt.Assert(t, err, qt.IsNil)
		qt.Assert(t, fst, qt.Equals, fs.magic)
	}
}