lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject [13/19] lucene-solr:jira/solr-9835: SOLR-10244: TestCoreDiscovery fails if you run it as root.
Date Thu, 09 Mar 2017 09:23:15 GMT
SOLR-10244: TestCoreDiscovery fails if you run it as root.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/6a6e3032
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/6a6e3032
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/6a6e3032

Branch: refs/heads/jira/solr-9835
Commit: 6a6e30329843a86de1063a2c8f324eb3f9dbfd91
Parents: 8a54929
Author: Mark Miller <markrmiller@gmail.com>
Authored: Wed Mar 8 10:23:21 2017 -0500
Committer: Mark Miller <markrmiller@gmail.com>
Committed: Wed Mar 8 10:23:46 2017 -0500

----------------------------------------------------------------------
 solr/core/src/test/org/apache/solr/core/TestCoreDiscovery.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6a6e3032/solr/core/src/test/org/apache/solr/core/TestCoreDiscovery.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/core/TestCoreDiscovery.java b/solr/core/src/test/org/apache/solr/core/TestCoreDiscovery.java
index fa07de8..65d459a 100644
--- a/solr/core/src/test/org/apache/solr/core/TestCoreDiscovery.java
+++ b/solr/core/src/test/org/apache/solr/core/TestCoreDiscovery.java
@@ -337,6 +337,7 @@ public class TestCoreDiscovery extends SolrTestCaseJ4 {
 
     File toSet = new File(coreDir, "core1");
     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();
     try (SolrCore core1 = cc.getCore("core1");
          SolrCore core2 = cc.getCore("core2")) {
@@ -362,6 +363,7 @@ public class TestCoreDiscovery extends SolrTestCaseJ4 {
     File toSet = new File(solrHomeDirectory, "cantReadDir");
     assertTrue("Should have been able to make directory '" + toSet.getAbsolutePath() + "'
", toSet.mkdirs());
     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();
     try (SolrCore core1 = cc.getCore("core1");
          SolrCore core2 = cc.getCore("core2")) {
@@ -421,7 +423,7 @@ public class TestCoreDiscovery extends SolrTestCaseJ4 {
         new File(homeDir, "core1" + File.separator + CorePropertiesLocator.PROPERTIES_FILENAME));
 
     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;
     try {
       cc = init();


Mime
View raw message