From 78727773fd00aba05f7aae2a5d478f1c6e38270a Mon Sep 17 00:00:00 2001 From: AWSHurneyt Date: Mon, 1 Jul 2024 14:12:05 -0700 Subject: [PATCH] Ignore tests that can't run in github CI. (#1118) Signed-off-by: AWSHurneyt --- .../resthandler/SATIFSourceConfigRestApiIT.java | 5 +++++ .../resthandler/TestS3ConnectionRestIT.java | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/src/test/java/org/opensearch/securityanalytics/resthandler/SATIFSourceConfigRestApiIT.java b/src/test/java/org/opensearch/securityanalytics/resthandler/SATIFSourceConfigRestApiIT.java index 8508e9c5c..633bd16d5 100644 --- a/src/test/java/org/opensearch/securityanalytics/resthandler/SATIFSourceConfigRestApiIT.java +++ b/src/test/java/org/opensearch/securityanalytics/resthandler/SATIFSourceConfigRestApiIT.java @@ -11,6 +11,7 @@ import org.junit.After; import org.junit.Assert; import org.junit.Before; +import org.junit.Ignore; import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.opensearch.client.Response; import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule; @@ -100,6 +101,7 @@ public void afterTest() { s3Client.close(); } + @Ignore public void testCreateSATIFSourceConfigAndVerifyJobRan() throws IOException, InterruptedException { // Generate test IOCs, and upload them to S3 to create the bucket object. Feed creation fails if the bucket object doesn't exist. int numOfIOCs = 1; @@ -193,6 +195,7 @@ protected boolean verifyJobRan(String createdId, String firstUpdatedTime) throws return false; } + @Ignore public void testGetSATIFSourceConfigById() throws IOException { // Generate test IOCs, and upload them to S3 to create the bucket object. Feed creation fails if the bucket object doesn't exist. int numOfIOCs = 1; @@ -258,6 +261,7 @@ public void testGetSATIFSourceConfigById() throws IOException { Assert.assertTrue("Created ioc types and returned ioc types do not match", iocTypes.containsAll(returnedIocTypes) && returnedIocTypes.containsAll(iocTypes)); } + @Ignore public void testDeleteSATIFSourceConfig() throws IOException { // Generate test IOCs, and upload them to S3 to create the bucket object. Feed creation fails if the bucket object doesn't exist. int numOfIOCs = 1; @@ -326,6 +330,7 @@ public void testDeleteSATIFSourceConfig() throws IOException { Assert.assertEquals(0, hits.size()); } + @Ignore public void testRetrieveIOCsSuccessfully() throws IOException, InterruptedException { // Generate test IOCs, and upload them to S3 int numOfIOCs = 5; diff --git a/src/test/java/org/opensearch/securityanalytics/resthandler/TestS3ConnectionRestIT.java b/src/test/java/org/opensearch/securityanalytics/resthandler/TestS3ConnectionRestIT.java index 7f25ea45b..9b58e0de2 100644 --- a/src/test/java/org/opensearch/securityanalytics/resthandler/TestS3ConnectionRestIT.java +++ b/src/test/java/org/opensearch/securityanalytics/resthandler/TestS3ConnectionRestIT.java @@ -7,6 +7,7 @@ import org.junit.After; import org.junit.Before; +import org.junit.Ignore; import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.opensearch.client.Response; import org.opensearch.core.rest.RestStatus; @@ -90,6 +91,7 @@ public void afterTest() { s3Client.close(); } + @Ignore public void testConnection_succeeds() throws IOException { // Create the test request request = new TestS3ConnectionRequest(bucketName, objectKey, region, roleArn); @@ -107,6 +109,7 @@ public void testConnection_succeeds() throws IOException { assertTrue(error.isEmpty()); } + @Ignore public void testConnection_wrongBucket() throws IOException { // Create the test request request = new TestS3ConnectionRequest("fakebucket", objectKey, region, roleArn); @@ -124,6 +127,7 @@ public void testConnection_wrongBucket() throws IOException { assertEquals("Resource not found.", error); } + @Ignore public void testConnection_wrongKey() throws IOException { // Create the test request request = new TestS3ConnectionRequest(bucketName, "fakekey", region, roleArn); @@ -141,6 +145,7 @@ public void testConnection_wrongKey() throws IOException { assertEquals("The specified key does not exist.", error); } + @Ignore public void testConnection_wrongRegion() throws IOException { // Create the test request String wrongRegion = (Objects.equals(region, "us-west-2")) ? "us-east-1" : "us-west-2"; @@ -159,6 +164,7 @@ public void testConnection_wrongRegion() throws IOException { assertEquals("Resource not found.", error); } + @Ignore public void testConnection_invalidRegion() throws IOException { // Create the test request request = new TestS3ConnectionRequest(bucketName, objectKey, "fa-ke-1", roleArn); @@ -176,6 +182,7 @@ public void testConnection_invalidRegion() throws IOException { assertEquals("Resource not found.", error); } + @Ignore public void testConnection_wrongRoleArn() throws IOException { // Create the test request request = new TestS3ConnectionRequest(bucketName, objectKey, region, "arn:aws:iam::123456789012:role/iam-fake-role"); @@ -193,6 +200,7 @@ public void testConnection_wrongRoleArn() throws IOException { assertTrue(error.contains("is not authorized to perform: sts:AssumeRole on resource")); } + @Ignore public void testConnection_invalidRoleArn() throws IOException { // Create the test request request = new TestS3ConnectionRequest(bucketName, objectKey, region, "arn:aws:iam::12345:role/iam-invalid-role");