File: service_misc_test.go

package info (click to toggle)
gitlab-shell 14.35.0%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 23,652 kB
  • sloc: ruby: 1,129; makefile: 583; sql: 391; sh: 384
file content (32 lines) | stat: -rw-r--r-- 592 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
24
25
26
27
28
29
30
31
32
// Copyright 2013-2015 Apcera Inc. All rights reserved.

//+build servicetest

package test

import (
	"testing"

	"github.com/apcera/gssapi"
)

func TestIndicateMechs(t *testing.T) {
	expectedMechs := []*gssapi.OID{
		c.GSS_MECH_KRB5,
		// c.GSS_MECH_KRB5_OLD,
		// c.GSS_MECH_KRB5_LEGACY,
		// c.GSS_MECH_IAKERB,
		c.GSS_MECH_SPNEGO,
	}
	mechs, err := c.IndicateMechs()
	if err != nil {
		t.Fatal(err)
	}
	defer mechs.Release()

	for _, oid := range expectedMechs {
		if !mechs.Contains(oid) {
			t.Errorf("Expected to find %s in mechs %s", oid.DebugString(), mechs.DebugString())
		}
	}
}