use of com.blackducksoftware.bdio2.model.Project in project terra-resource-buffer by DataBiosphere.
the class BufferIntegrationTest method assertProjectMatch.
private void assertProjectMatch(CloudResourceUid resourceUid, GcpProjectConfig gcpProjectConfig) throws Exception {
Project project = rmCow.projects().get(resourceUid.getGoogleProjectUid().getProjectId()).execute();
assertEquals("ACTIVE", project.getState());
}
use of com.blackducksoftware.bdio2.model.Project in project terra-resource-buffer by DataBiosphere.
the class CreateProjectFlightIntegrationTest method testCreateGoogleProject_createGkeSA_true.
@Test
public void testCreateGoogleProject_createGkeSA_true() throws Exception {
FlightManager manager = new FlightManager(bufferDao, flightSubmissionFactoryImpl, stairwayComponent, transactionTemplate);
Pool pool = preparePool(bufferDao, newBasicGcpConfig().kubernetesEngine(new KubernetesEngine().createGkeDefaultServiceAccount(true)));
String flightId = manager.submitCreationFlight(pool).get();
ResourceId resourceId = extractResourceIdFromFlightState(blockUntilFlightComplete(stairwayComponent, flightId));
Project project = assertProjectExists(resourceId);
String projectId = project.getProjectId();
String serviceAccountEmail = ServiceAccountName.emailFromAccountId(GKE_SA_NAME, projectId);
assertServiceAccountExists(project, serviceAccountEmail);
List<IamBinding> expectedGkeSABindings = new ArrayList<>();
GKE_SA_ROLES.forEach(r -> expectedGkeSABindings.add(new IamBinding().role(r).addMembersItem("serviceAccount:" + serviceAccountEmail)));
assertIamBindingsContains(project, expectedGkeSABindings);
}
use of com.blackducksoftware.bdio2.model.Project in project terra-resource-buffer by DataBiosphere.
the class CreateProjectFlightIntegrationTest method testCreateGoogleProject_blockInternetAccessWithGcrDnsEnabled.
@Test
public void testCreateGoogleProject_blockInternetAccessWithGcrDnsEnabled() throws Exception {
FlightManager manager = new FlightManager(bufferDao, flightSubmissionFactoryImpl, stairwayComponent, transactionTemplate);
Pool pool = preparePool(bufferDao, newBasicGcpConfig().network(new bio.terra.buffer.generated.model.Network().enableNetworkMonitoring(true).enablePrivateGoogleAccess(true).enableCloudRegistryPrivateGoogleAccess(true).blockBatchInternetAccess(true)));
String flightId = manager.submitCreationFlight(pool).get();
ResourceId resourceId = extractResourceIdFromFlightState(blockUntilFlightComplete(stairwayComponent, flightId));
Project project = assertProjectExists(resourceId);
assertNetworkExists(project);
assertSubnetsExist(project, NetworkMonitoring.ENABLED);
assertRouteExists(project);
assertDnsExists(project);
assertGcrDnsExists(project);
assertDefaultVpcNotExists(project);
assertFirewallRulesExistForBlockInternetAccess(project);
}
use of com.blackducksoftware.bdio2.model.Project in project terra-resource-buffer by DataBiosphere.
the class CreateProjectFlightIntegrationTest method testCreateGoogleProject_witIamBindings.
@Test
public void testCreateGoogleProject_witIamBindings() throws Exception {
// Basic GCP project with IAM Bindings
FlightManager manager = new FlightManager(bufferDao, flightSubmissionFactoryImpl, stairwayComponent, transactionTemplate);
Pool pool = preparePool(bufferDao, newBasicGcpConfig().iamBindings(IAM_BINDINGS).kubernetesEngine(new KubernetesEngine().createGkeDefaultServiceAccount(true)));
String flightId = manager.submitCreationFlight(pool).get();
ResourceId resourceId = extractResourceIdFromFlightState(blockUntilFlightComplete(stairwayComponent, flightId));
Project project = assertProjectExists(resourceId);
assertIamBindingsContains(project, IAM_BINDINGS);
}
use of com.blackducksoftware.bdio2.model.Project in project terra-resource-buffer by DataBiosphere.
the class CreateProjectFlightIntegrationTest method testCreateGoogleProject_createLogBucket_false.
@Test
public void testCreateGoogleProject_createLogBucket_false() throws Exception {
FlightManager manager = new FlightManager(bufferDao, flightSubmissionFactoryImpl, stairwayComponent, transactionTemplate);
Pool pool = preparePool(bufferDao, newBasicGcpConfig().storage(new Storage().createLogBucket(false)));
String flightId = manager.submitCreationFlight(pool).get();
ResourceId resourceId = extractResourceIdFromFlightState(blockUntilFlightComplete(stairwayComponent, flightId));
Project project = assertProjectExists(resourceId);
String projectId = project.getProjectId();
String logBucketName = "storage-logs-" + projectId;
assertNull(storageCow.get(logBucketName));
}
Aggregations