Project: springxd
Issue XD-615: CommandResult return sucess even if hadoop shell command fails
when automating tests for creating http|hdfs stream, I run into an issue where CommandResult object always set success=true even if the actual hadoop shell command fail. == valid hdfs url getShell().executeCommand("hadoop config fs --namenode hdfs://localhost:8020"); CommandResult cr = getShell().executeCommand("hadoop fs ls /"); == output Found 2 items drwxr-xr-x - administrator supergroup 0 2013-08-05 17:18 /user drwxr-xr-x - administrator supergroup 0 2013-08-05 17:18 /xd CommandResult [success=true, result=null, exception=null] == invalid hdfs url getShell().executeCommand("hadoop config fs --namenode hdfs://localhost:8021"); CommandResult cr = getShell().executeCommand("hadoop fs ls /"); == output Bad connection to FS. command aborted. exception: Call to localhost/127.0.0.1:8021 failed on connection exception: java.net.ConnectException: Connection refused CommandResult [success=true, result=null, exception=null] Ideally, we should set success=false if hadoop command fail and if hadoop command succeeds, we should set success=true and populate result= output from hadoop command instead of result=null
Story points: 3