-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #237 from vkottler/dev/tftp
Initial tftp scaffolding
- Loading branch information
Showing
45 changed files
with
1,544 additions
and
94 deletions.
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 |
---|---|---|
|
@@ -19,3 +19,4 @@ compile_commands.json | |
src | ||
*.webm | ||
*.log | ||
tmp |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[DESIGN] | ||
max-args=9 | ||
max-attributes=14 | ||
max-attributes=15 | ||
max-parents=13 | ||
max-branches=13 | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
REPO=$(git rev-parse --show-toplevel) | ||
REL=local/arbiter | ||
CWD=$REPO/$REL | ||
TMP=$CWD/tmp | ||
|
||
PORT=8001 | ||
|
||
tftp_cmd() { | ||
rlwrap tftp -m octet localhost $PORT "$@" | ||
} | ||
|
||
test_get_file() { | ||
for FILE in LICENSE README.md tags; do | ||
if [ -f "$REPO/$FILE" ]; then | ||
tftp_cmd -c get "$FILE" | ||
diff "$REPO/$FILE" "$TMP/$FILE" | ||
fi | ||
done | ||
} | ||
|
||
test_large_file() { | ||
fallocate -l 30M "$REPO/dummy.bin" | ||
tftp_cmd -c get dummy.bin | ||
diff "$REPO/dummy.bin" "$TMP/dummy.bin" | ||
rm "$REPO/dummy.bin" | ||
} | ||
|
||
clear_tmp() { | ||
rm -f "$TMP/*" | ||
} | ||
|
||
test_write_files() { | ||
for FILE in LICENSE README.md tags; do | ||
tftp_cmd -c put "$REPO/$FILE" $REL/tmp/$FILE | ||
sleep 0.25 | ||
diff "$REPO/$FILE" "$TMP/$FILE" | ||
done | ||
} | ||
|
||
mkdir -p "$TMP" | ||
pushd "$TMP" >/dev/null || exit | ||
set -x | ||
|
||
# Test that we can retrieve files. | ||
test_get_file | ||
test_large_file | ||
|
||
# Clear directory. | ||
clear_tmp | ||
|
||
# Test that we can write files. | ||
test_write_files | ||
|
||
set +x | ||
popd >/dev/null || exit | ||
|
||
# rm -rf "$TMP" | ||
|
||
echo "Success." |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
major: 5 | ||
minor: 0 | ||
patch: 1 | ||
minor: 1 | ||
patch: 0 | ||
entry: runtimepy |
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
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,12 @@ | ||
--- | ||
includes: | ||
- package://runtimepy/factories.yaml | ||
|
||
ports: | ||
- {name: tftp_server, type: udp} | ||
|
||
clients: | ||
- factory: tftp | ||
name: tftp_server | ||
kwargs: | ||
local_addr: [localhost, "$tftp_server"] |
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.