-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement and adapt RosSystem tests for the new attribute ComponentSt…
…acks
- Loading branch information
Showing
15 changed files
with
328 additions
and
29 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
plugins/de.fraunhofer.ipa.rossystem.xtext.tests/resources/test_stacks.rossystem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
RosSystem { Name 'test_stacks' | ||
RosComponentStacks ( | ||
ComponentStack { | ||
name stack1 | ||
RosComponents ( | ||
ComponentInterface { name test_node | ||
FromRosNode "test_pkg.test_node.test_node" | ||
RosPublishers{ RosPublisher "scan" { RefPublisher "test_pkg.test_node.test_node.scan"} } | ||
RosSubscribers{ RosSubscriber "power_state" { RefSubscriber "test_pkg.test_node.test_node.power_state"} } | ||
RosSrvServers{ RosServiceServer "setBool" { RefServer "test_pkg.test_node.test_node.setBool"} } | ||
RosSrvClients{ RosServiceClient "init" { RefClient "test_pkg.test_node.test_node.init"} } | ||
RosParameters{ RosParameter "string_test" { RefParameter "test_pkg.test_node.test_node.string_test"}, | ||
RosParameter "bool_tets" { RefParameter "test_pkg.test_node.test_node.bool_tets"}, | ||
RosParameter "array_tets" { RefParameter "test_pkg.test_node.test_node.array_tets"}, | ||
RosParameter "base64_test" { RefParameter "test_pkg.test_node.test_node.base64_test"}, | ||
RosParameter "double_test" { RefParameter "test_pkg.test_node.test_node.double_test"}, | ||
RosParameter "int_test" { RefParameter "test_pkg.test_node.test_node.int_test"}, | ||
RosParameter "list_test" { RefParameter "test_pkg.test_node.test_node.list_test"}}}, | ||
ComponentInterface { name test_node2 NameSpace test2 | ||
FromRosNode "test_pkg.test_node.test_node" | ||
RosPublishers { RosPublisher "scan" { RefPublisher "test_pkg.test_node.test_node.scan" } } | ||
RosSubscribers { RosSubscriber "power_state" { RefSubscriber "test_pkg.test_node.test_node.power_state" } } | ||
RosSrvServers { RosServiceServer "setBool" { RefServer "test_pkg.test_node.test_node.setBool" } } | ||
RosSrvClients { RosServiceClient "init" { RefClient "test_pkg.test_node.test_node.init" } } | ||
RosParameters { RosParameter "string_test" { RefParameter "test_pkg.test_node.test_node.string_test" } , | ||
RosParameter "bool_tets" { RefParameter "test_pkg.test_node.test_node.bool_tets" } , | ||
RosParameter "array_tets" { RefParameter "test_pkg.test_node.test_node.array_tets" } , | ||
RosParameter "base64_test" { RefParameter "test_pkg.test_node.test_node.base64_test" } , | ||
RosParameter "double_test" { RefParameter "test_pkg.test_node.test_node.double_test" } , | ||
RosParameter "int_test" { RefParameter "test_pkg.test_node.test_node.int_test" } , | ||
RosParameter "list_test" { RefParameter "test_pkg.test_node.test_node.list_test" }}})}, | ||
ComponentStack { | ||
name stack2 | ||
RosComponents ( | ||
ComponentInterface { name test_nodea | ||
RosPublishers { RosPublisher power_state { RefPublisher "test_pkg.test_node.test_node.power_state" } } | ||
RosSubscribers { RosSubscriber scan { RefSubscriber "test_pkg.test_node.test_node.scan" } } | ||
RosSrvServers { RosServiceServer init { RefServer "test_pkg.test_node.test_node.init" } } | ||
RosSrvClients { RosServiceClient SetBool { RefClient "test_pkg.test_node.test_node.SetBool" }}} | ||
) | ||
} | ||
) | ||
} |
35 changes: 35 additions & 0 deletions
35
plugins/de.fraunhofer.ipa.rossystem.xtext.tests/resources/test_stacks/docker-compose.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
version: "3.3" | ||
networks: | ||
ros: | ||
driver: bridge | ||
|
||
services: | ||
ros-master: | ||
image: ros:melodic-ros-core | ||
command: stdbuf -o L roscore | ||
networks: | ||
- ros | ||
|
||
test_stacks_stack1: | ||
image: "test_stacks_stack1:latest" | ||
depends_on: | ||
- ros-master | ||
environment: | ||
- "ROS_MASTER_URI=http://ros-master:11311" | ||
- "ROS_HOSTNAME=stack1" | ||
networks: | ||
- ros | ||
command: stdbuf -o L roslaunch test_stacks_stack1 stack1.launch --wait | ||
|
||
test_stacks_stack2: | ||
image: "test_stacks_stack2:latest" | ||
depends_on: | ||
- ros-master | ||
environment: | ||
- "ROS_MASTER_URI=http://ros-master:11311" | ||
- "ROS_HOSTNAME=stack2" | ||
networks: | ||
- ros | ||
command: stdbuf -o L roslaunch test_stacks_stack2 stack2.launch --wait | ||
|
||
|
12 changes: 12 additions & 0 deletions
12
...unhofer.ipa.rossystem.xtext.tests/resources/test_stacks/test_stacks_stack1/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
cmake_minimum_required(VERSION 2.8.3) | ||
project(test_stacks_stack1) | ||
|
||
find_package(catkin REQUIRED) | ||
|
||
catkin_package() | ||
|
||
|
||
### INSTALL ### | ||
install(DIRECTORY launch | ||
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} | ||
) |
40 changes: 40 additions & 0 deletions
40
....fraunhofer.ipa.rossystem.xtext.tests/resources/test_stacks/test_stacks_stack1/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# syntax=docker/dockerfile:experimental | ||
ARG SUFFIX= | ||
ARG PREFIX= | ||
FROM ros:melodic-ros-core as base | ||
FROM ${PREFIX}builder${SUFFIX} as builder | ||
|
||
FROM base as build | ||
COPY . /root/ws/src/test_stacks_stack1/ | ||
RUN --mount=type=bind,from=builder,target=/builder \ | ||
apt-get update -qq && \ | ||
/builder/workspace.bash build_workspace /root/ws && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
FROM build as test | ||
RUN --mount=type=bind,from=builder,target=/builder \ | ||
apt-get update -qq && \ | ||
/builder/workspace.bash test_workspace /root/ws && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
FROM build as install | ||
RUN --mount=type=bind,from=builder,target=/builder \ | ||
apt-get update -qq && \ | ||
/builder/workspace.bash install_workspace /root/ws && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
FROM install as full | ||
RUN --mount=type=bind,from=builder,target=/builder \ | ||
apt-get update -qq && \ | ||
/builder/workspace.bash install_depends /root/ws && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
FROM base as deploy | ||
RUN --mount=type=bind,from=builder,target=/builder --mount=type=bind,target=/root/ws,from=install,source=/root/ws \ | ||
apt-get update -qq && \ | ||
/builder/workspace.bash install_depends /root/ws && \ | ||
rm -rf /var/lib/apt/lists/* | ||
COPY --from=install /opt/ros/$ROS_DISTRO /opt/ros/$ROS_DISTRO | ||
|
||
FROM deploy as launch | ||
CMD ["roslaunch", "test_stacks_stack1", "stack1.launch"] |
9 changes: 9 additions & 0 deletions
9
...r.ipa.rossystem.xtext.tests/resources/test_stacks/test_stacks_stack1/launch/stack1.launch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0"?> | ||
<launch> | ||
|
||
<node pkg="test_pkg" type="test_node" name="test_node" cwd="node" respawn="false" output="screen"> | ||
</node> | ||
<node pkg="test_pkg" type="test_node" name="test_node2" ns="test2" cwd="node" respawn="false" output="screen"> | ||
</node> | ||
|
||
</launch> |
18 changes: 18 additions & 0 deletions
18
...fraunhofer.ipa.rossystem.xtext.tests/resources/test_stacks/test_stacks_stack1/package.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<package format="2"> | ||
<name>test_stacks_stack1</name> | ||
<version>0.0.1</version> | ||
<description>This package provides launch file for operating test_stacks_stack1</description> | ||
|
||
<license>Apache 2.0</license> | ||
|
||
<url type="website">http://wiki.ros.org/</url> | ||
|
||
|
||
<maintainer email="[email protected]">Jane Doe</maintainer> | ||
<author email="[email protected]">Jane Doe</author> | ||
|
||
<buildtool_depend>catkin</buildtool_depend> | ||
<exec_depend>test_pkg</exec_depend> | ||
<!--test_depend>roslaunch</test_depend--> | ||
|
||
</package> |
12 changes: 12 additions & 0 deletions
12
...unhofer.ipa.rossystem.xtext.tests/resources/test_stacks/test_stacks_stack2/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
cmake_minimum_required(VERSION 2.8.3) | ||
project(test_stacks_stack2) | ||
|
||
find_package(catkin REQUIRED) | ||
|
||
catkin_package() | ||
|
||
|
||
### INSTALL ### | ||
install(DIRECTORY launch | ||
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} | ||
) |
40 changes: 40 additions & 0 deletions
40
....fraunhofer.ipa.rossystem.xtext.tests/resources/test_stacks/test_stacks_stack2/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# syntax=docker/dockerfile:experimental | ||
ARG SUFFIX= | ||
ARG PREFIX= | ||
FROM ros:melodic-ros-core as base | ||
FROM ${PREFIX}builder${SUFFIX} as builder | ||
|
||
FROM base as build | ||
COPY . /root/ws/src/test_stacks_stack2/ | ||
RUN --mount=type=bind,from=builder,target=/builder \ | ||
apt-get update -qq && \ | ||
/builder/workspace.bash build_workspace /root/ws && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
FROM build as test | ||
RUN --mount=type=bind,from=builder,target=/builder \ | ||
apt-get update -qq && \ | ||
/builder/workspace.bash test_workspace /root/ws && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
FROM build as install | ||
RUN --mount=type=bind,from=builder,target=/builder \ | ||
apt-get update -qq && \ | ||
/builder/workspace.bash install_workspace /root/ws && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
FROM install as full | ||
RUN --mount=type=bind,from=builder,target=/builder \ | ||
apt-get update -qq && \ | ||
/builder/workspace.bash install_depends /root/ws && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
FROM base as deploy | ||
RUN --mount=type=bind,from=builder,target=/builder --mount=type=bind,target=/root/ws,from=install,source=/root/ws \ | ||
apt-get update -qq && \ | ||
/builder/workspace.bash install_depends /root/ws && \ | ||
rm -rf /var/lib/apt/lists/* | ||
COPY --from=install /opt/ros/$ROS_DISTRO /opt/ros/$ROS_DISTRO | ||
|
||
FROM deploy as launch | ||
CMD ["roslaunch", "test_stacks_stack2", "stack2.launch"] |
7 changes: 7 additions & 0 deletions
7
...r.ipa.rossystem.xtext.tests/resources/test_stacks/test_stacks_stack2/launch/stack2.launch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0"?> | ||
<launch> | ||
|
||
<node pkg="test_pkg" type="test_node" name="test_nodea" cwd="node" respawn="false" output="screen"> | ||
</node> | ||
|
||
</launch> |
18 changes: 18 additions & 0 deletions
18
...fraunhofer.ipa.rossystem.xtext.tests/resources/test_stacks/test_stacks_stack2/package.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<package format="2"> | ||
<name>test_stacks_stack2</name> | ||
<version>0.0.1</version> | ||
<description>This package provides launch file for operating test_stacks_stack2</description> | ||
|
||
<license>Apache 2.0</license> | ||
|
||
<url type="website">http://wiki.ros.org/</url> | ||
|
||
|
||
<maintainer email="[email protected]">Jane Doe</maintainer> | ||
<author email="[email protected]">Jane Doe</author> | ||
|
||
<buildtool_depend>catkin</buildtool_depend> | ||
<exec_depend>test_pkg</exec_depend> | ||
<!--test_depend>roslaunch</test_depend--> | ||
|
||
</package> |
12 changes: 6 additions & 6 deletions
12
...s/de.fraunhofer.ipa.rossystem.xtext.tests/resources/test_system/launch/test_system.launch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ | |
<maintainer email="[email protected]">Jane Doe</maintainer> | ||
<author email="[email protected]">Jane Doe</author> | ||
|
||
|
||
<buildtool_depend>catkin</buildtool_depend> | ||
<exec_depend>test_pkg</exec_depend> | ||
<!--test_depend>roslaunch</test_depend--> | ||
|
Oops, something went wrong.