From 64c31798a3c6cf730af8c2053c0087e70ca20a53 Mon Sep 17 00:00:00 2001 From: Haoli Du Date: Tue, 29 Jun 2021 00:11:23 +0000 Subject: [PATCH 01/11] Use a different process for each device's grpc connection --- forch/device_report_client.py | 80 ++++++++++++++++++++++------------- 1 file changed, 51 insertions(+), 29 deletions(-) diff --git a/forch/device_report_client.py b/forch/device_report_client.py index fe81f91d5..b9e2793bb 100644 --- a/forch/device_report_client.py +++ b/forch/device_report_client.py @@ -1,10 +1,12 @@ """Server to handle incoming session requests""" +import signal import threading +import multiprocessing as mp + import grpc import forch.endpoint_handler as endpoint_handler - from forch.proto.shared_constants_pb2 import PortBehavior from forch.proto.devices_state_pb2 import DevicesState from forch.base_classes import DeviceStateReporter @@ -36,10 +38,12 @@ def __init__(self, result_handler, target, unauth_vlan, tunnel_ip): self._logger = get_logger('devreport') self._logger.info('Initializing with unauthenticated vlan %s', unauth_vlan) self._logger.info('Using target %s, proto %s', target, bool(PORT_BEHAVIOR_SESSION_RESULT)) - self._channel = grpc.insecure_channel(target) - self._stub = None + self._target = target self._dp_mac_map = {} - self._mac_sessions = {} + self._mac_session_processes = {} + self._progress_q = mp.Queue() + self._progress_q_thread = None + self._mac_device_vlan_map = {} self._mac_assigned_vlan_map = {} self._unauth_vlan = unauth_vlan @@ -50,30 +54,42 @@ def __init__(self, result_handler, target, unauth_vlan, tunnel_ip): def start(self): """Start the client handler""" - grpc.channel_ready_future(self._channel).result(timeout=CONNECT_TIMEOUT_SEC) - self._stub = SessionServerStub(self._channel) + # Context may be set already even though this function is only called once. + try: + mp.set_start_method('spawn') + except RuntimeError: + pass + self._progress_q_thread = threading.Thread(target=self._process_progress_q) + self._progress_q_thread.start() def stop(self): """Stop client handler""" - - def _connect(self, mac, vlan, assigned): - self._logger.info('Connecting %s to %s/%s', mac, vlan, assigned) + self._progress_q.put((None, None)) + if self._progress_q_thread: + self._progress_q_thread.join() + + @classmethod + def _connect(cls, mac, vlan, assigned, target, tunnel_ip, progress_q): # pylint: disable=too-many-arguments + channel = grpc.insecure_channel(target) + grpc.channel_ready_future(channel).result(timeout=CONNECT_TIMEOUT_SEC) + stub = SessionServerStub(channel) session_params = SessionParams() session_params.device_mac = mac session_params.device_vlan = vlan session_params.assigned_vlan = assigned - session_params.endpoint.ip = self._tunnel_ip or DEFAULT_SERVER_ADDRESS - session = self._stub.StartSession(session_params) - thread = threading.Thread(target=lambda: self._process_progress(mac, session)) - thread.start() - return session + session_params.endpoint.ip = tunnel_ip + session = stub.StartSession(session_params) + signal.signal(signal.SIGTERM, lambda: session.cancel()) + for progress in session: + progress_q.put((mac, progress)) + progress_q.put((mac, None)) def disconnect(self, mac): with self._lock: - session = self._mac_sessions.get(mac) - if session: - session.cancel() - self._mac_sessions.pop(mac) + process = self._mac_session_processes.get(mac) + if process: + process.terminate() + self._mac_session_processes.pop(mac) self._logger.info('Device %s disconnected', mac) else: self._logger.warning('Attempt to disconnect unconnected device %s', mac) @@ -99,18 +115,20 @@ def _convert_and_handle(self, mac, progress): self._endpoint_handler.process_endpoint(progress.endpoint) return False - def _process_progress(self, mac, session): - try: - for progress in session: - if self._convert_and_handle(mac, progress): - break - self._logger.info('Progress complete for %s', mac) - except Exception as e: - self._logger.error('Progress exception: %s', e) - self.disconnect(mac) + def _process_progress_q(self): + while True: + mac, progress = self._progress_q.get(block=True) + if not mac: # device client shutdown + break + try: + if not progress or self._convert_and_handle(mac, progress): + self._logger.info('Progress complete for %s', mac) + self.disconnect(mac) + except Exception as e: + self._logger.error('Progress exception for %s: %s', mac, e) def _process_session_ready(self, mac): - if mac in self._mac_sessions: + if mac in self._mac_session_processes: self._logger.info('Ignoring b/c existing session %s', mac) return device_vlan = self._mac_device_vlan_map.get(mac) @@ -119,7 +137,11 @@ def _process_session_ready(self, mac): good_device_vlan = device_vlan and device_vlan not in (self._unauth_vlan, assigned_vlan) if assigned_vlan and good_device_vlan: - self._mac_sessions[mac] = self._connect(mac, device_vlan, assigned_vlan) + self._logger.info('Connecting %s to %s/%s', mac, device_vlan, assigned_vlan) + self._mac_session_processes[mac] = mp.Process(target=self._connect, args=(mac, + device_vlan, assigned_vlan, self._target, + self._tunnel_ip or DEFAULT_SERVER_ADDRESS, self._progress_q)) + self._mac_session_processes[mac].start() def process_port_state(self, dp_name, port, state): """Process faucet port state events""" From 407b460f8d00eb106ae644d23b40da98f70d1aee Mon Sep 17 00:00:00 2001 From: Haoli Du Date: Tue, 29 Jun 2021 17:40:29 +0000 Subject: [PATCH 02/11] fix some multi channel issues. --- forch/device_report_client.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/forch/device_report_client.py b/forch/device_report_client.py index b9e2793bb..71b9429e9 100644 --- a/forch/device_report_client.py +++ b/forch/device_report_client.py @@ -1,5 +1,6 @@ """Server to handle incoming session requests""" +import sys import signal import threading import multiprocessing as mp @@ -68,9 +69,10 @@ def stop(self): if self._progress_q_thread: self._progress_q_thread.join() + # pylint: disable=too-many-arguments @classmethod - def _connect(cls, mac, vlan, assigned, target, tunnel_ip, progress_q): # pylint: disable=too-many-arguments - channel = grpc.insecure_channel(target) + def _connect(cls, mac, vlan, assigned, target, tunnel_ip, progress_q): + channel = grpc.insecure_channel(target, options = (('grpc.so_reuseport', 0),)) grpc.channel_ready_future(channel).result(timeout=CONNECT_TIMEOUT_SEC) stub = SessionServerStub(channel) session_params = SessionParams() @@ -79,7 +81,11 @@ def _connect(cls, mac, vlan, assigned, target, tunnel_ip, progress_q): # pylint session_params.assigned_vlan = assigned session_params.endpoint.ip = tunnel_ip session = stub.StartSession(session_params) - signal.signal(signal.SIGTERM, lambda: session.cancel()) + def terminate(*args): + session.cancel() + progress_q.put((mac, None)) + sys.exit() + signal.signal(signal.SIGTERM, terminate) for progress in session: progress_q.put((mac, progress)) progress_q.put((mac, None)) @@ -118,10 +124,11 @@ def _convert_and_handle(self, mac, progress): def _process_progress_q(self): while True: mac, progress = self._progress_q.get(block=True) - if not mac: # device client shutdown + if not mac: # device client shutdown break try: if not progress or self._convert_and_handle(mac, progress): + print('Progress complete for %s' % mac) self._logger.info('Progress complete for %s', mac) self.disconnect(mac) except Exception as e: @@ -138,9 +145,9 @@ def _process_session_ready(self, mac): good_device_vlan = device_vlan and device_vlan not in (self._unauth_vlan, assigned_vlan) if assigned_vlan and good_device_vlan: self._logger.info('Connecting %s to %s/%s', mac, device_vlan, assigned_vlan) - self._mac_session_processes[mac] = mp.Process(target=self._connect, args=(mac, - device_vlan, assigned_vlan, self._target, - self._tunnel_ip or DEFAULT_SERVER_ADDRESS, self._progress_q)) + args = (mac, device_vlan, assigned_vlan, self._target, + self._tunnel_ip or DEFAULT_SERVER_ADDRESS, self._progress_q) + self._mac_session_processes[mac] = mp.Process(target=self._connect, args=args) self._mac_session_processes[mac].start() def process_port_state(self, dp_name, port, state): From e40a62fa344b6a74fe260e0ba86fb413588fea8f Mon Sep 17 00:00:00 2001 From: Haoli Du Date: Tue, 29 Jun 2021 17:44:16 +0000 Subject: [PATCH 03/11] lint fix --- forch/device_report_client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/forch/device_report_client.py b/forch/device_report_client.py index 71b9429e9..1f3448fb1 100644 --- a/forch/device_report_client.py +++ b/forch/device_report_client.py @@ -72,7 +72,7 @@ def stop(self): # pylint: disable=too-many-arguments @classmethod def _connect(cls, mac, vlan, assigned, target, tunnel_ip, progress_q): - channel = grpc.insecure_channel(target, options = (('grpc.so_reuseport', 0),)) + channel = grpc.insecure_channel(target, options=(('grpc.so_reuseport', 0),)) grpc.channel_ready_future(channel).result(timeout=CONNECT_TIMEOUT_SEC) stub = SessionServerStub(channel) session_params = SessionParams() @@ -81,6 +81,7 @@ def _connect(cls, mac, vlan, assigned, target, tunnel_ip, progress_q): session_params.assigned_vlan = assigned session_params.endpoint.ip = tunnel_ip session = stub.StartSession(session_params) + def terminate(*args): session.cancel() progress_q.put((mac, None)) From 2ae8819eaec359084f662814224950b96368d501 Mon Sep 17 00:00:00 2001 From: Haoli Du Date: Tue, 29 Jun 2021 18:45:06 +0000 Subject: [PATCH 04/11] remove extra print statement --- forch/device_report_client.py | 1 - 1 file changed, 1 deletion(-) diff --git a/forch/device_report_client.py b/forch/device_report_client.py index 1f3448fb1..800b5c5f4 100644 --- a/forch/device_report_client.py +++ b/forch/device_report_client.py @@ -129,7 +129,6 @@ def _process_progress_q(self): break try: if not progress or self._convert_and_handle(mac, progress): - print('Progress complete for %s' % mac) self._logger.info('Progress complete for %s', mac) self.disconnect(mac) except Exception as e: From 6393140fffccdc96fb17d65737b48cd48a3da6d7 Mon Sep 17 00:00:00 2001 From: Haoli Du Date: Tue, 29 Jun 2021 20:29:05 +0000 Subject: [PATCH 05/11] increase ping count --- testing/test_fot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/test_fot b/testing/test_fot index 25b91e9fc..71b0e620d 100755 --- a/testing/test_fot +++ b/testing/test_fot @@ -34,7 +34,7 @@ echo `timestamp` DAQ spot checks # faux-5: tests timeout (hold test enabled) # Test that no-sequester works -docker exec forch-faux-4 ping -c 10 192.168.1.0 +docker exec forch-faux-4 ping -c 20 192.168.1.0 # Ongoing activity faux-5 to keep it learned docker exec forch-faux-5 ping -c 1000 192.168.1.0 > /dev/null & From 098defc8be92ea2663d5d8ebac6af06fe964504a Mon Sep 17 00:00:00 2001 From: Haoli Du Date: Tue, 29 Jun 2021 22:55:30 +0000 Subject: [PATCH 06/11] Add sleep before device 4 no sequester check --- testing/test_fot | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/testing/test_fot b/testing/test_fot index 71b0e620d..715e114a2 100755 --- a/testing/test_fot +++ b/testing/test_fot @@ -26,6 +26,10 @@ FAUCET_BASE=$INST_BASE/faucet BEHAVIORAL_CONFIG=$FAUCET_BASE/faucet.yaml YQ=venv/bin/yq +if [ -n "$CI" ]; then + sleep 20; +fi + echo `timestamp` DAQ spot checks # faux-1: tests passing, moved to operational # faux-2: tests failing, moved to infracted From be7ceccfa458bd86dc5b90265cca6721b58e73b2 Mon Sep 17 00:00:00 2001 From: Haoli Du Date: Wed, 30 Jun 2021 00:32:44 +0000 Subject: [PATCH 07/11] test --- testing/test_fot | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/testing/test_fot b/testing/test_fot index 715e114a2..5ce16af73 100755 --- a/testing/test_fot +++ b/testing/test_fot @@ -26,10 +26,6 @@ FAUCET_BASE=$INST_BASE/faucet BEHAVIORAL_CONFIG=$FAUCET_BASE/faucet.yaml YQ=venv/bin/yq -if [ -n "$CI" ]; then - sleep 20; -fi - echo `timestamp` DAQ spot checks # faux-1: tests passing, moved to operational # faux-2: tests failing, moved to infracted @@ -38,7 +34,9 @@ echo `timestamp` DAQ spot checks # faux-5: tests timeout (hold test enabled) # Test that no-sequester works -docker exec forch-faux-4 ping -c 20 192.168.1.0 +if [ -z "$CI" ]; then + docker exec forch-faux-4 ping -c 10 192.168.1.0 +fi # Ongoing activity faux-5 to keep it learned docker exec forch-faux-5 ping -c 1000 192.168.1.0 > /dev/null & From db18351e5db90c78b9071ea49bfbff382c833cb2 Mon Sep 17 00:00:00 2001 From: Haoli Du Date: Wed, 30 Jun 2021 18:04:11 +0000 Subject: [PATCH 08/11] test --- .github/workflows/main.yaml | 108 +--------------------------------- bin/stack_functions | 2 +- forch/device_report_client.py | 3 +- testing/test_fot | 4 +- 4 files changed, 7 insertions(+), 110 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index bd7abbd90..64f8c7f50 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -7,47 +7,12 @@ on: - cron: '0 */2 * * *' jobs: - test_access: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up python 3.8 - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - name: setup base - run: bin/setup_base - - name: setup faucet - run: bin/setup_remote faucet - - name: compile ovs - run: bin/compile_ovs - - name: build docker - run: bin/retry_cmd bin/build_docker - - name: setup stack - run: bin/setup_stack local skip-conn-check dva - - name: run test - run: bin/run_test_set access - - test_base: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up python 3.8 - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - name: setup base - run: bin/setup_base - - name: setup faucet - run: bin/setup_remote faucet - - name: build docker - run: bin/retry_cmd bin/build_docker - - name: run test - run: bin/run_test_set base - test_fot: runs-on: ubuntu-latest timeout-minutes: 60 + strategy: + matrix: + test: [1, 2, 3, 4, 5] steps: - uses: actions/checkout@v2 - name: Set up python 3.8 @@ -92,70 +57,3 @@ jobs: echo %%%%%%%%%%%%% Endpoint logs cat inst/endpoint.log || true - test_reconfig: - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - uses: actions/checkout@v2 - - name: Set up python 3.8 - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - name: setup base - run: bin/setup_base - - name: setup faucet - run: bin/setup_remote faucet - - name: compile ovs - run: bin/compile_ovs - - name: build docker - run: bin/retry_cmd bin/build_docker - - name: setup stack - run: bin/setup_stack - - name: run test - run: bin/run_test_set reconfig - - test_stack: - runs-on: ubuntu-latest - timeout-minutes: 45 - steps: - - uses: actions/checkout@v2 - - name: Set up python 3.8 - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - name: setup base - run: bin/setup_base - - name: setup faucet - run: bin/setup_remote faucet - - name: compile ovs - run: bin/compile_ovs - - name: build docker - run: bin/retry_cmd bin/build_docker - - name: setup stack - run: bin/setup_stack local dhcp dumptcp - - name: run test - run: bin/run_test_set stack - - name: post-run logs - if: ${{ always() }} - run: bin/dump_logs full - - test_scale: - runs-on: ubuntu-20.04 - timeout-minutes: 25 - steps: - - uses: actions/checkout@v2 - - name: Set up python 3.8 - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - name: setup base - run: bin/setup_base - - name: setup faucet - run: bin/setup_remote faucet - - name: build docker - run: bin/retry_cmd bin/build_docker - - name: run test - run: testing/python_test test_failscale - - name: post-run logs - if: ${{ always() }} - run: bin/dump_logs full diff --git a/bin/stack_functions b/bin/stack_functions index 475972993..d980d355d 100644 --- a/bin/stack_functions +++ b/bin/stack_functions @@ -127,7 +127,7 @@ function add_faux { bin/run_faux $fnum $* add_iface $switch $port faux-$fnum echo Waiting for IP address... - for i in `seq 1 20`; do + for i in `seq 1 30`; do ip_address=$(docker exec forch-faux-$fnum ip addr show faux-eth0 | sed -nr 's~.*inet ([0-9.]+)/.*~\1~p' || true) if [[ -n "$ip_address" ]]; then break diff --git a/forch/device_report_client.py b/forch/device_report_client.py index 800b5c5f4..642d6166c 100644 --- a/forch/device_report_client.py +++ b/forch/device_report_client.py @@ -72,7 +72,8 @@ def stop(self): # pylint: disable=too-many-arguments @classmethod def _connect(cls, mac, vlan, assigned, target, tunnel_ip, progress_q): - channel = grpc.insecure_channel(target, options=(('grpc.so_reuseport', 0),)) + channel = grpc.insecure_channel(target, options=(('grpc.so_reuseport', 0), + ('grpc.use_local_subchannel_pool', 1))) grpc.channel_ready_future(channel).result(timeout=CONNECT_TIMEOUT_SEC) stub = SessionServerStub(channel) session_params = SessionParams() diff --git a/testing/test_fot b/testing/test_fot index 5ce16af73..93868cc4e 100755 --- a/testing/test_fot +++ b/testing/test_fot @@ -34,9 +34,7 @@ echo `timestamp` DAQ spot checks # faux-5: tests timeout (hold test enabled) # Test that no-sequester works -if [ -z "$CI" ]; then - docker exec forch-faux-4 ping -c 10 192.168.1.0 -fi +docker exec forch-faux-4 ping -c 10 192.168.1.0 || true # Ongoing activity faux-5 to keep it learned docker exec forch-faux-5 ping -c 1000 192.168.1.0 > /dev/null & From 3253972720bef6bd85e06202a2d2d9ddb4aad082 Mon Sep 17 00:00:00 2001 From: Haoli Du Date: Wed, 30 Jun 2021 19:00:14 +0000 Subject: [PATCH 09/11] test --- .github/workflows/main.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 64f8c7f50..9a8a53762 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -11,6 +11,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 strategy: + fail-fast: false matrix: test: [1, 2, 3, 4, 5] steps: From f3eae2bbcd08cf84a015f0a61f7f26a452e9e6e1 Mon Sep 17 00:00:00 2001 From: Haoli Du Date: Thu, 1 Jul 2021 16:59:45 +0000 Subject: [PATCH 10/11] test --- forch/__main__.py | 2 ++ forch/device_report_client.py | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/forch/__main__.py b/forch/__main__.py index 2762498cb..ea840ac6c 100644 --- a/forch/__main__.py +++ b/forch/__main__.py @@ -4,6 +4,7 @@ import functools import os import sys +import multiprocessing as mp import forch.faucet_event_client from forch.forchestrator import Forchestrator @@ -100,4 +101,5 @@ def main(): if __name__ == '__main__': + mp.set_start_method('spawn') main() diff --git a/forch/device_report_client.py b/forch/device_report_client.py index 642d6166c..e17581deb 100644 --- a/forch/device_report_client.py +++ b/forch/device_report_client.py @@ -55,7 +55,7 @@ def __init__(self, result_handler, target, unauth_vlan, tunnel_ip): def start(self): """Start the client handler""" - # Context may be set already even though this function is only called once. + # Context may be set already try: mp.set_start_method('spawn') except RuntimeError: @@ -72,8 +72,7 @@ def stop(self): # pylint: disable=too-many-arguments @classmethod def _connect(cls, mac, vlan, assigned, target, tunnel_ip, progress_q): - channel = grpc.insecure_channel(target, options=(('grpc.so_reuseport', 0), - ('grpc.use_local_subchannel_pool', 1))) + channel = grpc.insecure_channel(target, options=(('grpc.so_reuseport', 0),)) grpc.channel_ready_future(channel).result(timeout=CONNECT_TIMEOUT_SEC) stub = SessionServerStub(channel) session_params = SessionParams() From b73a2e329a0a1c225c8ff096cb7db375b71be117 Mon Sep 17 00:00:00 2001 From: Haoli Du Date: Thu, 1 Jul 2021 18:08:05 +0000 Subject: [PATCH 11/11] Restore github actions. --- .github/workflows/main.yaml | 119 ++++++++++++++++++++++++++++++++++-- bin/stack_functions | 2 +- testing/test_fot | 2 +- 3 files changed, 117 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 9a8a53762..bed0ee6f2 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -7,13 +7,51 @@ on: - cron: '0 */2 * * *' jobs: + test_access: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: setup base + run: bin/setup_base + - name: setup faucet + env: + GIT_URL: ${{ secrets.GIT_URL }} + run: bin/setup_remote faucet + - name: compile ovs + run: bin/compile_ovs + - name: build docker + run: bin/retry_cmd bin/build_docker + - name: setup stack + run: bin/setup_stack local skip-conn-check dva + - name: run test + run: bin/run_test_set access + + test_base: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: setup base + run: bin/setup_base + - name: setup faucet + env: + GIT_URL: ${{ secrets.GIT_URL }} + run: bin/setup_remote faucet + - name: build docker + run: bin/retry_cmd bin/build_docker + - name: run test + run: bin/run_test_set base + test_fot: runs-on: ubuntu-latest timeout-minutes: 60 - strategy: - fail-fast: false - matrix: - test: [1, 2, 3, 4, 5] steps: - uses: actions/checkout@v2 - name: Set up python 3.8 @@ -58,3 +96,76 @@ jobs: echo %%%%%%%%%%%%% Endpoint logs cat inst/endpoint.log || true + test_reconfig: + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v2 + - name: Set up python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: setup base + run: bin/setup_base + - name: setup faucet + env: + GIT_URL: ${{ secrets.GIT_URL }} + run: bin/setup_remote faucet + - name: compile ovs + run: bin/compile_ovs + - name: build docker + run: bin/retry_cmd bin/build_docker + - name: setup stack + run: bin/setup_stack + - name: run test + run: bin/run_test_set reconfig + + test_stack: + runs-on: ubuntu-latest + timeout-minutes: 45 + steps: + - uses: actions/checkout@v2 + - name: Set up python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: setup base + run: bin/setup_base + - name: setup faucet + env: + GIT_URL: ${{ secrets.GIT_URL }} + run: bin/setup_remote faucet + - name: compile ovs + run: bin/compile_ovs + - name: build docker + run: bin/retry_cmd bin/build_docker + - name: setup stack + run: bin/setup_stack local dhcp dumptcp + - name: run test + run: bin/run_test_set stack + - name: post-run logs + if: ${{ always() }} + run: bin/dump_logs full + + test_scale: + runs-on: ubuntu-20.04 + timeout-minutes: 25 + steps: + - uses: actions/checkout@v2 + - name: Set up python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: setup base + run: bin/setup_base + - name: setup faucet + env: + GIT_URL: ${{ secrets.GIT_URL }} + run: bin/setup_remote faucet + - name: build docker + run: bin/retry_cmd bin/build_docker + - name: run test + run: testing/python_test test_failscale + - name: post-run logs + if: ${{ always() }} + run: bin/dump_logs full diff --git a/bin/stack_functions b/bin/stack_functions index d980d355d..475972993 100644 --- a/bin/stack_functions +++ b/bin/stack_functions @@ -127,7 +127,7 @@ function add_faux { bin/run_faux $fnum $* add_iface $switch $port faux-$fnum echo Waiting for IP address... - for i in `seq 1 30`; do + for i in `seq 1 20`; do ip_address=$(docker exec forch-faux-$fnum ip addr show faux-eth0 | sed -nr 's~.*inet ([0-9.]+)/.*~\1~p' || true) if [[ -n "$ip_address" ]]; then break diff --git a/testing/test_fot b/testing/test_fot index 93868cc4e..25b91e9fc 100755 --- a/testing/test_fot +++ b/testing/test_fot @@ -34,7 +34,7 @@ echo `timestamp` DAQ spot checks # faux-5: tests timeout (hold test enabled) # Test that no-sequester works -docker exec forch-faux-4 ping -c 10 192.168.1.0 || true +docker exec forch-faux-4 ping -c 10 192.168.1.0 # Ongoing activity faux-5 to keep it learned docker exec forch-faux-5 ping -c 1000 192.168.1.0 > /dev/null &