File tree Expand file tree Collapse file tree
acceptance/openstack/blockstorage/v3
openstack/blockstorage/v3/volumetypes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ func TestVolumeTypesList(t *testing.T) {
4545 }
4646}
4747
48- func TestVolumeTypesCreate (t * testing.T ) {
48+ func TestVolumeTypesCreateDestory (t * testing.T ) {
4949 client , err := clients .NewBlockStorageV3Client ()
5050 if err != nil {
5151 t .Fatalf ("Unable to create a blockstorage client: %v" , err )
@@ -64,4 +64,6 @@ func TestVolumeTypesCreate(t *testing.T) {
6464 }
6565
6666 tools .PrintResource (t , vt )
67+
68+ defer volumetypes .Delete (client , vt .ID )
6769}
Original file line number Diff line number Diff line change @@ -37,6 +37,14 @@ Example to create a Volume Type
3737 panic(err)
3838 }
3939 fmt.Println(volumeType)
40+
41+ Example to delete a Volume TYpe
42+
43+ typeID := "0fe36e73809d46aeae6705c39077b1b3"
44+ err := volumetypes.Delete(client, typeID).ExtractErr()
45+ if err != nil{
46+ panic(err)
47+ }
4048*/
4149
4250package volumetypes
Original file line number Diff line number Diff line change @@ -80,7 +80,6 @@ func TestCreate(t *testing.T) {
8080 th .AssertEquals (t , n .PublicAccess , true )
8181 th .AssertEquals (t , n .ID , "6d0ff92a-0007-4780-9ece-acfe5876966a" )
8282 th .AssertEquals (t , n .ExtraSpecs ["capabilities" ], "gpu" )
83- th .AssertEquals (t , n .ID , "6d0ff92a-0007-4780-9ece-acfe5876966a" )
8483}
8584
8685func TestDelete (t * testing.T ) {
Original file line number Diff line number Diff line change @@ -17,4 +17,3 @@ func createURL(c *gophercloud.ServiceClient) string {
1717func deleteURL (c * gophercloud.ServiceClient , id string ) string {
1818 return c .ServiceURL ("types" , id )
1919}
20-
You can’t perform that action at this time.
0 commit comments