Skip to content

Commit

Permalink
[jsk_tools/test/env-hooks] Fixed test case
Browse files Browse the repository at this point in the history
  • Loading branch information
iory committed Jul 24, 2018
1 parent f90ca3e commit dfcb818
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 20 deletions.
4 changes: 2 additions & 2 deletions jsk_tools/test/sh/rossetip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ ECHO_OUTPUT="$1"
ip() {
echo "$ECHO_OUTPUT"
}
CATKIN_SHELL="bash"
rossetip
rossetip > /dev/null 2>&1
echo $ROS_IP
7 changes: 7 additions & 0 deletions jsk_tools/test/sh/rossetmaster.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

_THIS_DIR=$(builtin cd "`dirname "${BASH_SOURCE[0]}"`" > /dev/null && pwd)
source $_THIS_DIR/../../env-hooks/99.jsk_tools.bash

rossetmaster "$1" "${2-11311}" > /dev/null 2>&1
echo $ROS_MASTER_URI
31 changes: 13 additions & 18 deletions jsk_tools/test/test_env_hooks.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,41 @@
name="test_rossetip0"
pkg="jsk_tools" type="test_stdout.py">
<!-- testing https://github.com/jsk-ros-pkg/jsk_common/issues/1472 -->
<param name="~command" value="/bin/sh $(find jsk_tools)/env-hooks/99.jsk_tools.sh &amp;&amp;
ip() {echo 'local 192.168.96.20 dev lo src 192.168.96.20 \ cache'} &amp;&amp; rossetip" />
<param name="stdout" value="set ROS_IP and ROS_HOSTNAME to 192.168.96.20" />
<param name="~command" value="/bin/bash $(find jsk_tools)/test/sh/rossetip.sh
&quot;local 192.168.96.20 dev lo src 192.168.96.20 \ cache&quot;" />
<param name="stdout" value="192.168.96.20" />
</test>

<test test-name="test_rossetip1"
name="test_rossetip1"
pkg="jsk_tools" type="test_stdout.py">
<!-- testing https://github.com/jsk-ros-pkg/jsk_common/issues/1472 -->
<param name="~command" value="ip() {echo '192.168.96.21 dev eth0 src 192.168.96.20 \ cache'} &amp;&amp; rossetip" />
<param name="stdout" value="set ROS_IP and ROS_HOSTNAME to 192.168.96.20" />
<param name="~command" value="/bin/bash $(find jsk_tools)/test/sh/rossetip.sh
&quot;192.168.96.20 dev lo src 192.168.96.20 \ cache&quot;" />
<param name="stdout" value="192.168.96.20" />
</test>

<test test-name="test_rossetip2"
name="test_rossetip2"
pkg="jsk_tools" type="test_stdout.py">
<!-- testing https://github.com/jsk-ros-pkg/jsk_common/issues/1472 -->
<param name="~command" value="ip() {echo '8.8.8.8 via 133.11.216.254 dev wlp3s0 src 192.168.96.20 \ cache'} &amp;&amp; rossetip" />
<param name="stdout" value="set ROS_IP and ROS_HOSTNAME to 192.168.96.20" />
<param name="~command" value="/bin/bash $(find jsk_tools)/test/sh/rossetip.sh
&quot;8.8.8.8 via 133.11.216.254 dev wlp3s0 src 192.168.96.20 \ cache&quot;" />
<param name="stdout" value="192.168.96.20" />
</test>

<test test-name="test_rossetmaster0"
name="test_rossetmaster0"
pkg="jsk_tools" type="test_stdout.py">
<param name="~command" value="rossetmaster localhost" />
<param name="stdout" value="set ROS_IP and ROS_HOSTNAME to localhost" />
<param name="~command" value="/bin/bash $(find jsk_tools)/test/sh/rossetmaster.sh localhost" />
<param name="stdout" value="http://localhost:11311" />
</test>

<test test-name="test_rossetmaster1"
name="test_rossetmaster1"
pkg="jsk_tools" type="test_stdout.py">
<param name="~command" value="rossetlocal" />
<param name="stdout" value="set ROS_IP and ROS_HOSTNAME to localhost" />
</test>

<test test-name="test_rossetmaster2"
name="test_rossetmaster2"
pkg="jsk_tools" type="test_stdout.py">
<param name="~command" value="rossetmaster hrp2017v" />
<param name="stdout" value="set ROS_IP and ROS_HOSTNAME to hrp2017v" />
<param name="~command" value="/bin/bash $(find jsk_tools)/test/sh/rossetmaster.sh hrp2017v 10017" />
<param name="stdout" value="http://hrp2017v:10017" />
</test>

</launch>

0 comments on commit dfcb818

Please sign in to comment.