-
Notifications
You must be signed in to change notification settings - Fork 99
tests: Organize and label MPU unit tests #498
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
Merged
Merged
Changes from all commits
Commits
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 hidden or 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 |
---|---|---|
@@ -1,4 +1,56 @@ | ||
MPU Tests | ||
========= | ||
|
||
Test that the MPU restricts process accesses correctly. | ||
Tests that the MPU restricts process accesses correctly. | ||
|
||
MPU test applications are necessarily somewhat fine-grained, as each MPU | ||
violation results in termination of the test process. | ||
|
||
As it can be annoying to flash myriad apps during development, the tests in the | ||
top-level directory attempt to exercise all of the reads and writes of regions | ||
that _should_ work during normal operation (and allow use of a button to inject | ||
faults for interactive testing). The `unit/` folder holds all of the smaller | ||
tests which attempt to violate access rules at each of the boundaries. | ||
|
||
```text | ||
Perms? Application Memory Layout Relevant Memop(s) Test | ||
|
||
╔═ ╒RWX════════ ← mem_start + mem_len.....{3-mem_end} get unit/mpu_ram_end | ||
║ │...┆Grant Pointers | ||
║ │...┆────── | ||
║ │...┆Process Control Block | ||
║ ╔═ │...┆────── | ||
║ │...┆Grant Regions | ||
║ D │...┆ | ||
║ Y │...┆ ↓ | ||
║ N │...┆────── ← kernel_memory_break.....{6-grant start} get unit/mpu_grant_start | ||
║ A │...┆ | ||
║ M │rw.┆────── ← app_break...............{0-brk, 1-sbrk} unit/mpu_heap_end | ||
║ I │rw.┆ get or move | ||
║ C │rw.┆ ↑ | ||
║ │rw.┆ Heap | ||
║ ╚═ │rw.┆────── ← app_heap_start..........{11-heap bot} set (debug facilty; untested) | ||
│rw.┆ Data | ||
F │rw.┆────── ← data_start_pointer......{10-stack top} set (debug facilty; untested) | ||
I │rw.┆Stack | ||
X │rw.┆ ↓ | ||
E │rw.┆ | ||
D │rw.┆────── ← current_stack_pointer | ||
│rw.┆ | ||
╚═══ ╘═══════════ ← memory_start............{2-mem_start} get unit/mpu_stack_growth (needs refinement) | ||
|
||
╔═ ╒RWX ═══════ ← app end.................{5-flash end} get unit/mpu_flash_end | ||
║ │r.x┆ | ||
│r.x┆ app | ||
F │r.x┆ | ||
I ╔ │r.x┆────── | ||
X T │r..┆ | ||
E B │rw.┆ ┍── | ||
D F rw.┆ ┋ Writeable flash | ||
│rw.┆ ┍── regions in the {9-region[N] end} get (todo) | ||
║ H │rw.┆ ┝── TBF header {8-region[N] start} get (todo) | ||
║ D │rw.┆ ┕── | ||
║ R │r..┆ {7-#flash regions} get (todo) | ||
║ │r..┆ | ||
╚═ ╚ ╘═══════════ ← app start...............{4-flash start} get unit/mpu_flash_start | ||
``` |
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
examples/tests/mpu/mpu_flash_end/Makefile → ...les/tests/mpu/unit/mpu_flash_end/Makefile
This file contains hidden or 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
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
examples/tests/mpu/mpu_flash_start/Makefile → ...s/tests/mpu/unit/mpu_flash_start/Makefile
This file contains hidden or 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
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
examples/tests/mpu/mpu_grant_start/Makefile → ...s/tests/mpu/unit/mpu_grant_start/Makefile
This file contains hidden or 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
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
examples/tests/mpu/mpu_heap_end/Makefile → ...ples/tests/mpu/unit/mpu_heap_end/Makefile
This file contains hidden or 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
File renamed without changes.
File renamed without changes.
This file contains hidden or 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,13 @@ | ||
# Makefile for user application | ||
|
||
# Specify this directory relative to the current application. | ||
TOCK_USERLAND_BASE_DIR = ../../../../.. | ||
|
||
# Which files to compile. | ||
C_SRCS := $(wildcard *.c) | ||
|
||
STACK_SIZE := 1024 | ||
|
||
# Include userland master makefile. Contains rules and flags for actually | ||
# building the application. | ||
include $(TOCK_USERLAND_BASE_DIR)/AppMakefile.mk |
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
examples/tests/mpu/mpu_stack_growth/Makefile → .../tests/mpu/unit/mpu_stack_growth/Makefile
This file contains hidden or 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
File renamed without changes.
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.
Weird that this is the only
Makefile
in the diff that git doesn't seem to track as a rename? (at least using GitHub's diff settings / algorithm)