feature/shared file systems: share acceptance tests (#128)
* feature/filestorage: acceptance tests
Implements acceptance tests for `sharedfilesystems/v2/shares`
* sfs/acceptance: create share-network in env script
Adds creation of a share-network in the acceptance test environment
setup script, and stores the network id in an environment variable
* sfs: adds ShareNetworkID to AcceptanceTestChoices
Gets ShareNetworkID from the OS environment variable:
`OS_SHARE_NETWORK_ID`
* sfs: removes hard-coding of the share-network-id
* sfs: add OS_SHARE_NETWORK_ID to acceptance README
* sfs/acceptance: move WaitForStatus to acc. tests
Moves the `WaitForStatus`-function from the actual library to the
acceptance test folder and does not export it
diff --git a/acceptance/openstack/sharedfilesystems/v2/shares_test.go b/acceptance/openstack/sharedfilesystems/v2/shares_test.go
new file mode 100644
index 0000000..ed5d7cc
--- /dev/null
+++ b/acceptance/openstack/sharedfilesystems/v2/shares_test.go
@@ -0,0 +1,27 @@
+package v2
+
+import (
+ "github.com/gophercloud/gophercloud/acceptance/clients"
+ "github.com/gophercloud/gophercloud/openstack/sharedfilesystems/v2/shares"
+ "testing"
+)
+
+func TestShareCreate(t *testing.T) {
+ client, err := clients.NewSharedFileSystemV2Client()
+ if err != nil {
+ t.Fatalf("Unable to create a sharedfs client: %v", err)
+ }
+
+ share, err := CreateShare(t, client)
+ if err != nil {
+ t.Fatalf("Unable to create a share: %v", err)
+ }
+
+ defer DeleteShare(t, client, share)
+
+ created, err := shares.Get(client, share.ID).Extract()
+ if err != nil {
+ t.Errorf("Unable to retrieve share: %v", err)
+ }
+ PrintShare(t, created)
+}