blob: 8841160a24143aca29e952a66987730b4c0a4db7 [file] [log] [blame]
ehdouc2b8dcd2017-01-11 06:01:00 +02001package v2
2
3import (
4 "testing"
5
6 "github.com/gophercloud/gophercloud/acceptance/clients"
7 "github.com/gophercloud/gophercloud/openstack/sharedfilesystems/v2/availabilityzones"
8)
9
10func TestAvailabilityZonesList(t *testing.T) {
11 client, err := clients.NewSharedFileSystemV2Client()
12 if err != nil {
13 t.Fatalf("Unable to create shared file system client: %v", err)
14 }
15
16 allPages, err := availabilityzones.List(client).AllPages()
17 if err != nil {
18 t.Fatalf("Unable to list availability zones: %v", err)
19 }
20
21 zones, err := availabilityzones.ExtractAvailabilityZones(allPages)
22 if err != nil {
23 t.Fatalf("Unable to extract availability zones: %v", err)
24 }
25
26 if len(zones) == 0 {
27 t.Fatal("At least one availability zone was expected to be found")
28 }
29}