Exemplo n.º 1
0
func (s *S) TestGetVirtualMachineByName(c *check.C) {
	client, _ := api.NewRPCClient("http://localhost:2633/RPC2", "oneadmin", "RaifZuewjoc4")
	vm := VirtualMachineReqs{VMName: "yeshapp", Client: client}
	res, error := vm.GetVirtualMachineByName()
	fmt.Println(res[0].Id)
	c.Assert(error, check.IsNil)
}
Exemplo n.º 2
0
func (s *S) TestCreate(c *check.C) {
	//oneadmin:yib4OquafUp1
	client, _ := api.NewRPCClient("http://localhost:2633/RPC2", "oneadmin", "TaifZuewuijr4")
	vmObj := VirtualMachine{Name: "test", TemplateName: "sass", Cpu: "1", Memory: "1024", Image: "", Client: client, ContextMap: map[string]string{"assembly_id": "ASM-007", "assemblies_id": "AMS-007"}} //memory in terms of MB! duh!
	_, error := vmObj.Create()
	c.Assert(error, check.IsNil)
}
Exemplo n.º 3
0
func (s *S) TestGetTemplateByName(c *check.C) {
	client, _ := api.NewRPCClient("http://localhost:2633/RPC2", "oneadmin", "RaifZuewjoc4")
	flav := TemplateReqs{TemplateName: "newone", Client: client}
	res, error := flav.GetTemplateByName()
	fmt.Println(res[0].Id)
	c.Assert(error, check.IsNil)
}