mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2026-09-05 02:24:21 -05:00
* Add Windows CI * rebuild workflows * rebuild workflows * try different activation * catch up windows workflow template * debug dir * hard code dev extra on windows * it is pytest * .exe * -m pytest for windows * --module pytest * Revert "debug dir" This reverts commit74b5bbfd92. * debug pkg_resources import on windows * debug tests.conftest import on windows * rebuild workflows * debug * debug oops * debug more * debug more * Update pytest.ini * Update pytest.ini * fix it * Revert "debug more" This reverts commit367ed61dfa. * Revert "debug more" This reverts commit772b6707c6. * Revert "debug oops" This reverts commit5065c1e172. * Revert "debug" This reverts commitecf721e453. * Revert "debug tests.conftest import on windows" This reverts commitea71a51625. * Revert "debug pkg_resources import on windows" This reverts commiteb6afb1dfb. * more warning ignore * they're regexes... * --numprocesses 0 for windows ci * specify each test file individually since pytest on windows does not seem to handle the wildcards * relative... * select most recent supported python on windows, support INSTALL_PYTHON_VERSION * sort test files when generating workflows * report full python version on windows, actually use the selected version for the env * oops * debug dir * skip timelord-requiring jobs on windows * oops * handle wildcard expansion for coverage on windows * rebuild workflows * download blocks and plots on windows * correct and and or in yaml * -d for Install.ps1 * git config --global core.autocrlf false * add missing windows plot_sync workflow * no check resource usage on windows * delete outdated windows workflows that need the timelord * catch up windows workflow template * try again without xdist * rebuild workflows * Revert "try again without xdist" This reverts commit4bedf5f047. * maybe now no xdist on windows * maybe now no xdist on windows * rebuild workflows * debug chiapos==1.0.9 * Revert "debug chiapos==1.0.9" This reverts commit4b374e128a. * debug blspy==1.0.9 * catch up windows workflow template * rebuild workflows * Various windows CI fixes * Windows CI fixes and workflow updates * ignore another warning for the keyring * pre-commit fixup * rebuild workflows * catchup windows test workflows with long_lived/** and release/** setup * Update test_full_sync.py * Try without parallelization * Some other tweaks for windows * some more timeout tweaks * more timeout tweaks for windows * rebuild workflows * Adjusting more timeouts * Skip ipv6 test on windows * More timeout tweaks * More timeout adjustments * More time out adjustments * more windows tweaks * Try running some things with -n 0 * Fix up windows test template and re-gen workflows * Try this again * Try all windows tests with -n 0 * misc update * Undo some timeout changes * Adjust timeout * Increase timeout * Coverage combine should combine the files in the current directory * Trying retry test on windows * timeout adjustment * use tmp_path * Few minor updates based on review * lint fix * Update tests/build-workflows.py * Update tests/core/server/test_dos.py * Try windows with pytest xdist n=2 * Check windows with xdist n=3 * Trying n=2 again * Adjust timeout * Update testconfig.py * Update build-workflows.py * Update testconfig.py * Update .pre-commit-config.yaml * Update testconfig.py * Update build-workflows.py * Update build-test-macos * Update build-test-ubuntu * Update build-test-windows * skip * Apply suggestions from code review * tidy * Update test_pool_config.py Co-authored-by: Earle Lowe <e.lowe@chia.net> Co-authored-by: Earle Lowe <30607889+emlowe@users.noreply.github.com>
33 lines
1.4 KiB
Python
33 lines
1.4 KiB
Python
import os
|
|
import sys
|
|
|
|
import pytest
|
|
from chia.util.network import get_host_addr
|
|
|
|
|
|
class TestNetwork:
|
|
@pytest.mark.asyncio
|
|
async def test_get_host_addr4(self):
|
|
# Run these tests forcing IPv4 resolution
|
|
prefer_ipv6 = False
|
|
assert get_host_addr("127.0.0.1", prefer_ipv6) == "127.0.0.1"
|
|
assert get_host_addr("10.11.12.13", prefer_ipv6) == "10.11.12.13"
|
|
assert get_host_addr("localhost", prefer_ipv6) == "127.0.0.1"
|
|
assert get_host_addr("example.net", prefer_ipv6) == "93.184.216.34"
|
|
|
|
@pytest.mark.asyncio
|
|
@pytest.mark.skipif(
|
|
condition=("GITHUB_ACTIONS" in os.environ) and (sys.platform in {"darwin", "win32"}),
|
|
reason="macOS and Windows runners in GitHub Actions do not seem to support IPv6",
|
|
)
|
|
async def test_get_host_addr6(self):
|
|
# Run these tests forcing IPv6 resolution
|
|
prefer_ipv6 = True
|
|
assert get_host_addr("::1", prefer_ipv6) == "::1"
|
|
assert get_host_addr("2000:1000::1234:abcd", prefer_ipv6) == "2000:1000::1234:abcd"
|
|
# ip6-localhost is not always available, and localhost is IPv4 only
|
|
# on some systems. Just test neither here.
|
|
# assert get_host_addr("ip6-localhost", prefer_ipv6) == "::1"
|
|
# assert get_host_addr("localhost", prefer_ipv6) == "::1"
|
|
assert get_host_addr("example.net", prefer_ipv6) == "2606:2800:220:1:248:1893:25c8:1946"
|