You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2020/12/17 21:50:13 UTC

[activemq-artemis] branch master updated: NO-JIRA Using Assume on DNSSwitchTest and ignoring if it cannot be executed

This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/master by this push:
     new 1c0896f  NO-JIRA Using Assume on DNSSwitchTest and ignoring if it cannot be executed
1c0896f is described below

commit 1c0896f7738b4d23bfb8ec5c73d9353f241a8955
Author: Clebert Suconic <cl...@apache.org>
AuthorDate: Thu Dec 17 16:49:45 2020 -0500

    NO-JIRA Using Assume on DNSSwitchTest and ignoring if it cannot be executed
---
 .../activemq/artemis/tests/smoke/dnsswitch/DNSSwitchTest.java      | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/dnsswitch/DNSSwitchTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/dnsswitch/DNSSwitchTest.java
index 39999ce..0667aba 100644
--- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/dnsswitch/DNSSwitchTest.java
+++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/dnsswitch/DNSSwitchTest.java
@@ -55,6 +55,7 @@ import org.apache.activemq.artemis.utils.network.NetUtilResource;
 import org.jboss.logging.Logger;
 import org.junit.AfterClass;
 import org.junit.Assert;
+import org.junit.Assume;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Rule;
@@ -138,6 +139,12 @@ public class DNSSwitchTest extends SmokeTestBase {
 
    @BeforeClass
    public static void beforeClassMethod() throws Exception {
+      if (USE_ETC_HOSTS) {
+         if (!ETC_HOSTS.canWrite()) {
+            System.out.println("If you want to run this test, you must do 'sudo chmod 666 " + ETC_HOSTS);
+         }
+         Assume.assumeTrue("If you want to run this test, you must do 'sudo chmod 666 " + ETC_HOSTS + "'", ETC_HOSTS.canWrite());
+      }
       serverLocation = getServerLocation(SERVER_NAME_0);
       // Before anything we must copy the jave security and change what we need for no cache
       // this will be used to spawn new tests