Ejemplo n.º 1
0
func TestDelete(t *testing.T) {
	var apiServer = testUtil.CreateDeleteTestRequestServer(t, token, "/other")
	defer apiServer.Close()

	err := util.Delete(apiServer.URL+"/other", token, *http.DefaultClient)
	testUtil.IsNil(t, err)
}
Ejemplo n.º 2
0
func TestDeleteUser(t *testing.T) {
	name := "user"
	apiServer := testUtil.CreateDeleteTestRequestServer(t, tokn, "/instanceID/users/"+name)
	defer apiServer.Close()

	service := CreateDatabaseService(apiServer.URL)
	err := service.DeleteUser("instanceID", name)
	testUtil.IsNil(t, err)
}
func TestDeleteVolumeType(t *testing.T) {
	name := "id"
	apiServer := testUtil.CreateDeleteTestRequestServer(t, tokn, "types/"+name)
	defer apiServer.Close()

	service := CreateVolumeService(apiServer.URL)
	err := service.DeleteVolumeType(name)
	testUtil.IsNil(t, err)
}
func TestDeleteSecurityGroupRule(t *testing.T) {
	name := "securitygrouprule"
	apiServer := testUtil.CreateDeleteTestRequestServer(t, tokn, "/os-security-group-rules/"+name)
	defer apiServer.Close()

	service := CreateComputeService(apiServer.URL)
	err := service.DeleteSecurityGroupRule(name)
	testUtil.IsNil(t, err)
}
Ejemplo n.º 5
0
func TestDeleteServer(t *testing.T) {

	apiServer := testUtil.CreateDeleteTestRequestServer(t, tokn, "/servers/server")
	defer apiServer.Close()

	serverService := CreateComputeService(apiServer.URL)

	err := serverService.DeleteServer("server")
	testUtil.IsNil(t, err)
}
Ejemplo n.º 6
0
func TestDeleteNetwork(t *testing.T) {
	name := "networkName"
	apiServer := testUtil.CreateDeleteTestRequestServer(t, tokn, "/networks/"+name)
	defer apiServer.Close()

	networkService := CreateNetworkService(apiServer.URL)
	err := networkService.DeleteNetwork(name)
	if err != nil {
		t.Error(err)
	}
}
func TestDeleteFloatingIP(t *testing.T) {
	name := "keypairName"
	apiServer := testUtil.CreateDeleteTestRequestServer(t, tokn, "os-floating-ips/"+name)
	defer apiServer.Close()

	service := CreateComputeService(apiServer.URL)
	err := service.DeleteFloatingIP(name)
	if err != nil {
		t.Error(err)
	}
}
func TestDeleteVolumeAttachment(t *testing.T) {
	apiServer := testUtil.CreateDeleteTestRequestServer(t, tokn, "/servers/serverID/os-volume_attachments/Id")
	defer apiServer.Close()

	service := CreateComputeService(apiServer.URL)

	err := service.DeleteVolumeAttachment("serverID", "Id")
	if err != nil {
		t.Fatal(err)
	}
}
Ejemplo n.º 9
0
func TestDeletePort(t *testing.T) {
	portName := "portName"
	apiServer := testUtil.CreateDeleteTestRequestServer(t, tokn, "/ports/"+portName)
	defer apiServer.Close()

	networkService := CreateNetworkService(apiServer.URL)
	err := networkService.DeletePort(portName)
	if err != nil {
		t.Error(err)
	}
}