-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zephyr port #333
Merged
Merged
Zephyr port #333
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
178c051
zephyr port
julek-wolfssl 50530d9
Code review fixes
julek-wolfssl e2201cb
Add back in comment about missing `options.h`
julek-wolfssl 8b345bd
Add timeouts to github actions
julek-wolfssl ceee98d
bwrap tests when using local mosquitto instance
julek-wolfssl dde03b3
Remove sleep calls in scripts
julek-wolfssl 6a4df26
zephyr: Use NO_MAIN_DRIVER and implement main in samples
julek-wolfssl d69c7b5
Fix script bwrap calls
julek-wolfssl 67e7603
Init zephyr github action test using twister script
julek-wolfssl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 |
---|---|---|
|
@@ -10,6 +10,7 @@ jobs: | |
build: | ||
|
||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
|
||
steps: | ||
- uses: actions/checkout@master | ||
|
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 |
---|---|---|
|
@@ -10,6 +10,7 @@ jobs: | |
build: | ||
|
||
runs-on: macos-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@master | ||
with: | ||
|
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 |
---|---|---|
|
@@ -10,6 +10,7 @@ jobs: | |
build: | ||
|
||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
|
||
steps: | ||
- uses: actions/checkout@master | ||
|
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 |
---|---|---|
|
@@ -27,6 +27,7 @@ env: | |
jobs: | ||
build: | ||
runs-on: windows-latest | ||
timeout-minutes: 10 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
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,130 @@ | ||
name: Zephyr tests | ||
|
||
on: | ||
push: | ||
branches: [ '*' ] | ||
pull_request: | ||
branches: [ '*' ] | ||
|
||
jobs: | ||
run_test: | ||
name: Build and run | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
steps: | ||
- name: Install dependencies | ||
run: | | ||
# Don't prompt for anything | ||
export DEBIAN_FRONTEND=noninteractive | ||
sudo apt-get update | ||
# most of the ci-base zephyr docker image packages | ||
sudo apt-get install -y mosquitto mosquitto-clients zip bridge-utils uml-utilities \ | ||
git cmake ninja-build gperf ccache dfu-util device-tree-compiler wget \ | ||
python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \ | ||
make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1 \ | ||
autoconf automake bison build-essential ca-certificates cargo ccache chrpath cmake \ | ||
cpio device-tree-compiler dfu-util diffstat dos2unix doxygen file flex g++ gawk gcc \ | ||
gcovr git git-core gnupg gperf gtk-sharp2 help2man iproute2 lcov libcairo2-dev \ | ||
libglib2.0-dev libgtk2.0-0 liblocale-gettext-perl libncurses5-dev libpcap-dev \ | ||
libpopt0 libsdl1.2-dev libsdl2-dev libssl-dev libtool libtool-bin locales make \ | ||
net-tools ninja-build openssh-client parallel pkg-config python3-dev python3-pip \ | ||
python3-ply python3-setuptools python-is-python3 qemu rsync socat srecord sudo \ | ||
texinfo unzip wget ovmf xz-utils | ||
|
||
- name: Install west | ||
run: sudo pip install west | ||
|
||
- name: Init west workspace | ||
run: west init zephyr | ||
|
||
- name: Update west.yml | ||
working-directory: zephyr/zephyr | ||
run: | | ||
REF=$(echo '${{ github.ref }}' | sed -e 's/\//\\\//g') | ||
sed -e 's/remotes:/remotes:\n \- name: wolfssl\n url\-base: https:\/\/github.com\/wolfssl/' -i west.yml | ||
sed -e "s/remotes:/remotes:\n \- name: wolfmqtt\n url\-base: https:\/\/github.com\/${{ github.repository_owner }}/" -i west.yml | ||
sed -e "s/projects:/projects:\n \- name: wolfMQTT\n path: modules\/lib\/wolfmqtt\n remote: wolfmqtt\n revision: $REF/" -i west.yml | ||
sed -e 's/projects:/projects:\n \- name: wolfssl\n path: modules\/crypto\/wolfssl\n remote: wolfssl\n revision: master/' -i west.yml | ||
|
||
- name: Update west workspace | ||
working-directory: zephyr | ||
run: west update -n -o=--depth=1 | ||
|
||
- name: Export zephyr | ||
working-directory: zephyr | ||
run: west zephyr-export | ||
|
||
- name: Install pip dependencies | ||
working-directory: zephyr | ||
run: sudo pip install -r zephyr/scripts/requirements.txt | ||
|
||
- name: Install zephyr SDK | ||
run: | | ||
wget -q https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.1/zephyr-sdk-0.16.1_linux-x86_64.tar.xz | ||
tar xf zephyr-sdk-0.16.1_linux-x86_64.tar.xz | ||
cd zephyr-sdk-0.16.1 | ||
./setup.sh -h -c | ||
|
||
- name: Setup qemu networking | ||
working-directory: zephyr/tools/net-tools | ||
run: | | ||
make | ||
./loop-socat.sh & | ||
sleep 1 # let the networks set everything up | ||
sudo ./loop-slip-tap.sh -v & | ||
sleep 1 # let the networks set everything up | ||
|
||
- name: Setup mosquitto broker and sub | ||
working-directory: zephyr/modules/lib/wolfmqtt | ||
run: | | ||
# Disable default broker daemon | ||
sudo service mosquitto stop | ||
mosquitto -c scripts/broker_test/mosquitto.conf &> broker.log & | ||
sleep 1 # let the broker set everything up | ||
mosquitto_sub -t sensors &> sub.log & | ||
|
||
# This is some debug info useful if something goes wrong | ||
- name: Show network status | ||
run: | | ||
sudo ifconfig | ||
sudo route | ||
sudo netstat -tulpan | ||
|
||
- name: Run client | ||
id: client-test | ||
working-directory: zephyr | ||
run: | | ||
./zephyr/scripts/twister --testsuite-root modules/lib/wolfmqtt --test zephyr/samples/client/sample.lib.wolfmqtt_client -vvv | ||
rm -rf zephyr/twister-out | ||
|
||
- name: Check output | ||
run: | | ||
grep test zephyr/modules/lib/wolfmqtt/sub.log | ||
> zephyr/modules/lib/wolfmqtt/sub.log # clear file | ||
|
||
- name: Run tls client | ||
id: client-tls-test | ||
working-directory: zephyr | ||
run: | | ||
./zephyr/scripts/twister --testsuite-root modules/lib/wolfmqtt --test zephyr/samples/client_tls/sample.lib.wolfmqtt_client_tls -vvv | ||
rm -rf zephyr/twister-out | ||
|
||
- name: Check output | ||
run: | | ||
grep test zephyr/modules/lib/wolfmqtt/sub.log | ||
> zephyr/modules/lib/wolfmqtt/sub.log # clear file | ||
|
||
- name: Zip failure logs | ||
if: ${{ failure() && (steps.client-test.outcome == 'failure' || steps.client-tls-test.outcome == 'failure') }} | ||
run: | | ||
zip -9 -r logs.zip zephyr/twister-out | ||
zip -9 logs.zip zephyr/modules/lib/wolfmqtt/broker.log \ | ||
zephyr/modules/lib/wolfmqtt/sub.log | ||
|
||
- name: Upload failure logs | ||
if: ${{ failure() && (steps.client-test.outcome == 'failure' || steps.client-tls-test.outcome == 'failure') }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: zephyr-client-test-logs | ||
path: logs.zip | ||
retention-days: 5 |
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for
#if !defined(NO_FILESYSTEM)
. Would it make sense to have it be#else
instead of#elif defined(WOLFMQTT_ZEPHYR)
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gated it on
WOLFMQTT_ZEPHYR
due to the#if 0
that was in there. It achieves the same and new configurations that want this section to be active can add the configs here.