This commit is contained in:
Eugene Pankov 2022-11-04 20:35:09 +01:00
parent bfa2d262f3
commit e75fe93d8e
No known key found for this signature in database
GPG key ID: 5896FCBBDD1CF4F4
2 changed files with 33 additions and 33 deletions

View file

@ -43,7 +43,7 @@ jobs:
- name: Run - name: Run
working-directory: tests working-directory: tests
run: | run: |
TIMEOUT=120 poetry run ./run.sh TIMEOUT=120 poetry run ./run.sh test_ssh_proto.py::Test::test_direct_tcpip|cat
cargo llvm-cov --no-run --hide-instantiations --lcov > coverage.lcov cargo llvm-cov --no-run --hide-instantiations --lcov > coverage.lcov
- name: SonarCloud Scan - name: SonarCloud Scan

View file

@ -114,40 +114,40 @@ class Test:
assert ssh_client.returncode != 0 assert ssh_client.returncode != 0
# def test_direct_tcpip( def test_direct_tcpip(
# self, self,
# processes: ProcessManager, processes: ProcessManager,
# wg_port, wg_port,
# timeout, timeout,
# ): ):
# local_port = alloc_port() local_port = alloc_port()
# wait_port(wg_port) wait_port(wg_port)
# ssh_client = processes.start_ssh_client( ssh_client = processes.start_ssh_client(
# '-p', '-p',
# str(wg_port), str(wg_port),
# '-v', '-v',
# *common_args, *common_args,
# '-L', f'{local_port}:neverssl.com:80', '-L', f'{local_port}:neverssl.com:80',
# '-N', '-N',
# password='123', password='123',
# ) )
# wait_port(local_port, recv=False) wait_port(local_port, recv=False)
# for _ in range(15): for _ in range(15):
# time.sleep(1) time.sleep(1)
# try: try:
# response = requests.get(f'http://localhost:{local_port}', timeout=timeout) response = requests.get(f'http://localhost:{local_port}', timeout=timeout)
# except Exception: except Exception:
# continue continue
# if response.status_code == 200: if response.status_code == 200:
# break break
# s = requests.Session() s = requests.Session()
# retries = requests.adapters.Retry(total=5, backoff_factor=1) retries = requests.adapters.Retry(total=5, backoff_factor=1)
# s.mount('http://', requests.adapters.HTTPAdapter(max_retries=retries)) s.mount('http://', requests.adapters.HTTPAdapter(max_retries=retries))
# response = s.get(f'http://localhost:{local_port}', timeout=timeout) response = s.get(f'http://localhost:{local_port}', timeout=timeout)
# assert response.status_code == 200 assert response.status_code == 200
# ssh_client.kill() ssh_client.kill()
def test_tcpip_forward( def test_tcpip_forward(
self, self,