-
Notifications
You must be signed in to change notification settings - Fork 2
Turn multicast into an optional feature #201
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
Show all changes
11 commits
Select commit
Hold shift + click to select a range
41c0ab2
userspace changes
Nieuwejaar ee8f110
p4
Nieuwejaar 262b326
cleanup
Nieuwejaar 5c9500a
test cleanup
Nieuwejaar 9928927
add CI test for multicast-enabled dendrite
Nieuwejaar a61d49b
swadm fix
Nieuwejaar 98fe547
test fix
Nieuwejaar 5fe5d86
code review changes
Nieuwejaar d087c3f
clippy
Nieuwejaar 4fa9d64
feature prop
Nieuwejaar 7d2e961
swadm features
Nieuwejaar 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 |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| #!/bin/bash | ||
| #: | ||
| #: name = "multicast-test" | ||
| #: variety = "basic" | ||
| #: target = "ubuntu-22.04" | ||
| #: rust_toolchain = true | ||
| #: | ||
| #: output_rules = [ | ||
| #: "/work/simulator.log", | ||
| #: "/work/dpd.log", | ||
| #: ] | ||
| #: | ||
|
|
||
| #### >>>>>>>>>>>>>>>>>>>>>>>>>>>> Local Usage >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> | ||
| #### | ||
| #### The following environment variables are useful. | ||
| #### | ||
| #### - JUST_TEST=1 Just runs the tests, skipping system prep. | ||
| #### - TESTNAME='$name' Will just run the specified test. | ||
| #### - STARTUP_TIMEOUT=n Seconds to wait for tofino-model/dpd to start. | ||
| #### Defaults to 15. | ||
| #### - NOBUILD=1 Don't build sidecar.p4 (in case you've already | ||
| #### built it) | ||
| #### | ||
| #### <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | ||
|
|
||
| export RUST_BACKTRACE=1 | ||
|
|
||
| set -o errexit | ||
| set -o pipefail | ||
| set -o xtrace | ||
|
|
||
| export MULTICAST=1 | ||
| source .github/buildomat/packet-test-common.sh | ||
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
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,132 @@ | ||
| export RUST_BACKTRACE=1 | ||
|
|
||
| source .github/buildomat/common.sh | ||
| source .github/buildomat/linux.sh | ||
|
|
||
| wd=`pwd` | ||
| export WS=$wd | ||
| MODEL_STARTUP_TIMEOUT=${MODEL_STARTUP_TIMEOUT:=5} | ||
| STARTUP_TIMEOUT=${STARTUP_TIMEOUT:=120} | ||
|
|
||
| if [ x$MULTICAST == x ]; then | ||
| BUILD_FEATURES=tofino_asic | ||
| CODEGEN_FEATURES= | ||
| SWADM_FEATURES= | ||
| else | ||
| BUILD_FEATURES=tofino_asic,multicast | ||
| CODEGEN_FEATURES=--multicast | ||
| SWADM_FEATURES=--features=multicast | ||
| fi | ||
|
|
||
| function cleanup { | ||
| set +o errexit | ||
| set +o pipefail | ||
| cd $wd | ||
| sudo -E pkill -9 dpd | ||
| sudo -E pkill -9 tofino-model | ||
| sudo -E ./tools/veth_teardown.sh | ||
| stty sane | ||
| # wait for daemons to die, if log file sizes change this can fail CI | ||
| sleep 10 | ||
| } | ||
| trap cleanup EXIT | ||
|
|
||
| if [[ $JUST_TEST -ne 1 ]]; then | ||
| # See what hugepages was before starting | ||
| sysctl vm.nr_hugepages | ||
| # Make sure huge pages is enabled. This is required for running the SDE on | ||
| # linux. | ||
| sudo -E sysctl -w vm.nr_hugepages=128 | ||
| # Under some circumstances the sysctl may not completely work, so flush | ||
| # the vm caches and retry. | ||
| sudo -E sh -c 'echo 3 > /proc/sys/vm/drop_caches' | ||
| sudo -E sysctl -w vm.nr_hugepages=128 | ||
| # See what hugepages is now. If this is zero and things go sideways later, | ||
| # you'll know why. | ||
| sysctl vm.nr_hugepages | ||
|
|
||
| banner "Packages" | ||
| sudo apt update -y | ||
| sudo apt install -y \ | ||
| libpcap-dev \ | ||
| libclang-dev \ | ||
| libssl-dev \ | ||
| pkg-config \ | ||
| libcli-dev \ | ||
| sysvbanner | ||
| fi | ||
|
|
||
| export SDE=/opt/oxide/tofino_sde | ||
|
|
||
| banner "Build" | ||
| if [[ $NOBUILD -ne 1 ]]; then | ||
| cargo build --features=$BUILD_FEATURES --bin dpd --bin swadm | ||
| cargo xtask codegen --stages $TOFINO_STAGES $CODEGEN_FEATURES | ||
| fi | ||
|
|
||
| banner "Test" | ||
| sudo -E ./tools/veth_setup.sh | ||
| id=`id -un` | ||
| gr=`id -gn` | ||
| sudo -E mkdir -p /work | ||
| sudo -E chown $id:$gr /work | ||
| sudo -E ./tools/run_tofino_model.sh &> /work/simulator.log & | ||
| sleep $MODEL_STARTUP_TIMEOUT | ||
| sudo -E ./tools/run_dpd.sh -m 127.0.0.1 &> /work/dpd.log & | ||
| echo "waiting for dpd to come online" | ||
| set +o errexit | ||
|
|
||
| SLEEP_TIME=5 | ||
| iters=$(( $STARTUP_TIMEOUT / $SLEEP_TIME )) | ||
| while [ 1 ] ; do | ||
| ./target/debug/swadm --host '[::1]' build-info 2> /dev/null | ||
| if [ $? == 0 ]; then | ||
| break | ||
| fi | ||
| iters=$(($iters - 1)) | ||
| if [ $iters = 0 ]; then | ||
| echo "dpd failed to come online in $STARTUP_TIMEOUT seconds" | ||
| exit 1 | ||
| fi | ||
| sleep $SLEEP_TIME | ||
| done | ||
| set -o errexit | ||
|
|
||
| banner "Links" | ||
|
|
||
| ./target/debug/swadm --host '[::1]' link ls || echo "failed to list links" | ||
|
|
||
| banner "swadm Checks" | ||
|
|
||
| pushd swadm | ||
|
|
||
| DENDRITE_TEST_HOST='[::1]' \ | ||
| DENDRITE_TEST_VERBOSITY=3 \ | ||
| cargo test \ | ||
| --no-fail-fast \ | ||
| $SWADM_FEATURES \ | ||
| --test \ | ||
| counters \ | ||
| -- \ | ||
| --ignored | ||
|
|
||
| popd | ||
|
|
||
| banner "Packet Tests" | ||
|
|
||
| set +o errexit | ||
| set +o pipefail | ||
| stty sane | ||
| set -o errexit | ||
| set -o pipefail | ||
|
|
||
| pushd dpd-client | ||
|
|
||
| DENDRITE_TEST_HOST='[::1]' \ | ||
| DENDRITE_TEST_VERBOSITY=3 \ | ||
| cargo test \ | ||
| --features $BUILD_FEATURES \ | ||
| --no-fail-fast \ | ||
| $TESTNAME \ | ||
| -- \ | ||
| --ignored |
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
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
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.