Mikko Valkonen | 9368c00 | 2017-01-16 18:31:39 +0200 | [diff] [blame] | 1 | package v2 |
| 2 | |
| 3 | import ( |
| 4 | "github.com/gophercloud/gophercloud/acceptance/clients" |
| 5 | "github.com/gophercloud/gophercloud/openstack/sharedfilesystems/v2/shares" |
| 6 | "testing" |
| 7 | ) |
| 8 | |
| 9 | func TestShareCreate(t *testing.T) { |
| 10 | client, err := clients.NewSharedFileSystemV2Client() |
| 11 | if err != nil { |
| 12 | t.Fatalf("Unable to create a sharedfs client: %v", err) |
| 13 | } |
| 14 | |
| 15 | share, err := CreateShare(t, client) |
| 16 | if err != nil { |
| 17 | t.Fatalf("Unable to create a share: %v", err) |
| 18 | } |
| 19 | |
| 20 | defer DeleteShare(t, client, share) |
| 21 | |
| 22 | created, err := shares.Get(client, share.ID).Extract() |
| 23 | if err != nil { |
| 24 | t.Errorf("Unable to retrieve share: %v", err) |
| 25 | } |
| 26 | PrintShare(t, created) |
| 27 | } |