use of com.att.cdp.zones.NetworkService in project AJSC by att.
the class TestNetworkService method testSubnets.
/**
* Verifies that we can get floating IP Pools
*
* @throws ZoneException
* If the connection fails, user is not authorized, or the provider cannot perform the operation.
*/
@Test
@Ignore
public void testSubnets() throws ZoneException {
Context context = connect();
NetworkService service = context.getNetworkService();
List<Subnet> subnets = service.getSubnets();
assertNotNull(subnets);
assertFalse(subnets.isEmpty());
for (Subnet subnet : subnets) {
assertNotNull(service.getSubnetById(subnet.getId()));
assertNotNull(service.getSubnetsByName(subnet.getName()));
}
}
use of com.att.cdp.zones.NetworkService in project AJSC by att.
the class TestNetworkService method createIPV4SubnetWithGateway.
/**
* Verifies that we can create a subnet with a specified gateway IP address on a provider
*
* @throws ZoneException
* If the connection fails, user is not authorized, or the provider cannot perform the operation.
*/
@Test
@Ignore
public void createIPV4SubnetWithGateway() throws ZoneException {
Context context = connect();
NetworkService service = context.getNetworkService();
try {
// verify test network exists
verifyTestNetworkHelper();
List<Network> networks = service.getNetworksByName("CDP_Test_Network");
assertNotNull(networks);
assertFalse(networks.isEmpty());
Network testNetwork = networks.get(0);
Subnet subnetWithGateway = new Subnet();
subnetWithGateway.setName("CDP_Test_IPV4_Subnet_With_Gateway");
subnetWithGateway.setNetwork(testNetwork.getId());
subnetWithGateway.setIpv4(true);
subnetWithGateway.setRouting("10.10.10.0/24");
subnetWithGateway.setGatewayIp("10.10.10.1");
service.createSubnet(subnetWithGateway);
List<Subnet> subnets = service.getSubnetsByName("CDP_Test_IPV4_Subnet_With_Gateway");
assertFalse(subnets.isEmpty());
for (Subnet subnet : subnets) {
assertTrue(subnet.getRouting().equalsIgnoreCase("10.10.10.0/24"));
assertTrue(subnet.getGatewayIp().equalsIgnoreCase("10.10.10.1"));
}
} catch (ZoneException ze) {
ze.printStackTrace();
fail("Failed to create the ipv4 test subnet with gateway IP");
}
}
use of com.att.cdp.zones.NetworkService in project AJSC by att.
the class TestNetworkService method setUp.
// Ensure the CDPTestNetwork does not already exist on provider. Relies on delete functioning properly
// comment out to preserve the test networks on provider for debugging
@Ignore
@Before
public final void setUp() throws ZoneException {
Context context = connect();
NetworkService service = context.getNetworkService();
/* try {
List<Network> networks = service.getNetworksByName("CDP_Test_Network");
for (Network network : networks) {
service.deleteNetwork(network);
}
} catch (ZoneException ze) {
ze.printStackTrace();
fail();
}*/
}
use of com.att.cdp.zones.NetworkService in project AJSC by att.
the class TestNetworkService method testDeleteNetwork.
/**
* Test the ability to delete a network
*
* @throws ZoneException
* If the connection fails, user is not authorized, or the provider cannot perform the operation.
*/
@Test
@Ignore
public void testDeleteNetwork() throws ZoneException {
Context context = connect();
NetworkService service = context.getNetworkService();
try {
// ensure test network exists
verifyTestNetworkHelper();
List<Network> networks = service.getNetworksByName("CDP_Test_Network");
assertNotNull(networks);
assertFalse(networks.isEmpty());
// test network deletion
for (Network network : networks) {
if (network.getName().equalsIgnoreCase("CDP_Test_Network")) {
service.deleteNetwork(network);
}
}
networks = service.getNetworksByName("CDP_Test_Network");
assertTrue(networks.isEmpty());
} catch (ZoneException ze) {
ze.printStackTrace();
fail("Failed to delete the test network");
}
}
use of com.att.cdp.zones.NetworkService in project AJSC by att.
the class TestNetworkService method listNetworks.
/**
* Verifies that we can list the existing networks on a provider. This test requires that the provider actually has
* networks installed.
*
* @throws ZoneException
* If the connection fails, user is not authorized, or the provider cannot perform the operation.
*/
@Ignore
@Test
public void listNetworks() throws ZoneException {
Context context = connect();
NetworkService service = context.getNetworkService();
try {
List<Network> networks = service.getNetworks();
assertNotNull(networks);
assertFalse(networks.isEmpty());
for (Network network : networks) {
System.out.println(network.toString());
// assertNotNull(service.getNetworksByName(network.getName()));
// assertNotNull(service.getNetworkById(network.getId()));
}
} catch (ZoneException ze) {
ze.printStackTrace();
fail();
}
}
Aggregations