forked from aarani/NOnion
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests: introduce HS compat test with TOR client
This commit introduces a test to make sure our hidden service hosts are accessible by official tor client. Testing only with NOnion's TorServiceClient can cause mask problems because it shares lots of code with TorServiceHost (especially crypto stuff) and mistakes there can go unnoticed. Upgrade to .NET 6 was necessary to be able to use SocksV5 (which is what tor gives us) as proxy for HttpClient. Due to some problem with NUnit not writing test-by-test output (whether it passed or failed), I had to upgrade even furthur into .NET 7. NUnit was also updated to latest version because it was causing issue where some unrelated tests would fail in .NET7 (maybe the Retry attributed wasn't working).
- Loading branch information
Showing
3 changed files
with
98 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,20 +6,36 @@ jobs: | |
build_and_test: | ||
name: Build & Test | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- dotnet_version: "3.1.x" | ||
flag: "" | ||
- dotnet_version: "7.0.x" | ||
flag: "-p:NET7=true" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- name: Setup .NET Core SDK 3.1.x | ||
- name: Setup .NET SDK ${{ matrix.dotnet_version }} | ||
uses: actions/[email protected] | ||
with: | ||
dotnet-version: '3.1.x' | ||
dotnet-version: ${{ matrix.dotnet_version }} | ||
- name: Install dependencies | ||
run: dotnet restore | ||
run: dotnet restore ${{ matrix.flag }} | ||
- name: Build | ||
run: dotnet build --configuration Release --no-restore | ||
run: dotnet build --configuration Release --no-restore ${{ matrix.flag }} | ||
# Please keep in mind that NOnion DOES NOT require tor client to function | ||
# tor client is only installed here for testing purposes. | ||
- name: Install Tor and wait for startup | ||
run: | | ||
sudo apt install tor | ||
echo -e "SOCKSPort 127.0.0.1:9050" | sudo tee -a /etc/tor/torrc | ||
sudo systemctl restart tor | ||
sleep 2m | ||
- name: Test | ||
run: dotnet test --no-restore --verbosity normal | ||
run: dotnet test --no-restore --verbosity normal ${{ matrix.flag }} | ||
|
||
sanity_check: | ||
name: Sanity Check | ||
|
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