Test request body generation.
diff --git a/openstack/compute/v2/extensions/diskconfig/requests_test.go b/openstack/compute/v2/extensions/diskconfig/requests_test.go
new file mode 100644
index 0000000..6446ed6
--- /dev/null
+++ b/openstack/compute/v2/extensions/diskconfig/requests_test.go
@@ -0,0 +1,61 @@
+package diskconfig
+
+import (
+ "testing"
+
+ "github.com/rackspace/gophercloud/openstack/compute/v2/servers"
+ th "github.com/rackspace/gophercloud/testhelper"
+)
+
+func TestCreateOpts(t *testing.T) {
+ base := servers.CreateOpts{
+ Name: "createdserver",
+ ImageRef: "asdfasdfasdf",
+ FlavorRef: "performance1-1",
+ }
+
+ ext := CreateOptsExt{
+ CreateOptsBuilder: base,
+ DiskConfig: Manual,
+ }
+
+ expected := `
+ {
+ "server": {
+ "name": "createdserver",
+ "imageRef": "asdfasdfasdf",
+ "flavorRef": "performance1-1",
+ "OS-DCF:diskConfig": "MANUAL"
+ }
+ }
+ `
+ th.CheckJSONEquals(t, expected, ext.ToServerCreateMap())
+}
+
+func TestRebuildOpts(t *testing.T) {
+ base := servers.RebuildOpts{
+ Name: "createdserver",
+ AdminPass: "swordfish",
+ ImageID: "asdfasdfasdf",
+ }
+
+ ext := RebuildOptsExt{
+ RebuildOptsBuilder: base,
+ DiskConfig: Auto,
+ }
+
+ actual, err := ext.ToServerRebuildMap()
+ th.AssertNoErr(t, err)
+
+ expected := `
+ {
+ "rebuild": {
+ "name": "createdserver",
+ "imageRef": "asdfasdfasdf",
+ "adminPass": "swordfish",
+ "OS-DCF:diskConfig": "AUTO"
+ }
+ }
+ `
+ th.CheckJSONEquals(t, expected, actual)
+}