[ 
https://issues.apache.org/jira/browse/OOZIE-49?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13101808#comment-13101808
 ] 

Hadoop QA commented on OOZIE-49:
--------------------------------

aprabhakar remarked:
Instead, can we do this: allow the passing of the user name only if a specific 
property is set (say test.user.name). That way, the Yahoo! tests can continue 
as they are and individual developers can override the test name where needed. 
Here is a patch that implements it:

    diff --git core/src/test/java/org/apache/oozie/test/XTestCase.java 
core/src/test/java/org/apache/oozie/test/XTestCase.java
    index 014e581..b3299ef 100644
    --- core/src/test/java/org/apache/oozie/test/XTestCase.java
    +++ core/src/test/java/org/apache/oozie/test/XTestCase.java
    @@ -93,6 +93,12 @@ public abstract class XTestCase extends TestCase {
          */
         public static final String HADOOP_VERSION = "hadoop.version";
     
    +    /** 
    +     * System property to specify the main test user name.
    +     * If this property is not set, the default test user name is used 
which * is <tt>test</tt>.
    +     */
    +    public static final String TEST_USER_NAME_PROP = "test.user.name";
    +
         /**
          * Initialize the test working directory. <p/> If it does not exist it 
creates it, if it already exists it deletes
          * all its contents. <p/> The test working directory it is not deleted 
after the test runs. <p/>
    @@ -153,6 +159,10 @@ public abstract class XTestCase extends TestCase {
         }
     
         protected String getTestUser() {
    +        String testUserName = System.getProperty(TEST_USER_NAME_PROP);
    +        if (testUserName != null && 
!testUserName.equals("${"+TEST_USER_NAME_PROP+"}")) {
    +          return testUserName;
    +        }
             return "test";
         }
     
    diff --git pom.xml pom.xml
    index 75d70c8..a1c68e5 100644
    --- pom.xml
    +++ pom.xml
    @@ -219,6 +219,10 @@
                         <argLine>-Xmx512m</argLine>
                         <systemProperties>
                             <property>
    +                            <name>test.user.name</name>
    +                            <value>${test.user.name}</value>
    +                        </property>
    +                        <property>
                                 <name>oozie.test.dir</name>
                                 <value>${oozie.test.dir}</value>
                             </property>

> GH-3: The XTestCase.getTestUser() method returns the hardcoded username test. 
> This results in failure due to SSH authentication failure in case this user 
> is not setup correctly.
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OOZIE-49
>                 URL: https://issues.apache.org/jira/browse/OOZIE-49
>             Project: Oozie
>          Issue Type: Bug
>            Reporter: Hadoop QA
>
> One workaround would be to run the tests as test user and have the 
> environment setup correctly for that. The other solution would be to by 
> default use the current user for test purposes, and overwrite that to another 
> user where necessary.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to