...

Source file src/github.com/Microsoft/go-winio/pkg/etw/provider_test.go

Documentation: github.com/Microsoft/go-winio/pkg/etw

     1  //go:build windows
     2  // +build windows
     3  
     4  package etw
     5  
     6  import (
     7  	"testing"
     8  
     9  	"github.com/Microsoft/go-winio/pkg/guid"
    10  )
    11  
    12  func mustGUIDFromString(t *testing.T, s string) guid.GUID {
    13  	g, err := guid.FromString(s)
    14  	if err != nil {
    15  		t.Fatal(err)
    16  	}
    17  	return g
    18  }
    19  
    20  func Test_ProviderIDFromName(t *testing.T) {
    21  	type testCase struct {
    22  		name string
    23  		g    guid.GUID
    24  	}
    25  	testCases := []testCase{
    26  		{"wincni", mustGUIDFromString(t, "c822b598-f4cc-5a72-7933-ce2a816d033f")},
    27  		{"Moby", mustGUIDFromString(t, "6996f090-c5de-5082-a81e-5841acc3a635")},
    28  		{"ContainerD", mustGUIDFromString(t, "2acb92c0-eb9b-571a-69cf-8f3410f383ad")},
    29  		{"Microsoft.Virtualization.RunHCS", mustGUIDFromString(t, "0B52781F-B24D-5685-DDF6-69830ED40EC3")},
    30  	}
    31  	for _, tc := range testCases {
    32  		g := providerIDFromName(tc.name)
    33  		if g != tc.g {
    34  			t.Fatalf("Incorrect provider GUID.\nExpected: %s\nActual: %s", tc.g, g)
    35  		}
    36  	}
    37  }
    38  

View as plain text