blob: 364f69baabce207be5fdd1ae31d7998baf2aa27a [file] [log] [blame]
Ash Wilsonfd794d52014-09-03 14:30:43 -04001// +build acceptance
2
3package v3
4
5import (
6 "testing"
7
Joe Topjian918f5732016-08-15 08:47:08 -06008 "github.com/gophercloud/gophercloud/acceptance/clients"
9 "github.com/gophercloud/gophercloud/openstack/identity/v3/services"
Ash Wilsonfd794d52014-09-03 14:30:43 -040010)
11
Joe Topjian918f5732016-08-15 08:47:08 -060012func TestServicesList(t *testing.T) {
13 client, err := clients.NewIdentityV3Client()
Ash Wilsondd7188d2014-09-05 14:02:42 -040014 if err != nil {
Joe Topjian918f5732016-08-15 08:47:08 -060015 t.Fatalf("Unable to obtain an identity client: %v")
Ash Wilsonfd794d52014-09-03 14:30:43 -040016 }
Joe Topjian918f5732016-08-15 08:47:08 -060017
18 allPages, err := services.List(client, nil).AllPages()
19 if err != nil {
20 t.Fatalf("Unable to list services: %v", err)
21 }
22
23 allServices, err := services.ExtractServices(allPages)
24 if err != nil {
25 t.Fatalf("Unable to extract services: %v", err)
26 }
27
28 for _, service := range allServices {
29 PrintService(t, &service)
30 }
31
Ash Wilsonfd794d52014-09-03 14:30:43 -040032}