gssapi_test.go 577 B

12345678910111213141516171819202122232425
  1. package gssapi
  2. import (
  3. "testing"
  4. "github.com/jcmturner/gofork/encoding/asn1"
  5. "github.com/stretchr/testify/assert"
  6. )
  7. func TestOID(t *testing.T) {
  8. var tests = []struct {
  9. name OIDName
  10. oid []int
  11. }{
  12. {OIDMSLegacyKRB5, []int{1, 2, 840, 48018, 1, 2, 2}},
  13. {OIDKRB5, []int{1, 2, 840, 113554, 1, 2, 2}},
  14. {OIDSPNEGO, []int{1, 3, 6, 1, 5, 5, 2}},
  15. {OIDGSSIAKerb, []int{1, 3, 6, 1, 5, 2, 5}},
  16. }
  17. for _, tst := range tests {
  18. oid := asn1.ObjectIdentifier(tst.oid)
  19. assert.True(t, oid.Equal(OIDName(tst.name).OID()), "OID value not as expected for %s", tst.name)
  20. }
  21. }