func TestUnreserve(t *testing.T) { th.SetupHTTP() defer th.TeardownHTTP() MockUnreserveResponse(t) err := volumeactions.Unreserve(client.ServiceClient(), "cd281d77-8217-4830-be95-9528227c105c").ExtractErr() th.AssertNoErr(t, err) }
// DeleteVolumeReserve deletes a volume reservation. A fatal error will occur // if the deletion request failed. This works best when used as a deferred // function. func DeleteVolumeReserve(t *testing.T, client *gophercloud.ServiceClient, volume *volumes.Volume) { if testing.Short() { t.Skip("Skipping test that requires volume reservation in short mode.") } t.Logf("Attempting to unreserve volume %s", volume.ID) if err := volumeactions.Unreserve(client, volume.ID).ExtractErr(); err != nil { t.Fatalf("Unable to unreserve volume %s: %v", volume.ID, err) } t.Logf("Unreserved volume %s", volume.ID) }