Skip to content

Commit 40a403e

Browse files
committed
Merge branch 'security-manager-dev' of https://github.com/paul-szczepanek-arm/mbed-os into fix-encryption-rejection
2 parents b5e8d4e + b95da8d commit 40a403e

File tree

2,397 files changed

+355165
-53054
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,397 files changed

+355165
-53054
lines changed

.astyleignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
BUILD
2+
cmsis
3+
features/mbedtls
4+
features/FEATURE_LWIP/lwip
5+
rtos/TARGET_CORTEX/rtx4
6+
features/filesystem/littlefs/littlefs
7+
features/filesystem/fat/ChaN
8+
features/frameworks
9+
features/FEATURE_BLE/targets
10+
features/FEATURE_LWIP/lwip-interface/lwip
11+
features/unsupported/
12+
features/FEATURE_COMMON_PAL/
13+
FEATURE_NANOSTACK/coap-service
14+
FEATURE_NANOSTACK/sal-stack-nanostack
15+
rtos/TARGET_CORTEX/rtx5
16+
targets
17+
tools

.astylerc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Mbed OS code style definition file for astyle
2+
3+
# Don't create backup files, let git handle it
4+
suffix=none
5+
6+
# K&R style
7+
style=kr
8+
9+
# 1 TBS addition to k&r, add braces to one liners
10+
# Use -j as it was changed in astyle from brackets to braces, this way it is compatible with older astyle versions
11+
-j
12+
13+
# 4 spaces, convert tabs to spaces
14+
indent=spaces=4
15+
convert-tabs
16+
17+
# Indent switches and cases
18+
indent-switches
19+
indent-cases
20+
21+
# Remove spaces in and around parentheses
22+
unpad-paren
23+
24+
# Insert a space after if, while, for, and around operators
25+
pad-header
26+
pad-oper
27+
28+
# Pointer/reference operators go next to the name (on the right)
29+
align-pointer=name
30+
align-reference=name
31+
32+
# Attach { for classes and namespaces
33+
attach-namespaces
34+
attach-classes

.github/issue_template.md

Lines changed: 29 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,31 @@
1-
Note: This is just a template, so feel free to use/remove the unnecessary things
2-
31
### Description
4-
- Type: Bug | Enhancement | Question
5-
- Related issue: `#abc`
6-
- Priority: Blocker | Major | Minor
7-
8-
---------------------------------------------------------------
9-
## Bug
10-
11-
**Target**
12-
K64F|??
13-
14-
**Toolchain:**
15-
GCC_ARM|ARM|IAR
16-
17-
**Toolchain version:**
18-
19-
**mbed-cli version:**
20-
(`mbed --version`)
21-
22-
**mbed-os sha:**
23-
(`git log -n1 --oneline`)
24-
25-
**DAPLink version:**
26-
27-
**Expected behavior**
28-
29-
**Actual behavior**
30-
31-
**Steps to reproduce**
32-
33-
----------------------------------------------------------------
34-
## Enhancement
35-
36-
**Reason to enhance or problem with existing solution**
37-
38-
**Suggested enhancement**
39-
40-
**Pros**
41-
42-
**Cons**
43-
44-
-----------------------------------------------------------------
45-
46-
## Question
2+
<!--
3+
Required
4+
Add detailed description of what you are reporting.
5+
Good example: https://os.mbed.com/docs/latest/reference/workflow.html
6+
Things to consider sharing:
7+
- What target does this relate to?
8+
- What toolchain (name + version) are you using?
9+
- What tools (name + version - is it mbed-cli, online compiler or IDE) are you using?
10+
- What is the SHA of Mbed OS (git log -n1 --oneline)?
11+
- Steps to reproduce. (Did you publish code or a test case that exhibits the problem?)
12+
-->
13+
14+
15+
### Issue request type
16+
<!--
17+
Required
18+
Please add only one X to one of the following types. Do not fill multiple types. (Split the issue otherwise.)
19+
Please note this is not a GitHub task list; indenting the boxes or changing the format to add a '.' or '*' in front
20+
of them changes the meaning incorrectly. The only changes to make are to add a description under the
21+
description heading and to add an 'x' to the correct box.
22+
23+
[X] Question
24+
[ ] Enhancement
25+
[ ] Bug
26+
-->
27+
28+
[ ] Question
29+
[ ] Enhancement
30+
[ ] Bug
4731

48-
**How to?**

.github/pull_request_template.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,22 @@
33
<!--
44
Required
55
Add here detailed changes summary, testing results, dependencies
6-
Good example: https://os.mbed.com/docs/latest/reference/guidelines.html#workflow (Pull request template)
6+
Good example: https://os.mbed.com/docs/latest/reference/workflow.html (Pull request template)
77
-->
88

99

1010
### Pull request type
1111

1212
<!--
1313
Required
14-
Please tick one of the following types
14+
Please add only one X to one of the following types. Do not fill multiple types (split the pull request otherwise).
15+
Please note this is not a GitHub task list, indenting the boxes or changing the format to add a '.' or '*' in front
16+
of them would change the meaning incorrectly. The only changes to be made are to add a description text under the
17+
description heading and to add a 'x' to the correct box.
1518
-->
19+
[ ] Fix
20+
[ ] Refactor
21+
[ ] New target
22+
[ ] Feature
23+
[ ] Breaking change
1624

17-
- [ ] Fix
18-
- [ ] Refactor
19-
- [ ] New target
20-
- [ ] Feature
21-
- [ ] Breaking change

.travis.yml

Lines changed: 64 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ before_install:
3131
# Setup ppa to make sure arm-none-eabi-gcc is correct version
3232
- sudo add-apt-repository -y ppa:team-gcc-arm-embedded/ppa
3333
# Loop until update succeeds (timeouts can occur)
34-
- while [ -n "$(sudo apt-get update 2>&1 |grep Failed)" ]; do :; done
34+
- travis_retry $(! sudo apt-get update 2>&1 |grep Failed)
3535

3636
after_success:
3737
- bash -c "$STATUS" success "Local $NAME testing has passed"
@@ -94,6 +94,45 @@ matrix:
9494
# Report success since we have overridden default behaviour
9595
- bash -c "$STATUS" success "Local $NAME testing has passed"
9696

97+
- env:
98+
- NAME=astyle
99+
install:
100+
- wget https://downloads.sourceforge.net/project/astyle/astyle/astyle%203.1/astyle_3.1_linux.tar.gz;
101+
mkdir -p BUILD && tar xf astyle_3.1_linux.tar.gz -C BUILD;
102+
pushd BUILD/astyle/build/gcc;
103+
make;
104+
export PATH=$PWD/bin:$PATH;
105+
popd;
106+
- astyle --version
107+
script:
108+
# only changed files this time
109+
- git diff --name-only $TRAVIS_BRANCH | grep '.*\.\(h\|c\|hpp\|cpp\)' | fgrep -v -f .astyleignore | xargs -n 100 -I {} bash -c "astyle -n --options=.astylerc \"{}\"" > astyle-files-changed.out;
110+
if [ $(cat astyle-files-changed.out | grep Formatted | wc -l) -ne 0 ]; then
111+
git --no-pager diff;
112+
echo "Please fix style issues as shown above";
113+
else
114+
echo "Coding style check OK";
115+
fi
116+
after_success:
117+
# run astyle for all files on the branch
118+
- git checkout -- .
119+
- find -regex '.*\.\(h\|c\|hpp\|cpp\)' -type f | fgrep -v -f .astyleignore | xargs -n 100 -I {} bash -c "astyle -n --options=.astylerc \"{}\"" > astyle-branch.out;
120+
# update status if we succeeded, compare with master if possible
121+
- |
122+
CURR=$(cat astyle-branch.out | grep Formatted | wc -l)
123+
PREV=$(curl https://api.github.com/repos/$TRAVIS_REPO_SLUG/status/master \
124+
| jq -re "select(.sha != \"$TRAVIS_COMMIT\")
125+
| .statuses[] | select(.context == \"travis-ci/$NAME\").description
126+
| capture(\", (?<warnings>[0-9]+) warnings\").warnings" \
127+
|| echo 0)
128+
129+
STATUSM="Passed, ${CURR} warnings"
130+
if [ "$PREV" -ne 0 ]
131+
then
132+
STATUSM="$STATUSM ($(python -c "print '%+d' % ($CURR-$PREV)") warnings)"
133+
fi
134+
- bash -c "$STATUS" success "$STATUSM"
135+
97136
- env:
98137
- NAME=events
99138
- EVENTS=events
@@ -111,10 +150,28 @@ matrix:
111150
- python tools/make.py -t GCC_ARM -m K64F --source=. --build=BUILD/K64F/GCC_ARM -j0
112151
# Check that example compiles without rtos
113152
- sed -n '/``` cpp/,/```/{/```$/Q;/```/d;p;}' $EVENTS/README.md > main.cpp
114-
- rm -r rtos features/cellular features/netsocket features/frameworks BUILD
153+
- rm -r rtos features/cellular features/netsocket features/nanostack features/frameworks BUILD
115154
- python tools/make.py -t GCC_ARM -m DISCO_F401VC --source=. --build=BUILD/DISCO_F401VC/GCC_ARM -j0
116155
# Run local equeue tests
117156
- make -C $EVENTS/equeue test
157+
# Run profiling tests
158+
- make -C $EVENTS/equeue prof | tee prof
159+
after_success:
160+
# update status if we succeeded, compare with master if possible
161+
- |
162+
CURR=$(grep -o '[0-9]\+ cycles' prof | awk '{sum += $1} END {print sum}')
163+
PREV=$(curl -u "$MBED_BOT" https://api.github.com/repos/$TRAVIS_REPO_SLUG/status/master \
164+
| jq -re "select(.sha != \"$TRAVIS_COMMIT\")
165+
| .statuses[] | select(.context == \"travis-ci/$NAME\").description
166+
| capture(\"runtime is (?<runtime>[0-9]+)\").runtime" \
167+
|| echo 0)
168+
169+
STATUSM="Passed, runtime is ${CURR} cycles"
170+
if [ "$PREV" -ne 0 ]
171+
then
172+
STATUSM="$STATUSM ($(python -c "print '%+d' % ($CURR-$PREV)") cycles)"
173+
fi
174+
- bash -c "$STATUS" success "$STATUSM"
118175

119176
- env:
120177
- NAME=littlefs
@@ -175,7 +232,7 @@ matrix:
175232
# update status if we succeeded, compare with master if possible
176233
- |
177234
CURR=$(tail -n1 sizes | awk '{print $1}')
178-
PREV=$(curl https://api.github.com/repos/$TRAVIS_REPO_SLUG/status/master \
235+
PREV=$(curl -u "$MBED_BOT" https://api.github.com/repos/$TRAVIS_REPO_SLUG/status/master \
179236
| jq -re "select(.sha != \"$TRAVIS_COMMIT\")
180237
| .statuses[] | select(.context == \"travis-ci/$NAME\").description
181238
| capture(\"code size is (?<size>[0-9]+)\").size" \
@@ -188,36 +245,8 @@ matrix:
188245
fi
189246
- bash -c "$STATUS" success "$STATUSM"
190247

191-
- &mbed-2
192-
env: NAME=mbed2-NXP
193-
install:
194-
# Install dependencies
195-
- export GCC_DIR=$HOME/gcc-arm-none-eabi-6-2017-q2-update
196-
- export GCC_ARCHIVE=$HOME/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2
197-
- export GCC_URL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/6-2017q2/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2?revision=2cc92fb5-3e0e-402d-9197-bdfc8224d8a5?product=GNU%20Arm%20Embedded%20Toolchain,64-bit,,Linux,6-2017-q2-update
198-
- if [ ! -e $GCC_DIR/bin/arm-none-eabi-gcc ]; then wget $GCC_URL -O $GCC_ARCHIVE; tar xfj $GCC_ARCHIVE -C $HOME; fi
199-
- export PATH=$PATH:$GCC_DIR/bin
200-
- pip install -r requirements.txt
201-
# Print versions we use
202-
- arm-none-eabi-gcc --version
203-
- python --version
204-
before_script:
205-
# Create BUILD directory for tests
206-
- mkdir BUILD
248+
- env:
249+
- NAME=gitattributestest
207250
script:
208-
# Run local mbed 2 testing
209-
- python -u tools/build_travis.py --vendor "${NAME#mbed2-}"
210-
- <<: *mbed-2
211-
env: NAME=mbed2-STM
212-
- <<: *mbed-2
213-
env: NAME=mbed2-NORDIC
214-
- <<: *mbed-2
215-
env: NAME=mbed2-SILICON_LABS
216-
- <<: *mbed-2
217-
env: NAME=mbed2-MAXIM
218-
- <<: *mbed-2
219-
env: NAME=mbed2-ATMEL
220-
- <<: *mbed-2
221-
env: NAME=mbed2-NUVOTON
222-
- <<: *mbed-2
223-
env: NAME=mbed2-RENESAS
251+
# Check that no changes after clone. This check that .gitattributes is used right way.
252+
- git diff --exit-code

TESTS/host_tests/device_echo.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
"""
2+
mbed SDK
3+
Copyright (c) 2011-2016 ARM Limited
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
"""
17+
18+
19+
import uuid
20+
from mbed_host_tests import BaseHostTest
21+
22+
class Device_Echo(BaseHostTest):
23+
24+
def _callback_repeat(self, key, value, _):
25+
self.send_kv(key, value)
26+
27+
def setup(self):
28+
self.register_callback("echo", self._callback_repeat)
29+
self.register_callback("echo_count", self._callback_repeat)
30+
31+
def teardown(self):
32+
pass

0 commit comments

Comments
 (0)