use of org.opennms.test.system.api.AbstractTestEnvironment in project opennms by OpenNMS.
the class MinionHeartbeatOutageIT method restartContainer.
private void restartContainer(ContainerAlias alias) {
final DockerClient docker = ((AbstractTestEnvironment) testEnvironment).getDockerClient();
final String id = testEnvironment.getContainerInfo(alias).id();
final Logger logger = getLogger();
try {
logger.info("Restarting container: {} -> {}", alias, id);
docker.restartContainer(id);
logger.info("Container restarted: {} -> {}", alias, id);
} catch (DockerException | InterruptedException e) {
logger.warn("Unexpected exception while restarting container {}", id, e);
}
}
use of org.opennms.test.system.api.AbstractTestEnvironment in project opennms by OpenNMS.
the class SyslogKafkaElasticsearch5OutageIT method getEs5Address.
protected InetSocketAddress getEs5Address() {
try {
// Fetch an up-to-date ContainerInfo for the ELASTICSEARCH_5 container
final DockerClient docker = ((AbstractTestEnvironment) testEnvironment).getDockerClient();
final String id = testEnvironment.getContainerInfo(ContainerAlias.ELASTICSEARCH_5).id();
ContainerInfo info = docker.inspectContainer(id);
return testEnvironment.getServiceAddress(info, 9200, "tcp");
} catch (DockerException | InterruptedException e) {
LOG.error("Unexpected exception trying to fetch Elassticsearch port", e);
return null;
}
}
use of org.opennms.test.system.api.AbstractTestEnvironment in project opennms by OpenNMS.
the class SyslogKafkaElasticsearchBufferingIT method stopContainer.
private void stopContainer(ContainerAlias alias) {
final DockerClient docker = ((AbstractTestEnvironment) testEnvironment).getDockerClient();
final String id = testEnvironment.getContainerInfo(alias).id();
try {
LOG.info("Stopping container: {} -> {}", alias, id);
docker.stopContainer(id, 60);
LOG.info("Container stopped: {} -> {}", alias, id);
} catch (DockerException | InterruptedException e) {
LOG.warn("Unexpected exception while stopping container {}", id, e);
}
}
use of org.opennms.test.system.api.AbstractTestEnvironment in project opennms by OpenNMS.
the class SyslogKafkaElasticsearchBufferingIT method startContainer.
private void startContainer(ContainerAlias alias) {
final DockerClient docker = ((AbstractTestEnvironment) testEnvironment).getDockerClient();
final String id = testEnvironment.getContainerInfo(alias).id();
try {
LOG.info("Starting container: {} -> {}", alias, id);
docker.startContainer(id);
LOG.info("Container started: {} -> {}", alias, id);
} catch (DockerException | InterruptedException e) {
LOG.warn("Unexpected exception while starting container {}", id, e);
}
}
Aggregations