From cef9a7b65a0d17a35ef49291e2dd033ae71277a8 Mon Sep 17 00:00:00 2001 From: Jim Newsome Date: Tue, 30 Aug 2022 13:45:12 -0500 Subject: [PATCH] Create a shadow-based integration test Fixes https://gitlab.torproject.org/tpo/core/arti/-/issues/174 --- .editorconfig | 8 ++ .gitlab-ci.yml | 86 +++++++++++++++++- tests/shadow/README.md | 26 ++++++ tests/shadow/conf/authgen.pw | 2 + tests/shadow/conf/authgen.torrc | 3 + tests/shadow/conf/shadowresolv.conf | 1 + tests/shadow/conf/tgen.client.graphml.xml | 27 ++++++ tests/shadow/conf/tgen.server.graphml.xml | 8 ++ tests/shadow/conf/tgen.torclient.graphml.xml | 29 ++++++ tests/shadow/conf/tor.authority.torrc | 8 ++ tests/shadow/conf/tor.common.torrc | 26 ++++++ tests/shadow/conf/tor.exit.torrc | 1 + tests/shadow/conf/tor.non-exit.torrc | 1 + tests/shadow/conf/tor.relay.torrc | 3 + tests/shadow/run.sh | 27 ++++++ .../hosts/4uthority/fingerprint | 1 + .../hosts/4uthority/fingerprint-ed25519 | 1 + .../4uthority/keys/authority_certificate | 45 +++++++++ .../4uthority/keys/authority_identity_key | 41 +++++++++ .../4uthority/keys/authority_signing_key | 27 ++++++ .../keys/ed25519_master_id_public_key | Bin 0 -> 64 bytes .../keys/ed25519_master_id_secret_key | Bin 0 -> 96 bytes .../hosts/4uthority/keys/ed25519_signing_cert | Bin 0 -> 172 bytes .../4uthority/keys/ed25519_signing_secret_key | Bin 0 -> 96 bytes .../hosts/4uthority/keys/secret_id_key | 15 +++ .../hosts/4uthority/keys/secret_onion_key | 15 +++ .../hosts/4uthority/torrc | 0 .../hosts/4uthority/torrc-defaults | 3 + .../hosts/articlient/arti.toml | 17 ++++ .../hosts/exit1/fingerprint | 1 + .../hosts/exit1/keys/secret_id_key | 15 +++ .../hosts/exit1/keys/secret_onion_key | 15 +++ .../hosts/exit1/keys/secret_onion_key_ntor | Bin 0 -> 96 bytes .../shadow.data.template/hosts/exit1/torrc | 0 .../hosts/exit1/torrc-defaults | 3 + .../hosts/exit2/fingerprint | 1 + .../hosts/exit2/keys/secret_id_key | 15 +++ .../hosts/exit2/keys/secret_onion_key | 15 +++ .../hosts/exit2/keys/secret_onion_key_ntor | Bin 0 -> 96 bytes .../shadow.data.template/hosts/exit2/torrc | 0 .../hosts/exit2/torrc-defaults | 3 + .../hosts/relay1/fingerprint | 1 + .../hosts/relay1/keys/secret_id_key | 15 +++ .../hosts/relay1/keys/secret_onion_key | 15 +++ .../hosts/relay1/keys/secret_onion_key_ntor | Bin 0 -> 96 bytes .../shadow.data.template/hosts/relay1/torrc | 0 .../hosts/relay1/torrc-defaults | 3 + .../hosts/relay2/fingerprint | 1 + .../hosts/relay2/keys/secret_id_key | 15 +++ .../hosts/relay2/keys/secret_onion_key | 15 +++ .../hosts/relay2/keys/secret_onion_key_ntor | Bin 0 -> 96 bytes .../shadow.data.template/hosts/relay2/torrc | 0 .../hosts/relay2/torrc-defaults | 3 + tests/shadow/shadow.yaml | 81 +++++++++++++++++ 54 files changed, 637 insertions(+), 1 deletion(-) create mode 100644 tests/shadow/README.md create mode 100644 tests/shadow/conf/authgen.pw create mode 100644 tests/shadow/conf/authgen.torrc create mode 100644 tests/shadow/conf/shadowresolv.conf create mode 100644 tests/shadow/conf/tgen.client.graphml.xml create mode 100644 tests/shadow/conf/tgen.server.graphml.xml create mode 100644 tests/shadow/conf/tgen.torclient.graphml.xml create mode 100644 tests/shadow/conf/tor.authority.torrc create mode 100644 tests/shadow/conf/tor.common.torrc create mode 100644 tests/shadow/conf/tor.exit.torrc create mode 100644 tests/shadow/conf/tor.non-exit.torrc create mode 100644 tests/shadow/conf/tor.relay.torrc create mode 100755 tests/shadow/run.sh create mode 100644 tests/shadow/shadow.data.template/hosts/4uthority/fingerprint create mode 100644 tests/shadow/shadow.data.template/hosts/4uthority/fingerprint-ed25519 create mode 100644 tests/shadow/shadow.data.template/hosts/4uthority/keys/authority_certificate create mode 100644 tests/shadow/shadow.data.template/hosts/4uthority/keys/authority_identity_key create mode 100644 tests/shadow/shadow.data.template/hosts/4uthority/keys/authority_signing_key create mode 100644 tests/shadow/shadow.data.template/hosts/4uthority/keys/ed25519_master_id_public_key create mode 100644 tests/shadow/shadow.data.template/hosts/4uthority/keys/ed25519_master_id_secret_key create mode 100644 tests/shadow/shadow.data.template/hosts/4uthority/keys/ed25519_signing_cert create mode 100644 tests/shadow/shadow.data.template/hosts/4uthority/keys/ed25519_signing_secret_key create mode 100644 tests/shadow/shadow.data.template/hosts/4uthority/keys/secret_id_key create mode 100644 tests/shadow/shadow.data.template/hosts/4uthority/keys/secret_onion_key create mode 100644 tests/shadow/shadow.data.template/hosts/4uthority/torrc create mode 100644 tests/shadow/shadow.data.template/hosts/4uthority/torrc-defaults create mode 100644 tests/shadow/shadow.data.template/hosts/articlient/arti.toml create mode 100644 tests/shadow/shadow.data.template/hosts/exit1/fingerprint create mode 100644 tests/shadow/shadow.data.template/hosts/exit1/keys/secret_id_key create mode 100644 tests/shadow/shadow.data.template/hosts/exit1/keys/secret_onion_key create mode 100644 tests/shadow/shadow.data.template/hosts/exit1/keys/secret_onion_key_ntor create mode 100644 tests/shadow/shadow.data.template/hosts/exit1/torrc create mode 100644 tests/shadow/shadow.data.template/hosts/exit1/torrc-defaults create mode 100644 tests/shadow/shadow.data.template/hosts/exit2/fingerprint create mode 100644 tests/shadow/shadow.data.template/hosts/exit2/keys/secret_id_key create mode 100644 tests/shadow/shadow.data.template/hosts/exit2/keys/secret_onion_key create mode 100644 tests/shadow/shadow.data.template/hosts/exit2/keys/secret_onion_key_ntor create mode 100644 tests/shadow/shadow.data.template/hosts/exit2/torrc create mode 100644 tests/shadow/shadow.data.template/hosts/exit2/torrc-defaults create mode 100644 tests/shadow/shadow.data.template/hosts/relay1/fingerprint create mode 100644 tests/shadow/shadow.data.template/hosts/relay1/keys/secret_id_key create mode 100644 tests/shadow/shadow.data.template/hosts/relay1/keys/secret_onion_key create mode 100644 tests/shadow/shadow.data.template/hosts/relay1/keys/secret_onion_key_ntor create mode 100644 tests/shadow/shadow.data.template/hosts/relay1/torrc create mode 100644 tests/shadow/shadow.data.template/hosts/relay1/torrc-defaults create mode 100644 tests/shadow/shadow.data.template/hosts/relay2/fingerprint create mode 100644 tests/shadow/shadow.data.template/hosts/relay2/keys/secret_id_key create mode 100644 tests/shadow/shadow.data.template/hosts/relay2/keys/secret_onion_key create mode 100644 tests/shadow/shadow.data.template/hosts/relay2/keys/secret_onion_key_ntor create mode 100644 tests/shadow/shadow.data.template/hosts/relay2/torrc create mode 100644 tests/shadow/shadow.data.template/hosts/relay2/torrc-defaults create mode 100644 tests/shadow/shadow.yaml diff --git a/.editorconfig b/.editorconfig index b01e3da7a..56ccf3432 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,3 +4,11 @@ root = true charset = utf-8 insert_final_newline = true end_of_line = lf + +[tests/shadow/shadow.data.template/hosts/**/*{key,cert}*] +charset = unset +end_of_line = unset +insert_final_newline = unset +trim_trailing_whitespace = unset +indent_style = unset +indent_size = unset diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a15d2a93b..57b3930bc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -160,7 +160,7 @@ build-repro: - tpa - amd64 -integration: +integration-chutney: stage: test image: debian:stable-slim script: @@ -177,6 +177,90 @@ integration: tags: - amd64 +integration-shadow: + variables: + JOB_SHADOW_REPO: "https://github.com/shadow/shadow.git" + JOB_SHADOW_BRANCH: "main" + JOB_SHADOW_COMMIT: "v2.2.0" + + JOB_TGEN_REPO: "https://github.com/shadow/tgen.git" + JOB_TGEN_BRANCH: "main" + JOB_TGEN_COMMIT: "v1.1.1" + stage: test + cache: + - key: $CI_JOB_NAME-shadow-$JOB_SHADOW_COMMIT + paths: + - opt/shadow + - key: $CI_JOB_NAME-tgen-$JOB_TGEN_COMMIT + paths: + - opt/tgen + image: debian:11-slim + script: + # We're going to install binaries to $HOME/.local/bin + - 'export PATH=$HOME/.local/bin:$PATH' + + - apt-get update + - apt-get install -y git tor stow + - mkdir -p ~/src + - mkdir -p ~/.local + + # Build shadow + - | + if [ -f opt/shadow/bin/shadow ] + then + echo "Using shadow binary from cache" + else + echo "Building shadow" + git clone --shallow-since=2021-08-01 -b $JOB_SHADOW_BRANCH $JOB_SHADOW_REPO ~/src/shadow + pushd ~/src/shadow + git checkout $JOB_SHADOW_COMMIT + export CC=gcc CXX=g++ CONTAINER=debian:11-slim BUILDTYPE=release RUSTPROFILE=minimal + ci/container_scripts/install_deps.sh + ci/container_scripts/install_extra_deps.sh + export PATH="$HOME/.cargo/bin:${PATH}" + ./setup build --jobs $(nproc) --prefix $CI_PROJECT_DIR/opt/shadow + ./setup install + popd + fi + - apt-get install -y libglib2.0-0 + - stow -d opt -t $HOME/.local shadow + + # Build tgen + - | + if [ -f opt/tgen/bin/tgen ] + then + echo "Using tgen binary from cache" + else + echo "Building tgen" + git clone --shallow-since=2022-01-01 -b $JOB_TGEN_BRANCH $JOB_TGEN_REPO ~/src/tgen + pushd ~/src/tgen + git checkout $JOB_TGEN_COMMIT + apt-get install -y cmake gcc libglib2.0-0 libglib2.0-dev libigraph-dev make + mkdir build + cd build + cmake .. -DCMAKE_INSTALL_PREFIX=$CI_PROJECT_DIR/opt/tgen + make --jobs $(nproc) + make install + popd + fi + - apt-get install -y libigraph1 libglib2.0-0 + - stow -d opt -t $HOME/.local tgen + + # Ensure newly installed executables can be found + - hash -r + + # Run tests + - pushd tests/shadow + - ./run.sh + artifacts: + paths: + - tests/shadow + when: always + expire_in: 1 week + tags: + - amd64 + - shadow-small + coverage-aggregated: rules: - if: $CI_PIPELINE_SOURCE == "schedule" diff --git a/tests/shadow/README.md b/tests/shadow/README.md new file mode 100644 index 000000000..96b1c0d13 --- /dev/null +++ b/tests/shadow/README.md @@ -0,0 +1,26 @@ +# Shadow-based integration test + +This is an integration test for arti that uses the +[shadow](https://shadow.github.io/) simulator. It creates a simulation of a +small Tor network, uses the `arti` client to perform some transfers across this +simulated network, and validates that the transfers succeeded. + +## Running locally + +To run locally, you'll need to install shadow itself somewhere on our `PATH`, +following [shadow's installation +instructions](https://shadow.github.io/docs/guide/supported_platforms.html). + +Next you'll need to install executables that will run inside the simulation, in the +locations where [`shadow.yaml`](./shadow.yaml) expects to find them. + +* Install [`tgen`](https://github.com/shadow/tgen/) in `~/.local`. + +* Install [`tor`](https://gitlab.torproject.org/tpo/core/tor) in `/usr/sbin`. + Typically you can install it using your host system's package manager. + +* Build the `arti` client for target `x86_64-unknown-linux-gnu`, so that the + binary is at: `../../target/x86_64-unknown-linux-gnu/debug/arti`. + +Once those are installed, you can invoke the [`run.sh`](./run.sh) script from +this directory. diff --git a/tests/shadow/conf/authgen.pw b/tests/shadow/conf/authgen.pw new file mode 100644 index 000000000..65ee896a0 --- /dev/null +++ b/tests/shadow/conf/authgen.pw @@ -0,0 +1,2 @@ +shadowprivatenetwork + diff --git a/tests/shadow/conf/authgen.torrc b/tests/shadow/conf/authgen.torrc new file mode 100644 index 000000000..a23c8bf72 --- /dev/null +++ b/tests/shadow/conf/authgen.torrc @@ -0,0 +1,3 @@ +DirServer test 127.0.0.1:5000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 +ORPort 5000 + diff --git a/tests/shadow/conf/shadowresolv.conf b/tests/shadow/conf/shadowresolv.conf new file mode 100644 index 000000000..bbc8559cd --- /dev/null +++ b/tests/shadow/conf/shadowresolv.conf @@ -0,0 +1 @@ +nameserver 127.0.0.1 diff --git a/tests/shadow/conf/tgen.client.graphml.xml b/tests/shadow/conf/tgen.client.graphml.xml new file mode 100644 index 000000000..61dbc2cb3 --- /dev/null +++ b/tests/shadow/conf/tgen.client.graphml.xml @@ -0,0 +1,27 @@ + + + + + + + + + fileserver:80 + + + 1 MiB + 1 KiB + + + 1,2,3,4,5,6,7,8,9,10 + + + 10 + 3600 + + + + + + + diff --git a/tests/shadow/conf/tgen.server.graphml.xml b/tests/shadow/conf/tgen.server.graphml.xml new file mode 100644 index 000000000..49758d6d2 --- /dev/null +++ b/tests/shadow/conf/tgen.server.graphml.xml @@ -0,0 +1,8 @@ + + + + + 80 + + + diff --git a/tests/shadow/conf/tgen.torclient.graphml.xml b/tests/shadow/conf/tgen.torclient.graphml.xml new file mode 100644 index 000000000..2cd646d18 --- /dev/null +++ b/tests/shadow/conf/tgen.torclient.graphml.xml @@ -0,0 +1,29 @@ + + + + + + + + + + fileserver:80 + localhost:9000 + + + 1 MiB + 1 KiB + + + 1,2,3,4,5,6,7,8,9,10 + + + 10 + 3600 + + + + + + + diff --git a/tests/shadow/conf/tor.authority.torrc b/tests/shadow/conf/tor.authority.torrc new file mode 100644 index 000000000..48095a1d6 --- /dev/null +++ b/tests/shadow/conf/tor.authority.torrc @@ -0,0 +1,8 @@ +AuthoritativeDirectory 1 +V3AuthoritativeDirectory 1 +V3BandwidthsFile ../torflowauthority/v3bw +ExitPolicy "reject *:*" +TestingDirAuthVoteGuard 3FB0BD7827C760FE7F9DD810FCB10322D63AB4CF,FF197204099FA0E507FA46D41FED97D3337B4BAA +TestingDirAuthVoteExit 4EBB385C80A2CA5D671E16F1C722FBFB5F176891,0A9B1B207FD13A6F117F95CAFA358EEE2234F19A +TestingDirAuthVoteGuardIsStrict 1 +TestingDirAuthVoteExitIsStrict 1 diff --git a/tests/shadow/conf/tor.common.torrc b/tests/shadow/conf/tor.common.torrc new file mode 100644 index 000000000..ac6881b8c --- /dev/null +++ b/tests/shadow/conf/tor.common.torrc @@ -0,0 +1,26 @@ +DataDirectory . +BandwidthRate 1024000 +BandwidthBurst 1024000 +DirServer 4uthority bridge v3ident=604ED7BE52100945A47EAD301D45FADF493C6371 orport=9111 100.0.0.1:9112 A52C A5B5 6C64 D864 F6AE 43E5 6F29 ACBD 5706 DDA1 +TestingTorNetwork 1 +ServerDNSResolvConfFile ../../../conf/shadowresolv.conf +ServerDNSTestAddresses 4uthority +ServerDNSAllowBrokenConfig 1 +ServerDNSDetectHijacking 0 +AssumeReachable 1 +AuthDirTestReachability 0 +NumCPUs 1 +Log info stdout +LogTimeGranularity 1 +HeartbeatPeriod 1 +SafeLogging 0 +ContactInfo https://github.com/shadow/shadow-plugin-tor/issues +DisableDebuggerAttachment 0 +PathBiasUseThreshold 10000 +PathBiasCircThreshold 10000 +DoSCircuitCreationEnabled 0 +DoSConnectionEnabled 0 +DoSRefuseSingleHopClientRendezvous 0 +CircuitPriorityHalflife 30 +ControlPort 9051 +LearnCircuitBuildTimeout 0 diff --git a/tests/shadow/conf/tor.exit.torrc b/tests/shadow/conf/tor.exit.torrc new file mode 100644 index 000000000..bd3d33eab --- /dev/null +++ b/tests/shadow/conf/tor.exit.torrc @@ -0,0 +1 @@ +ExitPolicy "accept *:*" diff --git a/tests/shadow/conf/tor.non-exit.torrc b/tests/shadow/conf/tor.non-exit.torrc new file mode 100644 index 000000000..89de84871 --- /dev/null +++ b/tests/shadow/conf/tor.non-exit.torrc @@ -0,0 +1 @@ +ExitPolicy "reject *:*" diff --git a/tests/shadow/conf/tor.relay.torrc b/tests/shadow/conf/tor.relay.torrc new file mode 100644 index 000000000..006e477f1 --- /dev/null +++ b/tests/shadow/conf/tor.relay.torrc @@ -0,0 +1,3 @@ +ORPort 9111 IPv4Only +DirPort 9112 +SocksPort 0 diff --git a/tests/shadow/run.sh b/tests/shadow/run.sh new file mode 100755 index 000000000..25fa65e1e --- /dev/null +++ b/tests/shadow/run.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +set -euo pipefail + +# Remove output of previous run +rm -rf shadow.data + +# Run the simulation +shadow \ + --model-unblocked-syscall-latency=true \ + --log-level=debug \ + --strace-logging-mode=standard \ + --parallelism="$(nproc)" \ + --template-directory=./shadow.data.template \ + --progress=true \ + shadow.yaml \ + > shadow.log + +# Check whether file transfers via arti inside the simulation succeeded +successes="$(grep -c stream-success shadow.data/hosts/articlient/articlient.tgen.1001.stdout || true)" +if [ "$successes" = 10 ] +then + echo "Passed" + exit 0 +else + echo "Failed. Only got $successes successful streams." +fi diff --git a/tests/shadow/shadow.data.template/hosts/4uthority/fingerprint b/tests/shadow/shadow.data.template/hosts/4uthority/fingerprint new file mode 100644 index 000000000..ae347c47b --- /dev/null +++ b/tests/shadow/shadow.data.template/hosts/4uthority/fingerprint @@ -0,0 +1 @@ +Unnamed A52CA5B56C64D864F6AE43E56F29ACBD5706DDA1 diff --git a/tests/shadow/shadow.data.template/hosts/4uthority/fingerprint-ed25519 b/tests/shadow/shadow.data.template/hosts/4uthority/fingerprint-ed25519 new file mode 100644 index 000000000..e185e29e0 --- /dev/null +++ b/tests/shadow/shadow.data.template/hosts/4uthority/fingerprint-ed25519 @@ -0,0 +1 @@ +Unnamed 4ngwAxQ6Zw2VJB241CenzfrVtT6omCDOf9yGB1XAqTs diff --git a/tests/shadow/shadow.data.template/hosts/4uthority/keys/authority_certificate b/tests/shadow/shadow.data.template/hosts/4uthority/keys/authority_certificate new file mode 100644 index 000000000..a70eaae88 --- /dev/null +++ b/tests/shadow/shadow.data.template/hosts/4uthority/keys/authority_certificate @@ -0,0 +1,45 @@ +dir-key-certificate-version 3 +fingerprint 604ED7BE52100945A47EAD301D45FADF493C6371 +dir-key-published 1999-12-01 06:00:01 +dir-key-expires 2000-12-01 06:00:01 +dir-identity-key +-----BEGIN RSA PUBLIC KEY----- +MIIBigKCAYEA1hnDm6FHOh7Us4jtlQTZ3hWhGqrG9MO51me1NSyia4MtagzuWYHX +2uwjxAnc4mDa8uzUWumhXfMuqq1iOQNDwLC2pavhvJ0bSsKM12t1cXz5bH2ugnnR +QlUA2jxISl8h9PkKj06t3qfG+5NY9y1Tl7cF+EcDKKhnUDn9BzV8XeqXPSZQDvrp +1sHafEp0DxlqKAiQgWmc8OX8NdvefjBTZXLdN/N9F7r7YIXi7KZUxocbHK5nxF5b +JuARLHxSNY4Kqec9Gsoaw1/CK1nF9yVYZQoTNysIv90H3Bi+KcN+U9Pvg2L0rVRp +7jkc69rgVXLSxtDeNKWr4hOfUltm7QZ9Drer8CQfEsCcqBxSHGA9LcEClT25u0Lu +1JJFHdl33t1VAhMCgOvDrrYXFXvDeuvoRRsvAkvNiqpKvOMkXRyKGbSbs2P1R5fy +EpxTMI09SRflYF191+WZW+hx9SBMjpTg7pbe8tmAGYKv6FOBjYqGhP6eBDVFO8uL +mh7X26tG92ljAgMBAAE= +-----END RSA PUBLIC KEY----- +dir-signing-key +-----BEGIN RSA PUBLIC KEY----- +MIIBCgKCAQEA8IsYZv91wS+wOd/J3U+BvPRg+hagYo+fEhKCY1ysnd9a8ImnxkUu +ERJp5iFNDNHklbm7PE/0n/qYbYp052nMCannDSOiYRZwuLd44iXN5YmwyZ1ScTB2 +r63pvLNtqH3o9Kch9DsKDykJp4AVBM1ZHm+Pzpm6ybMcV8dSKGerHlzle99VbPjw +kS/mtEgn1kMKQm7CesvrPfXPYyCGia+Lp0jiK5hXN2Fg9eNv/GAls2DvcFJgI0Kh +vIQW2GSu/+vVLJ87ijC923Xp5UOEAdgLnYOnoZhCanc5N9ozUO0svDq4Q5gh4P3D +uuXPLmi5exVYJFVFmMeR0Xn0ILKQ0fcIWwIDAQAB +-----END RSA PUBLIC KEY----- +dir-key-crosscert +-----BEGIN ID SIGNATURE----- +vphTtO7NyzkkL2BnDde25TNdLk9a56zZkp2I01nhSps6K0Gr1iHJCng/q99fE4Dw +VlYTePO7MVvXivlQR6HjYtRQJwi6f4rl4E8vlA9c5J31M2tZs9Faih2e1GzgmlZd +pInz8PgpXcyo20qjUTTjxsdtSO7niwdvfjsc14hQTjzVSqCgzM0D0xmmMLjoZa3Z +2SudSDdJTQ5Y70PH9ItdrgUQcczb/6kQ2Xkhk7Mbm0OtTK++cbFbKB3lMvK7H8TE +Uxkr2FwDPfD8+2xzDbd0tTBqRWKNEtWD9dtnj/TDW/rVP0qtITAvVTp5x/QQeZYn +2A888gOchsXEnDRKScssOg== +-----END ID SIGNATURE----- +dir-key-certification +-----BEGIN SIGNATURE----- +B0/mXB9KI2FSka2EHCk+dB7L60b3XAAejq08LL71qlvENrreGr6OAAU38GzAoNg0 +OBEs8oCgIXQ1rf+ZOVhNxEBJNXw9GBQsCJ+udoqkEw4ZtvFv4L9uo5BZR07KqENM +xICcpghTm2Xw/Ttc89OXz44cSHzufmgu8hId1nyVtEuBu097vlPDhSZeboMQhP86 +J6gDf/exf2/Rml8ahRJt1ywq/KlvHlI69TTpcQf/mf6yyNevrtrwxMLylEn4keZF +m8ikTTHUhkvxHEWE6PuQpjmbOXeu6rpLBr0lD/jrwMxusY1nMptg+V6qKbmpHfti +TZpdEe4BB+myMQywblPY1JJS0REybBm9VllsEOUToLw21QWyDcqwTYTbC27xyhb6 +fj2vq4CC3+sbrA2ns4fsD6uUK779YQcZBtEE0GUIOqB/L22trrVb499aFlmwk317 +LGyp0gb9Evc2hHz9vcJzF0kIcNpptbcboYLD6QAjNA2xbI0RtTrRqyCvJbo15ncc +-----END SIGNATURE----- diff --git a/tests/shadow/shadow.data.template/hosts/4uthority/keys/authority_identity_key b/tests/shadow/shadow.data.template/hosts/4uthority/keys/authority_identity_key new file mode 100644 index 000000000..ec08b804d --- /dev/null +++ b/tests/shadow/shadow.data.template/hosts/4uthority/keys/authority_identity_key @@ -0,0 +1,41 @@ +-----BEGIN ENCRYPTED PRIVATE KEY----- +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 +hs9OaMibpgVvS/a0rXY= +-----END ENCRYPTED PRIVATE KEY----- diff --git a/tests/shadow/shadow.data.template/hosts/4uthority/keys/authority_signing_key b/tests/shadow/shadow.data.template/hosts/4uthority/keys/authority_signing_key new file mode 100644 index 000000000..aa9fd9ac1 --- /dev/null +++ b/tests/shadow/shadow.data.template/hosts/4uthority/keys/authority_signing_key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEA8IsYZv91wS+wOd/J3U+BvPRg+hagYo+fEhKCY1ysnd9a8Imn +xkUuERJp5iFNDNHklbm7PE/0n/qYbYp052nMCannDSOiYRZwuLd44iXN5YmwyZ1S +cTB2r63pvLNtqH3o9Kch9DsKDykJp4AVBM1ZHm+Pzpm6ybMcV8dSKGerHlzle99V +bPjwkS/mtEgn1kMKQm7CesvrPfXPYyCGia+Lp0jiK5hXN2Fg9eNv/GAls2DvcFJg +I0KhvIQW2GSu/+vVLJ87ijC923Xp5UOEAdgLnYOnoZhCanc5N9ozUO0svDq4Q5gh +4P3DuuXPLmi5exVYJFVFmMeR0Xn0ILKQ0fcIWwIDAQABAoIBAEFH3pWFWvXU9WSf +gW9YdoNLZ043+csF40vKTiydKBOoXEvPcAL1H21uq+LSwtBp3jlsMI5LvL32Cowf ++V4cbk1pGNWOCDGFH45h7KKjU9+poJr24Trqxisjbb3SjD4f/ar3+NUJeM9oecBF +mG63NCp4aHTPb8vxmg2QgJGKoPwZ/0RU/lY+ic1VukzY+SNODFvs8MvaOiaxE5KJ +Zc6V057IoELV9j0KJvPNp23MyczI4LYrJrAbD6u34+FX0smCs2pgn8YVdHm88JR+ +yXe9rZmUCTE7uCEBjZrYzGbdY9gRD54ZmyckZ4Amyhn0DjTVA2dQWzTCSzr4q2a9 +goydQiECgYEA/9SrHWfV85D6/hspTCCs4bvPc36o33ed1EaXyWANoxZ/UsDc606u +ayN6N6OmrjdQLiJTdq6cF/c4zA7Qea44yqgp4fMLAEa2s//oBB9VFiSmj59WDmPr +BzPaQ/aq0QwjF6KhGmGuKAySILH2FOE9wGexR5KnApD6uZXeVipVR6kCgYEA8LPW +bBPOJzuSU55mImBrIIYHIbiH8Xq0ENJ7Fs37HY2WpnuZEEQ8L73KgFmVv4s57WQM +XyzU1JN4fjYjRrdEJDVaHZa6CqA2YgFY4WgQtskRj5II9KfYEXsc/dZN1Xae/KwA +Xe7WQ1OdqOQMgWks06MjmJ8FPb0WUxsYQyUlAmMCgYEA0/dE/8w0vOX2z+t5QBYi +p7WQoMTk7qKRJnyG7tai9emB/PLHGD/MzABNFySEyfwSducB+Geb9U9kw83Sdb8g +VukWKpvRFZ2Ba4owlpnPSdV8G6uNBcdLyF/yDDWoOiSwPrkEenNMdOpVeLl6hrpJ +C83eWMrtjXbKBlJiMUpJ9mECgYAYuaBxAafPh+MEC+VZ6qWWda4N3LK6L2yHvdc/ +BHGjG4Q6HcAfV6MHFGvUu18Sie6tX/WVYTmLjIp4DH+bKAAr5/8VwwHhTYvIjXLf +1JzC6eyP3uRknUkooojb2kOshb7XHaP8AiioSdKMIsDWGkOsibmCV/Nl4CKG7uWT +ICGpGQKBgQCLNaMtwQJmCW2QJSmzVeau9j+fZ/rV5SyImhL6GbWVD2uYXhBFQVWR +pS6w2d5HbzngLzLKqmZyrM9zYYwKLjYvVuf4atIwHNnj0sEAVeX7raE5Svdfpmvh +QVfxLkPh9hfxcNVp0wm0loTR4nH/7DUQYtO6yutMqAXPBfTXBDj65Q== +-----END RSA PRIVATE KEY----- diff --git a/tests/shadow/shadow.data.template/hosts/4uthority/keys/ed25519_master_id_public_key b/tests/shadow/shadow.data.template/hosts/4uthority/keys/ed25519_master_id_public_key new file mode 100644 index 0000000000000000000000000000000000000000..faf1c8fbcb7c55bd73cd81e4781d452915dbddb2 GIT binary patch literal 64 zcmV-G0Kfk|Js@RdGBq_ZId(BEaCKsAX=6Gdba`-PFd#iW0002ucrXJLI%f@)BptZa WC#TK&)wMpTm>|x7+=d5Lz^OZupclXZ literal 0 HcmV?d00001 diff --git a/tests/shadow/shadow.data.template/hosts/4uthority/keys/ed25519_master_id_secret_key b/tests/shadow/shadow.data.template/hosts/4uthority/keys/ed25519_master_id_secret_key new file mode 100644 index 0000000000000000000000000000000000000000..4417e6490a610684f21252555ee9a8b1adaebf9b GIT binary patch literal 96 zcmV-m0H6OoJs@RdGBq_ZId(BEb7f<4Wpp|qba`-PFd#iW0001>+sqd%8JD4^EHl$H zEixF9%n9q#1^TaG3o8;7z;sS|x7+=d5Lz^OYdC*YS=K>01OHQ9XZy;=UAW=hkcGlv#n+>$WN-BX>;u}NKPA6?Gqh63&&$luQ?RvVKmd>B!M)XXchd6SoN^2~ukLeQyW@JJ&~=S8 u=Jh5MnXbj^c?quAsT(w3$n(I&hsoZr9*3Vf*C0A=?ryIGQ;OcMGqh63&&$luQ?RvVK!6h-t4r5hZt)Hi7N0R8uzJlWX_-4^A3QQc uHk{tFitB*yfjR7tpRjE!SaRk;=!=Ns|8AQ_UjK4j;JLlX0fw8#_hbPp+$YTd literal 0 HcmV?d00001 diff --git a/tests/shadow/shadow.data.template/hosts/exit2/torrc b/tests/shadow/shadow.data.template/hosts/exit2/torrc new file mode 100644 index 000000000..e69de29bb diff --git a/tests/shadow/shadow.data.template/hosts/exit2/torrc-defaults b/tests/shadow/shadow.data.template/hosts/exit2/torrc-defaults new file mode 100644 index 000000000..446d5ee96 --- /dev/null +++ b/tests/shadow/shadow.data.template/hosts/exit2/torrc-defaults @@ -0,0 +1,3 @@ +%include ../../../conf/tor.common.torrc +%include ../../../conf/tor.relay.torrc +%include ../../../conf/tor.exit.torrc diff --git a/tests/shadow/shadow.data.template/hosts/relay1/fingerprint b/tests/shadow/shadow.data.template/hosts/relay1/fingerprint new file mode 100644 index 000000000..927f49add --- /dev/null +++ b/tests/shadow/shadow.data.template/hosts/relay1/fingerprint @@ -0,0 +1 @@ +relay1 3FB0BD7827C760FE7F9DD810FCB10322D63AB4CF diff --git a/tests/shadow/shadow.data.template/hosts/relay1/keys/secret_id_key b/tests/shadow/shadow.data.template/hosts/relay1/keys/secret_id_key new file mode 100644 index 000000000..7058d22f6 --- /dev/null +++ b/tests/shadow/shadow.data.template/hosts/relay1/keys/secret_id_key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQDLQVnBp+spwAZE/YvTDSF567CIsdSZC1VhYQNV5qIs8j42qDYZ +TdtgGFcKqBNesB/CyDX3vepszZgGKPw0SnxzxrZcJyi093QOpc/aWgacptEpXawK +wXZp0hw+RObh/7QSJ5X72p6c+7lMFb8HGdbxmZHXtced4V1+RNQsjWzuJwIDAQAB +AoGBAJg9mr0yyTG8YvXJ87FhZHGt18yLZnI7yvflclolJdQEnhTSabMKXgbcNFYH +Dnsd8Kw0yjeGSNC2LehvSnjgUdYOhKPrz3QcejnUVWg1bXMx2EsoSqjRFWymEMis +fPATXM/FvbJcHSDP62ht6UL/Xpxi8SePZtJ/m9L2j0bwKTIBAkEA/kpBHgAygVAv +wjc2NMP1OpSkjiS5LjofFFFTbeV+pkpOEzJ9htB7Aw/W0BfIMSAe8+xAQd/Q1xIQ +RK5McVBAfQJBAMyfPimZfY9Dy8nREOW7RCFpl9UWv+hbAqvIVlPOLDFLNbbdBrQu +8QGcJbQJyTX5GRBhyC4SriIVmKCDAn2nrnMCQQCprjzDWxhYZ3xm2VanYPb7DwK7 +AtA6g3gHo7jLBS88oSp17uQKGIVs5p3Nn4DrHubolwXNrx541MncOn4xwn41AkA/ +MnuPe5F0+vpo1YJDgcf0DdnP/Vu+FsXHanOHJKkvfEwVs0QLyGe1GJXoehFD8zBT +h++8kxZm/oaKJIxTZMOTAkBnP7ZSRNtgtBLCLwh5JpGh+oiP++Hx3biJ2HRVo5+E +6oW5BcytArbD9myZxqjwi6OjIMi5YC1QjYRPNQMd/oPu +-----END RSA PRIVATE KEY----- diff --git a/tests/shadow/shadow.data.template/hosts/relay1/keys/secret_onion_key b/tests/shadow/shadow.data.template/hosts/relay1/keys/secret_onion_key new file mode 100644 index 000000000..1c755bb83 --- /dev/null +++ b/tests/shadow/shadow.data.template/hosts/relay1/keys/secret_onion_key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXAIBAAKBgQC3tDxczkSWWMxfJiJ6HchqZ+ZX/aSJX2jT/sXsLCa2TeTtnSOw +Ss7XSzfo4fEuW0u7Mw2YGwyoze7x5G9XRuY9a8FbC70vQryhO5U6huI0W/MYI7og +mp8jeISFVH8xP5Y12rM74OZfyGHKSxvNTEai/CzxY01PYvRuujpXfMRA/QIDAQAB +AoGAfL3gt0xBeq41qO6mPrH2o3qGCX3sunOVJU89as/YQbbHGyq3T0CdD8i94F98 +fHP2CtnyAzVq9T1RYeQyTtuP/0GccvNJzx/3hr6pXfsemVpLniP3xWU+qw43FHTr +4qJ9e506xwrdD4FKNJxzaopXErD3fEA5WRWQcoY3FPtRIIECQQDr2t4mzIPhLZzp +TRKnR7FObxAwNT+EaWo4z1Ekn7MrJ2GA8QiyK8NOKKrCLNQ1agsMZ/Ma5Vyjbvkx +0iPb1bOtAkEAx2UNYHo+vV2ZL1E04gceC1vUaSjC9ec2CiOpFC2jQCnDhqwY2XPa +TcfVQRKNdeJxlA+zTkalG0ESgS8hJi7skQJALOF2Op3aTqQ2YrLW5NwgolNCGlpX +nuPMYckZoMV++6w/wqCbTgRD4wCcFd0f+JYYSiERwsF4kmUQqGlbh36v9QJBAK+L +deV0env5RX30/pvoLDlP1YfnjQ01S8xNbPQI4esBWdTc+tunNZC42DT8AnLAs8Ho +uLG3XHDML2Bwf7zAHyECQFsW7NKELTuN1jYOgbBGrScsylb6F7R9PD7Jx5emxJYP +aH+fQOhqeiUsFpEiJGA+nNaYA8M3OIPUjPOLo07+rEk= +-----END RSA PRIVATE KEY----- diff --git a/tests/shadow/shadow.data.template/hosts/relay1/keys/secret_onion_key_ntor b/tests/shadow/shadow.data.template/hosts/relay1/keys/secret_onion_key_ntor new file mode 100644 index 0000000000000000000000000000000000000000..b837a62f0836cb4256863bcb35fbd72b8e75bfe6 GIT binary patch literal 96 zcmcDuRY*26H8r#>Gqh63&&$luQ?RvVK!5|?Y^n?2cv^;te`*sx8Mx_!^NZ3|Y0@ix uPBPx~?oeu-#P5@)79Y28oGjh`b4UHNmq)f3m1Gqh63&&$luQ?RvVK!6U%BAGR>eK_~56{_py_mVc*xtL|rGntG1 ui(baBogJUVve9JQN&irhug}uIna+!CPYM4~X%sGW_VC>ob$<&l#sL7Zg(biM literal 0 HcmV?d00001 diff --git a/tests/shadow/shadow.data.template/hosts/relay2/torrc b/tests/shadow/shadow.data.template/hosts/relay2/torrc new file mode 100644 index 000000000..e69de29bb diff --git a/tests/shadow/shadow.data.template/hosts/relay2/torrc-defaults b/tests/shadow/shadow.data.template/hosts/relay2/torrc-defaults new file mode 100644 index 000000000..b398ffc70 --- /dev/null +++ b/tests/shadow/shadow.data.template/hosts/relay2/torrc-defaults @@ -0,0 +1,3 @@ +%include ../../../conf/tor.common.torrc +%include ../../../conf/tor.relay.torrc +%include ../../../conf/tor.non-exit.torrc diff --git a/tests/shadow/shadow.yaml b/tests/shadow/shadow.yaml new file mode 100644 index 000000000..71d753f82 --- /dev/null +++ b/tests/shadow/shadow.yaml @@ -0,0 +1,81 @@ +general: + # FIXME: this is currently set carefully to just after transfers are expected + # to finish, but before arti spends a lot of time spinning CPU waiting for + # circuits to time out. Should diagnose and fix the spin. + stop_time: 27 min +network: + graph: + type: gml + inline: | + graph [ + directed 0 + node [ + id 0 + host_bandwidth_down "1 Gbit" + host_bandwidth_up "1 Gbit" + ] + edge [ + source 0 + target 0 + latency "50 ms" + jitter "0 ms" + packet_loss 0.0 + ] + ] +hosts: + fileserver: + network_node_id: 0 + processes: + - path: ~/.local/bin/tgen + environment: OPENBLAS_NUM_THREADS=1 + args: ../../../conf/tgen.server.graphml.xml + start_time: 1 + 4uthority: + network_node_id: 0 + ip_addr: 100.0.0.1 + processes: + - path: /usr/sbin/tor + args: --Address 4uthority --Nickname 4uthority + --defaults-torrc torrc-defaults -f torrc + start_time: 1 + exit1: + network_node_id: 0 + processes: + - path: /usr/sbin/tor + args: --Address exit1 --Nickname exit1 + --defaults-torrc torrc-defaults -f torrc + start_time: 60 + exit2: + network_node_id: 0 + processes: + - path: /usr/sbin/tor + args: --Address exit2 --Nickname exit2 + --defaults-torrc torrc-defaults -f torrc + start_time: 60 + relay1: + network_node_id: 0 + processes: + - path: /usr/sbin/tor + args: --Address relay1 --Nickname relay1 + --defaults-torrc torrc-defaults -f torrc + start_time: 60 + relay2: + network_node_id: 0 + processes: + - path: /usr/sbin/tor + args: --Address relay2 --Nickname relay2 + --defaults-torrc torrc-defaults -f torrc + start_time: 60 + articlient: + network_node_id: 0 + options: + log_level: trace + processes: + - path: ../../target/x86_64-unknown-linux-gnu/debug/arti + args: proxy -c arti.toml -o proxy.socks_port=9000 --disable-fs-permission-checks -l debug,tor_proto=trace + environment: RUST_BACKTRACE=1;HOME=./home + start_time: 15m + - path: ~/.local/bin/tgen + environment: OPENBLAS_NUM_THREADS=1 + args: ../../../conf/tgen.torclient.graphml.xml + start_time: 25m