-
Notifications
You must be signed in to change notification settings - Fork 167
[mdns]: Refactor stage #1 #776
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
Open
david-cermak
wants to merge
29
commits into
espressif:master
Choose a base branch
from
david-cermak:mdns/refactor
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 22 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
bb5e9fc
feat(mdns): refactor stage #1
david-cermak 83a59da
feat(mdns): Make mdns-debug a separate module
david-cermak 6502567
feat(mdns): Separate packet-tx and browse
david-cermak a569c63
feat(mdns): Add responder module
david-cermak d50d89c
feat(mdns): Querier-search stuff, Responder-pcb stuff
david-cermak ff5cef6
feat(mdns): action queue abstraction
david-cermak 62bd747
fix(mdns): Minor cleanup of packet parser
david-cermak 21a5dc5
fix(mdns): Cleanup and split interfaces between modules
david-cermak 28128a8
feat(mdns): Add fuzzing job with AFL++
david-cermak 3e5946a
fix(mdns): Rename and cleanup
david-cermak acd3c13
feat(mdns): Add service module
david-cermak 2005f3f
fix(mdns): Forward porting 8ca45f34fa delete race
david-cermak 2b15776
fix(mdns): Minor cleanup
david-cermak 0bd74cb
fix(mdns): Refactor fuzzer test suite
david-cermak 6db95af
fix(mdns): Add host unit tests
david-cermak 0974c6b
fix(mdns): Add receiver unit tests
david-cermak afbec7d
feat(mdns): Add test template for mdns-sender
david-cermak d847677
fix(mdns): Minor cleanup
david-cermak 7330f78
fix(mdns): Cleanup querier and pcb
david-cermak c41424e
fix(mdns): Cleanup mdns sender
david-cermak 1738b70
fix(mdns): Cleanup mdns sender
david-cermak 48fef6f
fix(mdns): Add documentation about the refactor, remove old fuzz
david-cermak 582d2e4
fix(mdns): Add refactoring details to help review changes
david-cermak ed87fa2
fix(mdns): Add data-flow diagram
david-cermak 6b5fb91
fix(mdns): Make debug module more flexible
david-cermak 4379c7e
fix(mdns): Address minor review comments
david-cermak c42b578
fix(mdns): Debug prints with small buffer
david-cermak 086cd3c
fix(mdns): Minor cleanup
david-cermak 6664b88
fix(mdns): Fix host tests by freezing idf-build-apps to 2.10
david-cermak 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 |
---|---|---|
|
@@ -55,8 +55,11 @@ jobs: | |
shell: bash | ||
run: | | ||
. ${IDF_PATH}/export.sh | ||
cd components/mdns/tests/test_afl_fuzz_host/ | ||
make INSTR=off | ||
cd components/mdns/tests/host_unit_test/ | ||
idf.py reconfigure | ||
mkdir build2 && cd build2 | ||
cmake .. | ||
cmake --build . | ||
- name: Test no malloc functions | ||
shell: bash | ||
run: | | ||
|
@@ -68,3 +71,91 @@ jobs: | |
diff -q $file /tmp/$file || exit 1 | ||
echo "OK" | ||
done | ||
|
||
host_unit_test: | ||
if: contains(github.event.pull_request.labels.*.name, 'mdns') || github.event_name == 'push' | ||
name: Unit tests on host | ||
strategy: | ||
matrix: | ||
idf_ver: ["latest"] | ||
|
||
runs-on: ubuntu-22.04 | ||
container: espressif/idf:${{ matrix.idf_ver }} | ||
steps: | ||
- name: Checkout esp-protocols | ||
uses: actions/checkout@v4 | ||
- name: Install bsdlib and ruby | ||
run: | | ||
apt-get update -y | ||
apt-get install -y libbsd-dev ruby | ||
- name: Build and run unit tests | ||
shell: bash | ||
run: | | ||
. ${IDF_PATH}/export.sh | ||
cd components/mdns/tests/host_unit_test/ | ||
idf.py reconfigure | ||
mkdir build2 && cd build2 | ||
cmake -DUNIT_TESTS=test_receiver .. | ||
cmake --build . | ||
ctest --extra-verbose | ||
cd .. | ||
mkdir build3 && cd build3 | ||
cmake -DUNIT_TESTS=test_sender .. | ||
cmake --build . | ||
ctest --extra-verbose | ||
|
||
|
||
fuzz_test: | ||
if: contains(github.event.pull_request.labels.*.name, 'mdns-fuzz') || github.event_name == 'push' | ||
name: Fuzzer tests for mdns lib | ||
strategy: | ||
matrix: | ||
idf_ver: ["latest"] | ||
|
||
runs-on: ubuntu-22.04 | ||
container: aflplusplus/aflplusplus | ||
steps: | ||
- name: Checkout esp-protocols | ||
uses: actions/checkout@v4 | ||
|
||
- name: Checkout ESP-IDF | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: espressif/esp-idf | ||
path: idf | ||
submodules: recursive | ||
|
||
- name: Install Necessary Libs | ||
run: | | ||
apt-get update -y | ||
apt-get install -y libbsd-dev | ||
|
||
- name: Run AFL++ | ||
shell: bash | ||
run: | | ||
export IDF_PATH=$GITHUB_WORKSPACE/idf | ||
cd components/mdns/tests/host_unit_test/ | ||
pip install dnslib | ||
cd input && python generate_cases.py && cd .. | ||
mkdir build2 && cd build2 | ||
cmake -DCMAKE_C_COMPILER=afl-cc .. | ||
cmake --build . | ||
cd .. | ||
timeout 10m afl-fuzz -i input -o out -- build2/mdns_host_unit_test || \ | ||
if [ $? -eq 124 ]; then # timeout exit code | ||
if [ -n "$(find out/default/crashes -type f 2>/dev/null)" ]; then | ||
echo "Crashes found!"; | ||
tar -czf out/default/crashes.tar.gz -C out/default crashes; | ||
exit 1; | ||
fi | ||
else | ||
exit 1; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this path There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is still a failure -- fuzzer returns another error code. |
||
fi | ||
|
||
- name: Upload Crash Artifacts | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: fuzz-crashes | ||
path: components/mdns/tests/host_unit_test/out/default/crashes.tar.gz | ||
if-no-files-found: ignore |
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
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.
Uh oh!
There was an error while loading. Please reload this page.