feature/shared file systems: show share details (#127)
* sfs/shares: get a share with details
* sfs/shares: use AssertDeepEquals in get share test
diff --git a/openstack/sharedfilesystems/v2/shares/testing/fixtures.go b/openstack/sharedfilesystems/v2/shares/testing/fixtures.go
index 00bdfe0..83b174f 100644
--- a/openstack/sharedfilesystems/v2/shares/testing/fixtures.go
+++ b/openstack/sharedfilesystems/v2/shares/testing/fixtures.go
@@ -88,3 +88,55 @@
w.WriteHeader(http.StatusAccepted)
})
}
+
+var getResponse = `{
+ "share": {
+ "links": [
+ {
+ "href": "http://172.18.198.54:8786/v2/16e1ab15c35a457e9c2b2aa189f544e1/shares/011d21e2-fbc3-4e4a-9993-9ea223f73264",
+ "rel": "self"
+ },
+ {
+ "href": "http://172.18.198.54:8786/16e1ab15c35a457e9c2b2aa189f544e1/shares/011d21e2-fbc3-4e4a-9993-9ea223f73264",
+ "rel": "bookmark"
+ }
+ ],
+ "availability_zone": "nova",
+ "share_network_id": "713df749-aac0-4a54-af52-10f6c991e80c",
+ "share_server_id": "e268f4aa-d571-43dd-9ab3-f49ad06ffaef",
+ "snapshot_id": null,
+ "id": "011d21e2-fbc3-4e4a-9993-9ea223f73264",
+ "size": 1,
+ "share_type": "25747776-08e5-494f-ab40-a64b9d20d8f7",
+ "share_type_name": "default",
+ "consistency_group_id": "9397c191-8427-4661-a2e8-b23820dc01d4",
+ "project_id": "16e1ab15c35a457e9c2b2aa189f544e1",
+ "metadata": {
+ "project": "my_app",
+ "aim": "doc"
+ },
+ "status": "available",
+ "description": "My custom share London",
+ "host": "manila2@generic1#GENERIC1",
+ "has_replicas": false,
+ "replication_type": null,
+ "task_state": null,
+ "is_public": true,
+ "snapshot_support": true,
+ "name": "my_test_share",
+ "created_at": "2015-09-18T10:25:24.000000",
+ "share_proto": "NFS",
+ "volume_type": "default",
+ "source_cgsnapshot_member_id": null
+ }
+}`
+
+// MockGetResponse creates a mock get response
+func MockGetResponse(t *testing.T) {
+ th.Mux.HandleFunc(shareEndpoint+"/"+shareID, func(w http.ResponseWriter, r *http.Request) {
+ th.TestMethod(t, r, "GET")
+ th.TestHeader(t, r, "X-Auth-Token", fake.TokenID)
+ w.WriteHeader(http.StatusOK)
+ fmt.Fprintf(w, getResponse)
+ })
+}