summaryrefslogtreecommitdiff
path: root/cmd/ioworkload/scenario_mountfs_test.go
blob: c1c317af6e9c3fb642b5a5f708bf5a2aa68b1984 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package main

import "testing"

func TestListnsSyscallNrForArch(t *testing.T) {
	for _, tc := range []struct {
		name    string
		arch    string
		want    uintptr
		wantErr bool
	}{
		{name: "amd64", arch: "amd64", want: 470},
		{name: "arm64", arch: "arm64", want: 470},
		{name: "unsupported", arch: "riscv64", wantErr: true},
	} {
		got, err := listnsSyscallNrForArch(tc.arch)
		if tc.wantErr {
			if err == nil {
				t.Fatalf("%s: expected error", tc.name)
			}
			continue
		}
		if err != nil {
			t.Fatalf("%s: unexpected error: %v", tc.name, err)
		}
		if got != tc.want {
			t.Fatalf("%s: got %d, want %d", tc.name, got, tc.want)
		}
	}
}