Attaching patch which adds unit test for
Following is approach used in running unit tests.
HADOOP-4490 unit tests require following extra parameter to be passed alongwith the ant test target.
- taskcontroller-path - path to built task controller executable
- taskcontroller-user - ugi of the user as who we should be executing the task.
If any of the above two parameter is not passed the
HADOOP-4490 test cases would not be executed and test case would be successful.
An example for running a
HADOOP-4490 test case is as follows
ant test -Dtestcase=TestJobExecutionAsDifferentUser -Dtaskcontroller-path=/tmp/hadoop/bin -Dtaskcontroller-user=mapred,users
For pipes related test cases you would have to pass compile.c++ flag.
Following are the test cases added to the patch:
- TestJobExecutionAsDifferentUser :- Core test case which launches a SleepJob and WordCount job as a different user.
- TestKillSubProcessesWithTaskController :- Test case which checks if the process trees of launched tasks are cleaned up properly. Currently, fails with trunk when
HADOOP-5420 is commited would work fine.
- TestPipesAsDifferentUser :- Runs a pipes job as a different user.
- TestStreamingAsDifferentUser :- Runs a streaming job as different user.