Search in sources :

Example 96 with Context

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

the class TestNetworkService method testCreateAndDeletePort.

/**
 * Tests that we can create and delete a port
 *
 * @throws ZoneException
 *             If the test cannot connect to the provider
 */
@Test
@Ignore
public void testCreateAndDeletePort() throws ZoneException {
    Context context = connect();
    NetworkService service = context.getNetworkService();
    List<Subnet> subnets = service.getSubnets();
    assertNotNull(subnets);
    assertFalse(subnets.isEmpty());
    Subnet subnet = subnets.get(0);
    Port port = service.createPort(subnet);
    assertNotNull(port);
    assertEquals(port.getSubnetId(), subnet.getId());
    assertNotNull(port.getMacAddr());
    assertNotNull(port.getId());
    assertNotNull(port.getNetwork());
    service.deletePort(port);
}
Also used : Context(com.att.cdp.zones.Context) Port(com.att.cdp.zones.model.Port) NetworkService(com.att.cdp.zones.NetworkService) Subnet(com.att.cdp.zones.model.Subnet) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 97 with Context

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

the class TestComputeService method testServerGetHypervisor.

/**
 * This test case is designed to test geting the hypervisor for a sever.
 *
 * @throws ZoneException
 *             If something goes horribly wrong
 */
@SuppressWarnings("nls")
@Ignore
@Test
public void testServerGetHypervisor() throws ZoneException {
    Context context = connect();
    ComputeService computeService = context.getComputeService();
    List<Server> servers = computeService.getServers();
    for (Server server : servers) {
        System.out.println(server.toString());
        if (server.getHypervisor() != null) {
            System.out.println(server.getHypervisor().toString());
        }
    }
}
Also used : OpenStackContext(com.att.cdp.openstack.OpenStackContext) Context(com.att.cdp.zones.Context) OpenStackServer(com.att.cdp.openstack.model.OpenStackServer) Server(com.att.cdp.zones.model.Server) ComputeService(com.att.cdp.zones.ComputeService) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 98 with Context

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

the class TestComputeService method testListServers.

/**
 * This test case is designed to simply list the existing servers.
 *
 * @throws ZoneException
 *             If something goes horribly wrong
 */
@SuppressWarnings("nls")
@Ignore
@Test
public void testListServers() throws ZoneException {
    Context context = connect();
    ComputeService computeService = context.getComputeService();
    List<Server> servers = computeService.getServers();
    for (Server server : servers) {
        System.out.println(server.toString());
        if (server.getImage() == null) {
            // Map<String, String> attachments = server.getAttachments();
            Map<String, Volume> attachments = server.getVolumes();
            System.out.println("+++No image, volume attachments are: " + attachments.toString());
        }
    }
}
Also used : OpenStackContext(com.att.cdp.openstack.OpenStackContext) Context(com.att.cdp.zones.Context) OpenStackServer(com.att.cdp.openstack.model.OpenStackServer) Server(com.att.cdp.zones.model.Server) Volume(com.att.cdp.zones.model.Volume) ComputeService(com.att.cdp.zones.ComputeService) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 99 with Context

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

the class TestComputeService method testListHypervisors.

/**
 * This test case is designed to simply list the existing hypervisors.
 *
 * @throws ZoneException
 *             If something goes horribly wrong
 */
@SuppressWarnings("nls")
@Ignore
@Test
public void testListHypervisors() throws ZoneException {
    Context context = connect();
    ComputeService computeService = context.getComputeService();
    List<Hypervisor> hypervisors = computeService.getHypervisors();
    for (Hypervisor hypervisor : hypervisors) {
        System.out.println(hypervisor.toString());
    }
}
Also used : OpenStackContext(com.att.cdp.openstack.OpenStackContext) Context(com.att.cdp.zones.Context) Hypervisor(com.att.cdp.zones.model.Hypervisor) ComputeService(com.att.cdp.zones.ComputeService) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 100 with Context

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

the class TestImages method listImages.

/**
 * Verifies that we can list the existing templates on a provider. This test requires that the provider actually has
 * templates installed.
 *
 * @throws ZoneException
 */
@Ignore
@Test
public void listImages() throws ZoneException {
    Context context = connect();
    ImageService service = context.getImageService();
    List<Image> images = service.listImages();
    assertNotNull(images);
    assertFalse(images.isEmpty());
    for (Image image : images) {
        System.out.println(image.toString());
    }
}
Also used : Context(com.att.cdp.zones.Context) Image(com.att.cdp.zones.model.Image) ImageService(com.att.cdp.zones.ImageService) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

Context (com.att.cdp.zones.Context)248 OpenStackContext (com.att.cdp.openstack.OpenStackContext)167 OpenStackBaseException (com.woorea.openstack.base.client.OpenStackBaseException)140 ArrayList (java.util.ArrayList)55 Ignore (org.junit.Ignore)50 Test (org.junit.Test)47 Quantum (com.woorea.openstack.quantum.Quantum)35 ZoneException (com.att.cdp.exceptions.ZoneException)30 NetworkService (com.att.cdp.zones.NetworkService)24 Server (com.att.cdp.zones.model.Server)22 ComputeService (com.att.cdp.zones.ComputeService)21 Network (com.att.cdp.zones.model.Network)19 OpenStackServer (com.att.cdp.openstack.model.OpenStackServer)18 OpenStackSnapshot (com.att.cdp.openstack.model.OpenStackSnapshot)18 Subnet (com.att.cdp.zones.model.Subnet)15 Port (com.att.cdp.zones.model.Port)14 Snapshot (com.att.cdp.zones.model.Snapshot)12 Volume (com.att.cdp.zones.model.Volume)11 OpenStackResponseException (com.woorea.openstack.base.client.OpenStackResponseException)11 ResourceNotFoundException (com.att.cdp.exceptions.ResourceNotFoundException)10