func TestReserve(t *testing.T) { th.SetupHTTP() defer th.TeardownHTTP() MockReserveResponse(t) err := volumeactions.Reserve(client.ServiceClient(), "cd281d77-8217-4830-be95-9528227c105c").ExtractErr() th.AssertNoErr(t, err) }
// CreateVolumeReserve creates a volume reservation. An error will be returned // if the reservation failed. func CreateVolumeReserve(t *testing.T, client *gophercloud.ServiceClient, volume *volumes.Volume) error { if testing.Short() { t.Skip("Skipping test that requires volume reservation in short mode.") } t.Logf("Attempting to reserve volume %s", volume.ID) if err := volumeactions.Reserve(client, volume.ID).ExtractErr(); err != nil { return err } t.Logf("Reserved volume %s", volume.ID) return nil }