Search in sources :

Example 1 with SnapshotService

use of com.att.cdp.zones.SnapshotService in project AJSC by att.

the class TestOpenStackContext method testLoginLogout.

/**
 * Test that we can login and out of the provider, and access the services once logged in (so we dont have to
 * repeatedly login/out)
 *
 * @throws ZoneException
 */
@Test
@Ignore
public void testLoginLogout() throws ZoneException {
    OpenStackContext context = login();
    /*
         * make sure we can retreive all of the services
         */
    ComputeService computeService = context.getComputeService();
    assertNotNull(computeService);
    IdentityService identityService = context.getIdentityService();
    assertNotNull(identityService);
    ImageService imageService = context.getImageService();
    assertNotNull(imageService);
    NetworkService networkService = context.getNetworkService();
    assertNotNull(networkService);
    VolumeService volumeService = context.getVolumeService();
    assertNotNull(volumeService);
    SnapshotService snapshotService = context.getSnapshotService();
    assertNotNull(snapshotService);
    StackService stackService = context.getStackService();
    assertNotNull(stackService);
    /*
         * Services are locally cached by the provider context. If we get them again, we should get the same exact
         * object. Check that too.
         */
    assertTrue(computeService == context.getComputeService());
    assertTrue(identityService == context.getIdentityService());
    assertTrue(imageService == context.getImageService());
    assertTrue(networkService == context.getNetworkService());
    assertTrue(volumeService == context.getVolumeService());
    assertTrue(snapshotService == context.getSnapshotService());
    assertTrue(stackService == context.getStackService());
    /*
         * Test that we can also obtain the connectors
         */
    GlanceConnector glanceConnector = context.getGlanceConnector();
    assertNotNull(glanceConnector);
    NovaConnector novaConnector = context.getNovaConnector();
    assertNotNull(novaConnector);
    QuantumConnector quantumConnector = context.getQuantumConnector();
    assertNotNull(quantumConnector);
    /*
         * Connectors are locally cached, check that
         */
    assertTrue(glanceConnector == context.getGlanceConnector());
    assertTrue(novaConnector == context.getNovaConnector());
    assertTrue(quantumConnector == context.getQuantumConnector());
    /*
         * Now, check that we can obtain the tenant as well
         */
    Tenant tenant = context.getTenant();
    assertNotNull(tenant);
    assertEquals(tenant.getName(), context.getTenantName());
    assertEquals(tenant.getId(), context.getTenantId());
    logout(context);
}
Also used : IdentityService(com.att.cdp.zones.IdentityService) SnapshotService(com.att.cdp.zones.SnapshotService) StackService(com.att.cdp.zones.StackService) Tenant(com.att.cdp.zones.model.Tenant) GlanceConnector(com.att.cdp.openstack.connectors.GlanceConnector) VolumeService(com.att.cdp.zones.VolumeService) QuantumConnector(com.att.cdp.openstack.connectors.QuantumConnector) NetworkService(com.att.cdp.zones.NetworkService) NovaConnector(com.att.cdp.openstack.connectors.NovaConnector) OpenStackComputeService(com.att.cdp.openstack.v2.OpenStackComputeService) ComputeService(com.att.cdp.zones.ComputeService) ImageService(com.att.cdp.zones.ImageService) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 2 with SnapshotService

use of com.att.cdp.zones.SnapshotService in project AJSC by att.

the class TestSnapshotService method DeleteSnapshot.

@Test
@Ignore
public void DeleteSnapshot() throws ZoneException {
    Context context = connect();
    String id = "9128-20ffac0c7ccc";
    SnapshotService service = context.getSnapshotService();
    service.destroySnapshot(id);
}
Also used : Context(com.att.cdp.zones.Context) SnapshotService(com.att.cdp.zones.SnapshotService) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 3 with SnapshotService

use of com.att.cdp.zones.SnapshotService in project AJSC by att.

the class TestSnapshotService method testSnapshots.

/**
 * @throws ZoneException
 */
@Test
@Ignore
public void testSnapshots() throws ZoneException {
    Context context = connect();
    SnapshotService service = context.getSnapshotService();
    List<Snapshot> snapshots = service.getSnapshots();
    assertNotNull(snapshots);
    for (Snapshot snapshot : snapshots) {
        assertNotNull(service.getSnapshot(snapshot.getId()));
        assertNotNull(service.getSnapshots(snapshot.getName()));
    }
}
Also used : Context(com.att.cdp.zones.Context) SnapshotService(com.att.cdp.zones.SnapshotService) Snapshot(com.att.cdp.zones.model.Snapshot) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 4 with SnapshotService

use of com.att.cdp.zones.SnapshotService in project AJSC by att.

the class TestSnapshotService method CreateSnapshot.

@Test
@Ignore
public void CreateSnapshot() throws ZoneException {
    Context context = connect();
    Snapshot temp = new Snapshot();
    temp.setName("Snapshots");
    temp.setDescription("Test");
    temp.setVolumeId("42d6-8a23-f357bf767f61");
    SnapshotService service = context.getSnapshotService();
    Snapshot snap = service.createSnapshot(temp);
    assertNotNull(snap);
}
Also used : Context(com.att.cdp.zones.Context) Snapshot(com.att.cdp.zones.model.Snapshot) SnapshotService(com.att.cdp.zones.SnapshotService) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 5 with SnapshotService

use of com.att.cdp.zones.SnapshotService in project AJSC by att.

the class TestSnapshotService method testSnapshot.

@Test(expected = Exception.class)
@Ignore
public void testSnapshot() throws ZoneException {
    Context context = connect();
    SnapshotService service = context.getSnapshotService();
    List<Snapshot> snapshots = service.getSnapshots();
    service.getSnapshot("Test");
    ;
    service.getSnapshots("Test");
}
Also used : Context(com.att.cdp.zones.Context) SnapshotService(com.att.cdp.zones.SnapshotService) Snapshot(com.att.cdp.zones.model.Snapshot) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

SnapshotService (com.att.cdp.zones.SnapshotService)6 Ignore (org.junit.Ignore)6 Test (org.junit.Test)6 Context (com.att.cdp.zones.Context)5 Snapshot (com.att.cdp.zones.model.Snapshot)4 GlanceConnector (com.att.cdp.openstack.connectors.GlanceConnector)1 NovaConnector (com.att.cdp.openstack.connectors.NovaConnector)1 QuantumConnector (com.att.cdp.openstack.connectors.QuantumConnector)1 OpenStackComputeService (com.att.cdp.openstack.v2.OpenStackComputeService)1 ComputeService (com.att.cdp.zones.ComputeService)1 IdentityService (com.att.cdp.zones.IdentityService)1 ImageService (com.att.cdp.zones.ImageService)1 NetworkService (com.att.cdp.zones.NetworkService)1 StackService (com.att.cdp.zones.StackService)1 VolumeService (com.att.cdp.zones.VolumeService)1 Tenant (com.att.cdp.zones.model.Tenant)1