document UUID and SourceType as required; rackspace unit test
diff --git a/rackspace/compute/v2/bootfromvolume/delegate_test.go b/rackspace/compute/v2/bootfromvolume/delegate_test.go
index a564982..794f0c8 100644
--- a/rackspace/compute/v2/bootfromvolume/delegate_test.go
+++ b/rackspace/compute/v2/bootfromvolume/delegate_test.go
@@ -1 +1,50 @@
package bootfromvolume
+
+import (
+ "testing"
+
+ osBFV "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/bootfromvolume"
+ "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 := osBFV.CreateOptsExt{
+ CreateOptsBuilder: base,
+ BlockDevice: osBFV.BlockDevice{
+ UUID: "123456",
+ SourceType: "image",
+ DestinationType: "volume",
+ VolumeSize: 10,
+ },
+ }
+
+ expected := `
+ {
+ "server": {
+ "name": "createdserver",
+ "imageRef": "asdfasdfasdf",
+ "flavorRef": "performance1-1",
+ "block_device_mapping_v2":[
+ {
+ "uuid":"123456",
+ "source_type":"image",
+ "destination_type":"volume",
+ "boot_index": "0",
+ "delete_on_termination": "false",
+ "volume_size": "10"
+ }
+ ]
+ }
+ }
+ `
+ actual, err := ext.ToServerCreateMap()
+ th.AssertNoErr(t, err)
+ th.CheckJSONEquals(t, expected, actual)
+}