Skip to content

Commit dfb5861

Browse files
andrrossasimmahmood1
authored andcommitted
Miscellaneous cleanup of :qa projects (opensearch-project#19347)
The evil tests had a dependency on jimfs but did not use it anywhere, so I removed the dependency. The TranslogPolicyIT file had no corresponding build.gradle file and therefore was just dead code. The test is no longer relevant as it is related to pre-OpenSearch compatibility. Signed-off-by: Andrew Ross <andrross@amazon.com>
1 parent 8f2417c commit dfb5861

File tree

4 files changed

+8
-189
lines changed

4 files changed

+8
-189
lines changed

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,8 @@ gradle.projectsEvaluated {
410410
if (task != null) {
411411
task.jvmArgs += [
412412
"--add-modules=jdk.incubator.vector",
413-
"--add-exports=java.base/com.sun.crypto.provider=ALL-UNNAMED"
413+
"--add-exports=java.base/com.sun.crypto.provider=ALL-UNNAMED",
414+
"--enable-native-access=ALL-UNNAMED"
414415
]
415416

416417
// Add Java Agent for security sandboxing

qa/evil-tests/build.gradle

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -40,36 +40,12 @@ apply plugin: 'opensearch.testclusters'
4040
apply plugin: 'opensearch.standalone-test'
4141

4242
dependencies {
43-
testImplementation 'com.google.jimfs:jimfs:1.3.1'
4443
testImplementation(project(':distribution:tools:plugin-cli')) {
4544
exclude group: 'org.bouncycastle'
4645
}
4746
testCompileOnly "com.github.spotbugs:spotbugs-annotations:4.9.4"
4847
}
4948

50-
// TODO: give each evil test its own fresh JVM for more isolation.
51-
5249
test {
5350
systemProperty 'tests.security.manager', 'false'
5451
}
55-
56-
thirdPartyAudit {
57-
ignoreMissingClasses(
58-
'com.ibm.icu.lang.UCharacter'
59-
)
60-
61-
ignoreViolations(
62-
// uses internal java api: sun.misc.Unsafe
63-
'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray',
64-
'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$1',
65-
'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$2',
66-
'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator',
67-
'com.google.common.util.concurrent.AbstractFutureState$UnsafeAtomicHelper'
68-
)
69-
}
70-
71-
tasks.test {
72-
if (BuildParams.runtimeJavaVersion > JavaVersion.VERSION_1_8) {
73-
jvmArgs += ["--add-opens", "java.base/java.lang=ALL-UNNAMED"]
74-
}
75-
}

qa/evil-tests/src/test/java/org/opensearch/bootstrap/EvilBootstrapChecksTests.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
public class EvilBootstrapChecksTests extends AbstractBootstrapCheckTestCase {
5656

57-
private String esEnforceBootstrapChecks = System.getProperty(OPENSEARCH_ENFORCE_BOOTSTRAP_CHECKS);
57+
private final String enforceBootstrapChecks = System.getProperty(OPENSEARCH_ENFORCE_BOOTSTRAP_CHECKS);
5858

5959
@Override
6060
@Before
@@ -65,12 +65,12 @@ public void setUp() throws Exception {
6565
@Override
6666
@After
6767
public void tearDown() throws Exception {
68-
setEsEnforceBootstrapChecks(esEnforceBootstrapChecks);
68+
setEnforceBootstrapChecks(enforceBootstrapChecks);
6969
super.tearDown();
7070
}
7171

7272
public void testEnforceBootstrapChecks() throws NodeValidationException {
73-
setEsEnforceBootstrapChecks("true");
73+
setEnforceBootstrapChecks("true");
7474
final List<BootstrapCheck> checks = Collections.singletonList(context -> BootstrapCheck.BootstrapCheckResult.failure("error"));
7575

7676
final Logger logger = mock(Logger.class);
@@ -86,7 +86,7 @@ public void testEnforceBootstrapChecks() throws NodeValidationException {
8686
}
8787

8888
public void testNonEnforcedBootstrapChecks() throws NodeValidationException {
89-
setEsEnforceBootstrapChecks(null);
89+
setEnforceBootstrapChecks(null);
9090
final Logger logger = mock(Logger.class);
9191
// nothing should happen
9292
BootstrapChecks.check(emptyContext, false, emptyList(), logger);
@@ -95,7 +95,7 @@ public void testNonEnforcedBootstrapChecks() throws NodeValidationException {
9595

9696
public void testInvalidValue() {
9797
final String value = randomAlphaOfLength(8);
98-
setEsEnforceBootstrapChecks(value);
98+
setEnforceBootstrapChecks(value);
9999
final boolean enforceLimits = randomBoolean();
100100
final IllegalArgumentException e = expectThrows(
101101
IllegalArgumentException.class,
@@ -106,7 +106,7 @@ public void testInvalidValue() {
106106
}
107107

108108
@SuppressForbidden(reason = "set or clear system property opensearch.enforce.bootstrap.checks")
109-
public void setEsEnforceBootstrapChecks(final String value) {
109+
public void setEnforceBootstrapChecks(final String value) {
110110
if (value == null) {
111111
System.clearProperty(OPENSEARCH_ENFORCE_BOOTSTRAP_CHECKS);
112112
} else {

qa/translog-policy/src/test/java/org/opensearch/upgrades/TranslogPolicyIT.java

Lines changed: 0 additions & 158 deletions
This file was deleted.

0 commit comments

Comments
 (0)