Debian Codegraph @

link/helpers_windows_test.go

raw symbols SCIP
1 package link
2
3 import (
4 "errors"
5 "os"
6 "testing"
7
8 "golang.org/x/sys/windows"
9
10 "github.com/go-quicktest/qt"
11
12 "github.com/cilium/ebpf"
13 )
14
15 // windowsProgramTypeForGUID resolves a GUID to a ProgramType.
16 func windowsProgramTypeForGUID(tb testing.TB, guid windows.GUID) ebpf.ProgramType {
17 programType, err := ebpf.WindowsProgramTypeForGUID(guid.String())
18 if errors.Is(err, os.ErrNotExist) {
19 tb.Skipf("Attach type not found for GUID %v", guid)
20 }
21 qt.Assert(tb, qt.IsNil(err))
22 return programType
23 }
24
25 // windowsAttachTypeForGUID resolves a GUID to an AttachType.
26 func windowsAttachTypeForGUID(tb testing.TB, guid windows.GUID) ebpf.AttachType {
27 attachType, err := ebpf.WindowsAttachTypeForGUID(guid.String())
28 if errors.Is(err, os.ErrNotExist) {
29 tb.Skipf("Attach type not found for GUID %v", guid)
30 }
31 qt.Assert(tb, qt.IsNil(err))
32 return attachType
33 }