Skip to content

Commit

Permalink
[cirque] Initial support for Cirque test (project-chip#2042)
Browse files Browse the repository at this point in the history
* [cirque] Add cirque test for Linux

- Adds a zcl server for posix mock devices.
- Adds the dockerfile for integration into cirque.

* [cirque] Initial support for Cirque test

* Restyled by shellharden

* Restyled by shfmt

* Switch to flask

* Set a timeout in chip-tool to avoid infinity wait

Co-authored-by: Jiacheng Guo <gjc@google.com>
Co-authored-by: Restyled.io <commits@restyled.io>
  • Loading branch information
3 people authored Aug 19, 2020
1 parent 52ca3a2 commit 89043b0
Show file tree
Hide file tree
Showing 37 changed files with 50,992 additions and 171 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,7 @@ TAGS

# C-Lion / IDEA files
.idea/**

# Python bytecodes
__pycache__
*.pyc
5 changes: 5 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,8 @@
branch = master
ignore = dirty
commit = ad96e6f6f5b1915844ba4481bf8d0b66af91175e
[submodule "third_party/cirque"]
path = third_party/cirque
url = https://github.com/openweave/cirque.git
branch = master
ignore = dirty
9 changes: 7 additions & 2 deletions config/standalone/standalone-chip.mk
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ CHIP_CONFIGURE_OPTIONS = \
--with-network-layer=all \
--with-target-network=sockets \
--with-inet-endpoint="tcp udp" \
--with-device-layer=linux \
--disable-tests \
--disable-tools \
--disable-docs \
Expand Down Expand Up @@ -139,7 +140,10 @@ STD_LIBS += \
-lInetLayer \
-lnlfaultinjection \
-lSupportLayer \
-lSystemLayer
-lSystemLayer \
-lDeviceLayer \
-lCHIPDataModel \
-lCHIP

STD_LIBS += $(shell pkg-config --libs openssl)

Expand All @@ -165,7 +169,8 @@ STD_LINK_PREREQUISITES += \
$(CHIP_OUTPUT_DIR)/lib/libInetLayer.a \
$(CHIP_OUTPUT_DIR)/lib/libnlfaultinjection.a \
$(CHIP_OUTPUT_DIR)/lib/libSupportLayer.a \
$(CHIP_OUTPUT_DIR)/lib/libSystemLayer.a
$(CHIP_OUTPUT_DIR)/lib/libSystemLayer.a \
$(CHIP_OUTPUT_DIR)/lib/libCHIPDataModel.a

ifeq ($(findstring linux,$(CHIP_HOST_ARCH)),linux)
STD_LINK_PREREQUISITES += $(CHIP_OUTPUT_DIR)/lib/libot_br_client.a
Expand Down
24 changes: 24 additions & 0 deletions examples/chip-tool/Dockerfile.server
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# Copyright (c) 2020 Project CHIP Authors
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

from generic_node_image

COPY build/chip-standalone-demo.out /usr/bin/
COPY build/chip-standalone-server.out /usr/bin/
COPY entrypoint.sh /

ENTRYPOINT ["/entrypoint.sh", "server"]
24 changes: 24 additions & 0 deletions examples/chip-tool/Dockerfile.tool
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# Copyright (c) 2020 Project CHIP Authors
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

from generic_node_image

COPY build/chip-standalone-demo.out /usr/bin/
COPY build/chip-standalone-server.out /usr/bin/
COPY entrypoint.sh /

ENTRYPOINT ["/entrypoint.sh", "tool"]
1 change: 1 addition & 0 deletions examples/chip-tool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Building the example application is quite straightforward.
- In the root of the example directory, run `make`.

$ make
$ make -f server.mk

- After the application is built, it can be found in the build directory as
`chip-standalone-demo.out`
Expand Down
15 changes: 15 additions & 0 deletions examples/chip-tool/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

service dbus start
sleep 1
/usr/sbin/otbr-agent -I wpan0 spinel+hdlc+uart:///dev/ttyUSB0 &
sleep 1
ot-ctl panid 0x1234
ot-ctl ifconfig up
ot-ctl thread start

if [ "$1" == "server" ]; then
chip-standalone-server.out
elif [ "$1" == "tool" ]; then
sleep infinity
fi
Loading

0 comments on commit 89043b0

Please sign in to comment.