Beispiel #1
0
  @Test
  public void instantiate() {
    VirtualMachinePool vmPool = new VirtualMachinePool(client);

    res = vmPool.info();
    assertTrue(res.getErrorMessage(), !res.isError());

    assertTrue(vmPool.getLength() == 0);

    String tmpl_str = "NAME = vrtemplate\n" + "CPU = 0.1\n" + "MEMORY = 64\n";

    res = Template.allocate(client, tmpl_str);
    assertTrue(res.getErrorMessage(), !res.isError());

    int tmplid = Integer.parseInt(res.getMessage());

    res = vrouter.instantiate(3, tmplid);
    assertTrue(res.getErrorMessage(), !res.isError());

    res = vmPool.info();
    assertTrue(res.getErrorMessage(), !res.isError());

    assertTrue(vmPool.getLength() == 3);
  }