Example #1
0
  // @Test(priority=3)
  public void createAndDeleteDataDisk() {
    DataStore primaryStore = this.primaryStore;
    VolumeVO volume = createVolume(null, primaryStore.getId());
    VolumeInfo vol = volumeFactory.getVolume(volume.getId(), primaryStore);
    AsyncCallFuture<VolumeApiResult> future = volumeService.createVolumeAsync(vol, primaryStore);
    try {
      future.get();
    } catch (InterruptedException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (ExecutionException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    // delete the volume
    vol = volumeFactory.getVolume(volume.getId(), primaryStore);
    future = volumeService.expungeVolumeAsync(vol);
    try {
      future.get();
    } catch (InterruptedException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (ExecutionException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }
Example #2
0
 @Test(priority = 2)
 public void createVolumeFromTemplate() {
   DataStore primaryStore = this.primaryStore;
   TemplateInfo te = createTemplate();
   VolumeVO volume = createVolume(te.getId(), primaryStore.getId());
   VolumeInfo vol = volumeFactory.getVolume(volume.getId(), primaryStore);
   // ve.createVolumeFromTemplate(primaryStore.getId(), new VHD(), te);
   AsyncCallFuture<VolumeApiResult> future =
       volumeService.createVolumeFromTemplateAsync(vol, primaryStore.getId(), te);
   try {
     future.get();
   } catch (InterruptedException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
   } catch (ExecutionException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
   }
 }