blob: b241cd90e4ab435a0bc4879f29037faf84b0ad84 [file] [log] [blame]
jrperritt95b74c82015-07-28 20:39:27 -06001// +build acceptance
2
3package v2
4
5import (
6 "os"
7 "testing"
8
jrperritt95b74c82015-07-28 20:39:27 -06009 "github.com/rackspace/gophercloud/rackspace/identity/v2/tokens"
10 th "github.com/rackspace/gophercloud/testhelper"
11)
12
jrperritt95b74c82015-07-28 20:39:27 -060013func TestTokenAuth(t *testing.T) {
14 authedClient := createClient(t, true)
15 token := authedClient.TokenID
16
17 tenantID := os.Getenv("RS_TENANT_ID")
18 if tenantID == "" {
19 t.Skip("You must set RS_TENANT_ID environment variable to run this test")
20 }
21
22 authOpts := tokens.AuthOptions{}
23 authOpts.TenantID = tenantID
jrperrittfbc04092016-02-17 15:24:11 -060024 authOpts.TokenID = token
jrperritt95b74c82015-07-28 20:39:27 -060025
26 _, err := tokens.Create(authedClient, authOpts).ExtractToken()
27 th.AssertNoErr(t, err)
28}