File tree 3 files changed +11
-0
lines changed
qa/evil-tests/src/test/java/org/elasticsearch
3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 10
10
package org .elasticsearch .bootstrap ;
11
11
12
12
import org .elasticsearch .core .SuppressForbidden ;
13
+ import org .elasticsearch .jdk .RuntimeVersionFeature ;
13
14
import org .elasticsearch .test .ESTestCase ;
14
15
import org .junit .BeforeClass ;
15
16
@@ -42,6 +43,7 @@ public class ESPolicyUnitTests extends ESTestCase {
42
43
43
44
@ BeforeClass
44
45
public static void setupPolicy () {
46
+ assumeTrue ("test requires security manager to be supported" , RuntimeVersionFeature .isSecurityManagerAvailable ());
45
47
assumeTrue ("test cannot run with security manager" , System .getSecurityManager () == null );
46
48
DEFAULT_POLICY = PolicyUtil .readPolicy (ESPolicy .class .getResource (POLICY_RESOURCE ), TEST_CODEBASES );
47
49
}
Original file line number Diff line number Diff line change 10
10
package org .elasticsearch .bootstrap ;
11
11
12
12
import org .elasticsearch .core .SuppressForbidden ;
13
+ import org .elasticsearch .jdk .RuntimeVersionFeature ;
13
14
import org .elasticsearch .plugins .PluginDescriptor ;
14
15
import org .elasticsearch .test .ESTestCase ;
15
16
import org .junit .Before ;
@@ -40,6 +41,7 @@ public class PolicyUtilTests extends ESTestCase {
40
41
41
42
@ Before
42
43
public void assumeSecurityManagerDisabled () {
44
+ assumeTrue ("test requires security manager to be supported" , RuntimeVersionFeature .isSecurityManagerAvailable ());
43
45
assumeTrue ("test cannot run with security manager enabled" , System .getSecurityManager () == null );
44
46
}
45
47
Original file line number Diff line number Diff line change 11
11
12
12
import org .elasticsearch .bootstrap .PluginPolicyInfo ;
13
13
import org .elasticsearch .bootstrap .PolicyUtil ;
14
+ import org .elasticsearch .jdk .RuntimeVersionFeature ;
14
15
import org .elasticsearch .plugins .PluginDescriptor ;
15
16
import org .elasticsearch .test .ESTestCase ;
17
+ import org .junit .Before ;
16
18
17
19
import java .io .IOException ;
18
20
import java .nio .file .Files ;
26
28
/** Tests plugin manager security check */
27
29
public class PluginSecurityTests extends ESTestCase {
28
30
31
+ @ Before
32
+ public void assumeSecurityManagerSupported () {
33
+ assumeTrue ("test requires security manager to be supported" , RuntimeVersionFeature .isSecurityManagerAvailable ());
34
+ }
35
+
29
36
PluginPolicyInfo makeDummyPlugin (String policy , String ... files ) throws IOException {
30
37
Path plugin = createTempDir ();
31
38
Files .copy (this .getDataPath (policy ), plugin .resolve (PluginDescriptor .ES_PLUGIN_POLICY ));
You can’t perform that action at this time.
0 commit comments