mirror of
https://github.com/apache/lucene.git
synced 2025-02-10 03:55:46 +00:00
SOLR-10244: TestCoreDiscovery fails if you run it as root.
This commit is contained in:
parent
8a5492930e
commit
6a6e303298
@ -337,6 +337,7 @@ public class TestCoreDiscovery extends SolrTestCaseJ4 {
|
|||||||
|
|
||||||
File toSet = new File(coreDir, "core1");
|
File toSet = new File(coreDir, "core1");
|
||||||
assumeTrue("Cannot make " + toSet + " non-readable. Test aborted.", toSet.setReadable(false, false));
|
assumeTrue("Cannot make " + toSet + " non-readable. Test aborted.", toSet.setReadable(false, false));
|
||||||
|
assumeFalse("Appears we are a super user, skip test", toSet.canRead());
|
||||||
CoreContainer cc = init();
|
CoreContainer cc = init();
|
||||||
try (SolrCore core1 = cc.getCore("core1");
|
try (SolrCore core1 = cc.getCore("core1");
|
||||||
SolrCore core2 = cc.getCore("core2")) {
|
SolrCore core2 = cc.getCore("core2")) {
|
||||||
@ -362,6 +363,7 @@ public class TestCoreDiscovery extends SolrTestCaseJ4 {
|
|||||||
File toSet = new File(solrHomeDirectory, "cantReadDir");
|
File toSet = new File(solrHomeDirectory, "cantReadDir");
|
||||||
assertTrue("Should have been able to make directory '" + toSet.getAbsolutePath() + "' ", toSet.mkdirs());
|
assertTrue("Should have been able to make directory '" + toSet.getAbsolutePath() + "' ", toSet.mkdirs());
|
||||||
assumeTrue("Cannot make " + toSet + " non-readable. Test aborted.", toSet.setReadable(false, false));
|
assumeTrue("Cannot make " + toSet + " non-readable. Test aborted.", toSet.setReadable(false, false));
|
||||||
|
assumeFalse("Appears we are a super user, skip test", toSet.canRead());
|
||||||
CoreContainer cc = init();
|
CoreContainer cc = init();
|
||||||
try (SolrCore core1 = cc.getCore("core1");
|
try (SolrCore core1 = cc.getCore("core1");
|
||||||
SolrCore core2 = cc.getCore("core2")) {
|
SolrCore core2 = cc.getCore("core2")) {
|
||||||
@ -421,7 +423,7 @@ public class TestCoreDiscovery extends SolrTestCaseJ4 {
|
|||||||
new File(homeDir, "core1" + File.separator + CorePropertiesLocator.PROPERTIES_FILENAME));
|
new File(homeDir, "core1" + File.separator + CorePropertiesLocator.PROPERTIES_FILENAME));
|
||||||
|
|
||||||
assumeTrue("Cannot make " + homeDir + " non-readable. Test aborted.", homeDir.setReadable(false, false));
|
assumeTrue("Cannot make " + homeDir + " non-readable. Test aborted.", homeDir.setReadable(false, false));
|
||||||
|
assumeFalse("Appears we are a super user, skip test", homeDir.canRead());
|
||||||
CoreContainer cc = null;
|
CoreContainer cc = null;
|
||||||
try {
|
try {
|
||||||
cc = init();
|
cc = init();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user