diff --git a/.gitignore b/.gitignore index 5dfc1f6f9..ad8f26d34 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ venv/ error pylint.out local/ -__pycache__/ \ No newline at end of file +__pycache__/ +build/ \ No newline at end of file diff --git a/cmd/install b/cmd/install index 23e463158..37c03e113 100755 --- a/cmd/install +++ b/cmd/install @@ -6,8 +6,4 @@ source venv/bin/activate pip3 install -r framework/requirements.txt -pip3 install -r net_orc/python/requirements.txt - -pip3 install -r test_orc/python/requirements.txt - deactivate diff --git a/cmd/start b/cmd/start index d146f413d..55d2e52eb 100755 --- a/cmd/start +++ b/cmd/start @@ -18,7 +18,9 @@ rm -rf runtime source venv/bin/activate # TODO: Execute python code -python -u framework/test_runner.py $@ +# Set the PYTHONPATH to include the "src" directory +export PYTHONPATH="$PWD/framework/python/src" +python -u framework/python/src/core/test_runner.py $@ # TODO: Work in progress code for containerization of OVS module # asyncRun() { diff --git a/framework/logger.py b/framework/python/src/common/logger.py similarity index 57% rename from framework/logger.py rename to framework/python/src/common/logger.py index cb71c9fdd..539767f53 100644 --- a/framework/logger.py +++ b/framework/python/src/common/logger.py @@ -1,63 +1,60 @@ -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Manages stream and file loggers.""" -import json -import logging -import os - -LOGGERS = {} -_LOG_FORMAT = '%(asctime)s %(name)-8s %(levelname)-7s %(message)s' -_DATE_FORMAT = '%b %02d %H:%M:%S' -_DEFAULT_LOG_LEVEL = logging.INFO -_LOG_LEVEL = logging.INFO -_CONF_DIR = 'conf' -_CONF_FILE_NAME = 'system.json' -_LOG_DIR = 'runtime/testing/' - -# Set log level -with open(os.path.join(_CONF_DIR, _CONF_FILE_NAME), - encoding='utf-8') as system_conf_file: - system_conf_json = json.load(system_conf_file) -log_level_str = system_conf_json['log_level'] - -temp_log = logging.getLogger('temp') -try: - temp_log.setLevel(logging.getLevelName(log_level_str)) - _LOG_LEVEL = logging.getLevelName(log_level_str) -except ValueError: - print('Invalid log level set in ' + _CONF_DIR + '/' + _CONF_FILE_NAME + - '. Using INFO as log level') - _LOG_LEVEL = _DEFAULT_LOG_LEVEL - -log_format = logging.Formatter(fmt=_LOG_FORMAT, datefmt=_DATE_FORMAT) - -def add_file_handler(log, log_file): - handler = logging.FileHandler(_LOG_DIR + log_file + '.log') - handler.setFormatter(log_format) - log.addHandler(handler) - -def add_stream_handler(log): - handler = logging.StreamHandler() - handler.setFormatter(log_format) - log.addHandler(handler) - -def get_logger(name, log_file=None): - if name not in LOGGERS: - LOGGERS[name] = logging.getLogger(name) - LOGGERS[name].setLevel(_LOG_LEVEL) - add_stream_handler(LOGGERS[name]) - if log_file is not None: - add_file_handler(LOGGERS[name], log_file) - return LOGGERS[name] +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Sets up the logger to be used for the test modules.""" +import json +import logging +import os + +LOGGERS = {} +_LOG_FORMAT = '%(asctime)s %(name)-8s %(levelname)-7s %(message)s' +_DATE_FORMAT = '%b %02d %H:%M:%S' +_DEFAULT_LEVEL = logging.INFO +_CONF_DIR = 'conf' +_CONF_FILE_NAME = 'system.json' + +# Set log level +try: + with open(os.path.join(_CONF_DIR, _CONF_FILE_NAME), + encoding='UTF-8') as config_json_file: + system_conf_json = json.load(config_json_file) + + log_level_str = system_conf_json['log_level'] + log_level = logging.getLevelName(log_level_str) +except OSError: + # TODO: Print out warning that log level is incorrect or missing + log_level = _DEFAULT_LEVEL + +log_format = logging.Formatter(fmt=_LOG_FORMAT, datefmt=_DATE_FORMAT) + +def add_file_handler(log, log_file, log_dir): + handler = logging.FileHandler(log_dir + log_file + '.log') + handler.setFormatter(log_format) + log.addHandler(handler) + + +def add_stream_handler(log): + handler = logging.StreamHandler() + handler.setFormatter(log_format) + log.addHandler(handler) + + +def get_logger(name, log_file=None, log_dir=None): + if name not in LOGGERS: + LOGGERS[name] = logging.getLogger(name) + LOGGERS[name].setLevel(log_level) + add_stream_handler(LOGGERS[name]) + if log_file is not None and log_dir is not None: + add_file_handler(LOGGERS[name], log_file, log_dir) + return LOGGERS[name] diff --git a/net_orc/python/src/util.py b/framework/python/src/common/util.py similarity index 95% rename from net_orc/python/src/util.py rename to framework/python/src/common/util.py index ba9527996..1ffe70651 100644 --- a/net_orc/python/src/util.py +++ b/framework/python/src/common/util.py @@ -1,55 +1,55 @@ -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Provides basic utilities for the network orchestrator.""" -import subprocess -import shlex -import logger -import netifaces - -LOGGER = logger.get_logger('util') - - -def run_command(cmd, output=True): - """Runs a process at the os level - By default, returns the standard output and error output - If the caller sets optional output parameter to False, - will only return a boolean result indicating if it was - succesful in running the command. Failure is indicated - by any return code from the process other than zero.""" - - success = False - process = subprocess.Popen(shlex.split(cmd), - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - stdout, stderr = process.communicate() - - if process.returncode != 0 and output: - err_msg = f'{stderr.strip()}. Code: {process.returncode}' - LOGGER.error('Command Failed: ' + cmd) - LOGGER.error('Error: ' + err_msg) - else: - success = True - if output: - return stdout.strip().decode('utf-8'), stderr - else: - return success - - -def interface_exists(interface): - return interface in netifaces.interfaces() - - -def prettify(mac_string): - return ':'.join([f'{ord(b):02x}' for b in mac_string]) +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Provides basic utilities for the network orchestrator.""" +import subprocess +import shlex +from common import logger +import netifaces + +LOGGER = logger.get_logger('util') + + +def run_command(cmd, output=True): + """Runs a process at the os level + By default, returns the standard output and error output + If the caller sets optional output parameter to False, + will only return a boolean result indicating if it was + succesful in running the command. Failure is indicated + by any return code from the process other than zero.""" + + success = False + process = subprocess.Popen(shlex.split(cmd), + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + stdout, stderr = process.communicate() + + if process.returncode != 0 and output: + err_msg = f'{stderr.strip()}. Code: {process.returncode}' + LOGGER.error('Command Failed: ' + cmd) + LOGGER.error('Error: ' + err_msg) + else: + success = True + if output: + return stdout.strip().decode('utf-8'), stderr + else: + return success + + +def interface_exists(interface): + return interface in netifaces.interfaces() + + +def prettify(mac_string): + return ':'.join([f'{ord(b):02x}' for b in mac_string]) diff --git a/framework/device.py b/framework/python/src/core/device.py similarity index 91% rename from framework/device.py rename to framework/python/src/core/device.py index 53263e6a6..44f275bdf 100644 --- a/framework/device.py +++ b/framework/python/src/core/device.py @@ -14,7 +14,7 @@ """Track device object information.""" -from network_device import NetworkDevice +from net_orc.network_device import NetworkDevice from dataclasses import dataclass diff --git a/framework/test_runner.py b/framework/python/src/core/test_runner.py similarity index 96% rename from framework/test_runner.py rename to framework/python/src/core/test_runner.py index 0ee5e8416..226f874cc 100644 --- a/framework/test_runner.py +++ b/framework/python/src/core/test_runner.py @@ -23,7 +23,7 @@ import argparse import sys from testrun import TestRun -import logger +from common import logger import signal LOGGER = logger.get_logger("runner") diff --git a/framework/testrun.py b/framework/python/src/core/testrun.py similarity index 85% rename from framework/testrun.py rename to framework/python/src/core/testrun.py index 25232f90c..e59b7cda2 100644 --- a/framework/testrun.py +++ b/framework/python/src/core/testrun.py @@ -25,25 +25,18 @@ import json import signal import time -import logger +from common import logger # Locate parent directory current_dir = os.path.dirname(os.path.realpath(__file__)) -parent_dir = os.path.dirname(current_dir) -# Add net_orc to Python path -net_orc_dir = os.path.join(parent_dir, 'net_orc', 'python', 'src') -sys.path.append(net_orc_dir) +# Locate the test-run root directory, 4 levels, src->python->framework->test-run +root_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(current_dir)))) -# Add test_orc to Python path -test_orc_dir = os.path.join(parent_dir, 'test_orc', 'python', 'src') -sys.path.append(test_orc_dir) - -from listener import NetworkEvent # pylint: disable=wrong-import-position,import-outside-toplevel -import test_orchestrator as test_orc # pylint: disable=wrong-import-position,import-outside-toplevel -import network_orchestrator as net_orc # pylint: disable=wrong-import-position,import-outside-toplevel - -from device import Device # pylint: disable=wrong-import-position,import-outside-toplevel +from net_orc.listener import NetworkEvent +from test_orc import test_orchestrator as test_orc +from net_orc import network_orchestrator as net_orc +from device import Device LOGGER = logger.get_logger('test_run') CONFIG_FILE = 'conf/system.json' @@ -58,7 +51,6 @@ DEVICE_MAC_ADDR = 'mac_addr' DEVICE_TEST_MODULES = 'test_modules' - class TestRun: # pylint: disable=too-few-public-methods """Test Run controller. @@ -142,7 +134,7 @@ def _exit_handler(self, signum, arg): # pylint: disable=unused-argument def _get_config_abs(self, config_file=None): if config_file is None: # If not defined, use relative pathing to local file - config_file = os.path.join(parent_dir, CONFIG_FILE) + config_file = os.path.join(root_dir, CONFIG_FILE) # Expand the config file to absolute pathing return os.path.abspath(config_file) diff --git a/net_orc/python/src/listener.py b/framework/python/src/net_orc/listener.py similarity index 97% rename from net_orc/python/src/listener.py rename to framework/python/src/net_orc/listener.py index 0bbd2b1c9..4f8e1961f 100644 --- a/net_orc/python/src/listener.py +++ b/framework/python/src/net_orc/listener.py @@ -16,8 +16,8 @@ under test.""" import threading from scapy.all import AsyncSniffer, DHCP, get_if_hwaddr -import logger -from network_event import NetworkEvent +from net_orc.network_event import NetworkEvent +from common import logger LOGGER = logger.get_logger('listener') diff --git a/net_orc/python/src/network_device.py b/framework/python/src/net_orc/network_device.py similarity index 100% rename from net_orc/python/src/network_device.py rename to framework/python/src/net_orc/network_device.py diff --git a/net_orc/python/src/network_event.py b/framework/python/src/net_orc/network_event.py similarity index 100% rename from net_orc/python/src/network_event.py rename to framework/python/src/net_orc/network_event.py diff --git a/net_orc/python/src/network_orchestrator.py b/framework/python/src/net_orc/network_orchestrator.py similarity index 94% rename from net_orc/python/src/network_orchestrator.py rename to framework/python/src/net_orc/network_orchestrator.py index f53b17d15..f1f479742 100644 --- a/net_orc/python/src/network_orchestrator.py +++ b/framework/python/src/net_orc/network_orchestrator.py @@ -26,13 +26,14 @@ import threading import docker from docker.types import Mount -import logger -import util -from listener import Listener -from network_device import NetworkDevice -from network_event import NetworkEvent -from network_validator import NetworkValidator -from ovs_control import OVSControl +from collections import OrderedDict +from common import logger +from common import util +from net_orc.listener import Listener +from net_orc.network_device import NetworkDevice +from net_orc.network_event import NetworkEvent +from net_orc.network_validator import NetworkValidator +from net_orc.ovs_control import OVSControl LOGGER = logger.get_logger('net_orc') CONFIG_FILE = 'conf/system.json' @@ -41,7 +42,8 @@ TEST_DIR = 'test' MONITOR_PCAP = 'monitor.pcap' NET_DIR = 'runtime/network' -NETWORK_MODULES_DIR = 'network/modules' +#NETWORK_MODULES_DIR = 'network/modules' +NETWORK_MODULES_DIR = 'modules/network' NETWORK_MODULE_METADATA = 'conf/module_config.json' DEVICE_BRIDGE = 'tr-d' INTERNET_BRIDGE = 'tr-c' @@ -81,8 +83,9 @@ def __init__(self, self.validate = validate self.async_monitor = async_monitor - self._path = os.path.dirname( - os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) + self._path = os.path.dirname(os.path.dirname( + os.path.dirname( + os.path.dirname(os.path.dirname(os.path.realpath(__file__)))))) self.validator = NetworkValidator() shutil.rmtree(os.path.join(os.getcwd(), NET_DIR), ignore_errors=True) @@ -182,7 +185,7 @@ def _device_discovered(self, mac_addr): TEST_DIR, device.mac_addr.replace(':', '')) os.makedirs(device_runtime_dir) - util.run_command(f'chown -R {self._host_user}:{self._host_user} {device_runtime_dir}') + util.run_command(f'chown -R {self._host_user} {device_runtime_dir}') packet_capture = sniff(iface=self._dev_intf, timeout=self._startup_timeout, @@ -413,6 +416,11 @@ def _load_network_module(self, module_dir): net_module.enable_container = net_module_json['config']['docker'][ 'enable_container'] + # Determine if this is a template + if 'template' in net_module_json['config']['docker']: + net_module.template = net_module_json['config']['docker'][ + 'template'] + # Load network service networking configuration if net_module.enable_container: @@ -432,13 +440,14 @@ def _load_network_module(self, module_dir): net_module.net_config.ip_index] net_module.net_config.ipv6_network = self.network_config.ipv6_network - self._net_modules.append(net_module) + self._net_modules.append(net_module) return net_module def build_network_modules(self): LOGGER.info('Building network modules...') for net_module in self._net_modules: - self._build_module(net_module) + if not net_module.template: + self._build_module(net_module) def _build_module(self, net_module): LOGGER.debug('Building network module ' + net_module.dir_name) @@ -786,6 +795,7 @@ def __init__(self): self.container = None self.container_name = None self.image_name = None + self.template = False # Absolute path self.dir = None diff --git a/net_orc/python/src/network_validator.py b/framework/python/src/net_orc/network_validator.py similarity index 91% rename from net_orc/python/src/network_validator.py rename to framework/python/src/net_orc/network_validator.py index 832a154e3..4ee46124d 100644 --- a/net_orc/python/src/network_validator.py +++ b/framework/python/src/net_orc/network_validator.py @@ -20,12 +20,12 @@ import docker from docker.types import Mount import getpass -import logger -import util +from common import logger +from common import util LOGGER = logger.get_logger('validator') OUTPUT_DIR = 'runtime/validation' -DEVICES_DIR = 'network/devices' +DEVICES_DIR = 'modules/devices' DEVICE_METADATA = 'conf/module_config.json' DEVICE_BRIDGE = 'tr-d' CONF_DIR = 'conf' @@ -38,8 +38,9 @@ class NetworkValidator: def __init__(self): self._net_devices = [] - self._path = os.path.dirname( - os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) + self._path = os.path.dirname(os.path.dirname( + os.path.dirname( + os.path.dirname(os.path.dirname(os.path.realpath(__file__)))))) self._device_dir = os.path.join(self._path, DEVICES_DIR) @@ -48,11 +49,11 @@ def __init__(self): def start(self): """Start the network validator.""" LOGGER.debug('Starting validator') - + # Setup the output directory host_user = self._get_host_user() os.makedirs(OUTPUT_DIR, exist_ok=True) - util.run_command(f'chown -R {host_user}:{host_user} {OUTPUT_DIR}') + util.run_command(f'chown -R {host_user} {OUTPUT_DIR}') self._load_devices() self._build_network_devices() @@ -85,7 +86,7 @@ def _build_device(self, net_device): def _load_devices(self): - LOGGER.info(f'Loading validators from {DEVICES_DIR}') + LOGGER.info(f'Loading validators from {self._device_dir}') loaded_devices = 'Loaded the following validators: ' @@ -175,24 +176,24 @@ def _start_network_device(self, device): def _get_host_user(self): user = self._get_os_user() - + # If primary method failed, try secondary if user is None: user = self._get_user() - LOGGER.debug("Network validator host user: " + user) + LOGGER.debug(f'Network validator host user: {user}') return user def _get_os_user(self): user = None try: user = os.getlogin() - except OSError as e: + except OSError: # Handle the OSError exception - LOGGER.error("An OS error occurred while retrieving the login name.") - except Exception as e: + LOGGER.error('An OS error occurred while retrieving the login name.') + except Exception as error: # Catch any other unexpected exceptions - LOGGER.error("An exception occurred:", e) + LOGGER.error('An exception occurred:', error) return user def _get_user(self): diff --git a/net_orc/python/src/ovs_control.py b/framework/python/src/net_orc/ovs_control.py similarity index 95% rename from net_orc/python/src/ovs_control.py rename to framework/python/src/net_orc/ovs_control.py index ce316dba7..3c950d4af 100644 --- a/net_orc/python/src/ovs_control.py +++ b/framework/python/src/net_orc/ovs_control.py @@ -14,9 +14,9 @@ """OVS Control Module""" import json -import logger -import util import os +from common import logger +from common import util CONFIG_FILE = 'conf/system.json' DEVICE_BRIDGE = 'tr-d' @@ -146,9 +146,9 @@ def delete_bridge(self, bridge_name): return success def _load_config(self): - path = os.path.dirname( - os.path.dirname( - os.path.dirname(os.path.dirname(os.path.realpath(__file__))))) + path = os.path.dirname(os.path.dirname( + os.path.dirname( + os.path.dirname(os.path.dirname(os.path.realpath(__file__)))))) config_file = os.path.join(path, CONFIG_FILE) LOGGER.debug('Loading configuration: ' + config_file) with open(config_file, 'r', encoding='utf-8') as conf_file: diff --git a/test_orc/python/src/module.py b/framework/python/src/test_orc/module.py similarity index 100% rename from test_orc/python/src/module.py rename to framework/python/src/test_orc/module.py diff --git a/test_orc/python/src/runner.py b/framework/python/src/test_orc/runner.py similarity index 100% rename from test_orc/python/src/runner.py rename to framework/python/src/test_orc/runner.py diff --git a/test_orc/python/src/test_orchestrator.py b/framework/python/src/test_orc/test_orchestrator.py similarity index 91% rename from test_orc/python/src/test_orchestrator.py rename to framework/python/src/test_orc/test_orchestrator.py index 9f0f100ab..58c1944f8 100644 --- a/test_orc/python/src/test_orchestrator.py +++ b/framework/python/src/test_orc/test_orchestrator.py @@ -20,14 +20,14 @@ import shutil import docker from docker.types import Mount -import logger -from module import TestModule -import util +from common import logger +from test_orc.module import TestModule +from common import util LOG_NAME = "test_orc" LOGGER = logger.get_logger("test_orc") RUNTIME_DIR = "runtime/test" -TEST_MODULES_DIR = "modules" +TEST_MODULES_DIR = "modules/test" MODULE_CONFIG = "conf/module_config.json" @@ -40,22 +40,28 @@ def __init__(self, net_orc): self._net_orc = net_orc self._test_in_progress = False - self._path = os.path.dirname( - os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) + self._path = os.path.dirname(os.path.dirname( + os.path.dirname( + os.path.dirname(os.path.dirname(os.path.realpath(__file__)))))) # Resolve the path to the test-run folder - self._root_path = os.path.abspath(os.path.join(self._path, os.pardir)) + #self._root_path = os.path.abspath(os.path.join(self._path, os.pardir)) + + + self._root_path = os.path.dirname(os.path.dirname( + os.path.dirname( + os.path.dirname(os.path.dirname(os.path.realpath(__file__)))))) shutil.rmtree(os.path.join(self._root_path, RUNTIME_DIR), ignore_errors=True) def start(self): LOGGER.debug("Starting test orchestrator") - + # Setup the output directory self._host_user = self._get_host_user() os.makedirs(RUNTIME_DIR, exist_ok=True) - util.run_command(f'chown -R {self._host_user}:{self._host_user} {RUNTIME_DIR}') + util.run_command(f'chown -R {self._host_user} {RUNTIME_DIR}') self._load_test_modules() self.build_test_modules() @@ -107,7 +113,7 @@ def _generate_results(self, device): "runtime/test/" + device.mac_addr.replace(":", "") + "/results.json") with open(out_file, "w", encoding="utf-8") as f: json.dump(results, f, indent=2) - util.run_command(f'chown -R {self._host_user}:{self._host_user} {out_file}') + util.run_command(f'chown -R {self._host_user} {out_file}') return results def test_in_progress(self): @@ -143,12 +149,12 @@ def _run_test_module(self, module, device): device_startup_capture = os.path.join( self._root_path, "runtime/test/" + device.mac_addr.replace(":", "") + "/startup.pcap") - util.run_command(f'chown -R {self._host_user}:{self._host_user} {device_startup_capture}') + util.run_command(f'chown -R {self._host_user} {device_startup_capture}') device_monitor_capture = os.path.join( self._root_path, "runtime/test/" + device.mac_addr.replace(":", "") + "/monitor.pcap") - util.run_command(f'chown -R {self._host_user}:{self._host_user} {device_monitor_capture}') + util.run_command(f'chown -R {self._host_user} {device_monitor_capture}') client = docker.from_env() diff --git a/framework/requirements.txt b/framework/requirements.txt index ca56948f4..03eab9796 100644 --- a/framework/requirements.txt +++ b/framework/requirements.txt @@ -1 +1,8 @@ -requests<2.29.0 \ No newline at end of file +# Requirements for the core module +requests<2.29.0 + +# Requirements for the net_orc module +docker +ipaddress +netifaces +scapy \ No newline at end of file diff --git a/net_orc/network/devices/faux-dev/bin/get_default_gateway b/modules/devices/faux-dev/bin/get_default_gateway similarity index 100% rename from net_orc/network/devices/faux-dev/bin/get_default_gateway rename to modules/devices/faux-dev/bin/get_default_gateway diff --git a/net_orc/network/devices/faux-dev/bin/start_dhcp_client b/modules/devices/faux-dev/bin/start_dhcp_client similarity index 100% rename from net_orc/network/devices/faux-dev/bin/start_dhcp_client rename to modules/devices/faux-dev/bin/start_dhcp_client diff --git a/net_orc/network/devices/faux-dev/bin/start_network_service b/modules/devices/faux-dev/bin/start_network_service similarity index 91% rename from net_orc/network/devices/faux-dev/bin/start_network_service rename to modules/devices/faux-dev/bin/start_network_service index 13e2f6baf..80a587684 100644 --- a/net_orc/network/devices/faux-dev/bin/start_network_service +++ b/modules/devices/faux-dev/bin/start_network_service @@ -27,7 +27,7 @@ LOG_FILE=$OUTPUT_DIR/$MODULE_NAME.log RESULT_FILE=$OUTPUT_DIR/result.json touch $LOG_FILE touch $RESULT_FILE -chown -R $HOST_USER:$HOST_USER $OUTPUT_DIR +chown -R $HOST_USER $OUTPUT_DIR # Start dhclient $BIN_DIR/start_dhcp_client $INTF diff --git a/net_orc/network/devices/faux-dev/conf/module_config.json b/modules/devices/faux-dev/conf/module_config.json similarity index 100% rename from net_orc/network/devices/faux-dev/conf/module_config.json rename to modules/devices/faux-dev/conf/module_config.json diff --git a/net_orc/network/devices/faux-dev/faux-dev.Dockerfile b/modules/devices/faux-dev/faux-dev.Dockerfile similarity index 65% rename from net_orc/network/devices/faux-dev/faux-dev.Dockerfile rename to modules/devices/faux-dev/faux-dev.Dockerfile index 1686341b5..0a4f02f38 100644 --- a/net_orc/network/devices/faux-dev/faux-dev.Dockerfile +++ b/modules/devices/faux-dev/faux-dev.Dockerfile @@ -1,6 +1,9 @@ # Image name: test-run/faux-dev FROM test-run/base:latest +ARG MODULE_NAME=faux-dev +ARG MODULE_DIR=modules/devices/$MODULE_NAME + #Update and get all additional requirements not contained in the base image RUN apt-get update --fix-missing @@ -11,10 +14,10 @@ ARG DEBIAN_FRONTEND=noninteractive RUN apt-get install -y isc-dhcp-client ntp ntpdate # Copy over all configuration files -COPY network/devices/faux-dev/conf /testrun/conf +COPY $MODULE_DIR/conf /testrun/conf -# Load device binary files -COPY network/devices/faux-dev/bin /testrun/bin +# Copy over all binary files +COPY $MODULE_DIR/bin /testrun/bin # Copy over all python files -COPY network/devices/faux-dev/python /testrun/python \ No newline at end of file +COPY $MODULE_DIR/python /testrun/python \ No newline at end of file diff --git a/net_orc/network/devices/faux-dev/python/src/dhcp_check.py b/modules/devices/faux-dev/python/src/dhcp_check.py similarity index 100% rename from net_orc/network/devices/faux-dev/python/src/dhcp_check.py rename to modules/devices/faux-dev/python/src/dhcp_check.py diff --git a/net_orc/network/devices/faux-dev/python/src/dns_check.py b/modules/devices/faux-dev/python/src/dns_check.py similarity index 100% rename from net_orc/network/devices/faux-dev/python/src/dns_check.py rename to modules/devices/faux-dev/python/src/dns_check.py diff --git a/net_orc/network/devices/faux-dev/python/src/gateway_check.py b/modules/devices/faux-dev/python/src/gateway_check.py similarity index 100% rename from net_orc/network/devices/faux-dev/python/src/gateway_check.py rename to modules/devices/faux-dev/python/src/gateway_check.py diff --git a/net_orc/network/devices/faux-dev/python/src/logger.py b/modules/devices/faux-dev/python/src/logger.py similarity index 100% rename from net_orc/network/devices/faux-dev/python/src/logger.py rename to modules/devices/faux-dev/python/src/logger.py diff --git a/net_orc/network/devices/faux-dev/python/src/ntp_check.py b/modules/devices/faux-dev/python/src/ntp_check.py similarity index 100% rename from net_orc/network/devices/faux-dev/python/src/ntp_check.py rename to modules/devices/faux-dev/python/src/ntp_check.py diff --git a/net_orc/network/devices/faux-dev/python/src/run.py b/modules/devices/faux-dev/python/src/run.py similarity index 100% rename from net_orc/network/devices/faux-dev/python/src/run.py rename to modules/devices/faux-dev/python/src/run.py diff --git a/net_orc/network/devices/faux-dev/python/src/util.py b/modules/devices/faux-dev/python/src/util.py similarity index 100% rename from net_orc/network/devices/faux-dev/python/src/util.py rename to modules/devices/faux-dev/python/src/util.py diff --git a/net_orc/network/modules/base/base.Dockerfile b/modules/network/base/base.Dockerfile similarity index 74% rename from net_orc/network/modules/base/base.Dockerfile rename to modules/network/base/base.Dockerfile index 2400fd1c6..d14713c59 100644 --- a/net_orc/network/modules/base/base.Dockerfile +++ b/modules/network/base/base.Dockerfile @@ -1,17 +1,20 @@ # Image name: test-run/base FROM ubuntu:jammy +ARG MODULE_NAME=base +ARG MODULE_DIR=modules/network/$MODULE_NAME + # Install common software RUN apt-get update && apt-get install -y net-tools iputils-ping tcpdump iproute2 jq python3 python3-pip dos2unix -#Setup the base python requirements -COPY network/modules/base/python /testrun/python +# Setup the base python requirements +COPY $MODULE_DIR/python /testrun/python # Install all python requirements for the module RUN pip3 install -r /testrun/python/requirements.txt # Add the bin files -COPY network/modules/base/bin /testrun/bin +COPY $MODULE_DIR/bin /testrun/bin # Remove incorrect line endings RUN dos2unix /testrun/bin/* diff --git a/net_orc/network/modules/base/bin/capture b/modules/network/base/bin/capture similarity index 90% rename from net_orc/network/modules/base/bin/capture rename to modules/network/base/bin/capture index 8a8430feb..bc6c425e5 100644 --- a/net_orc/network/modules/base/bin/capture +++ b/modules/network/base/bin/capture @@ -23,7 +23,7 @@ fi # Create the output directory and start the capture mkdir -p $PCAP_DIR -chown $HOST_USER:$HOST_USER $PCAP_DIR +chown $HOST_USER $PCAP_DIR tcpdump -i $INTERFACE -w $PCAP_DIR/$PCAP_FILE -Z $HOST_USER & #Small pause to let the capture to start diff --git a/net_orc/network/modules/base/bin/setup_binaries b/modules/network/base/bin/setup_binaries similarity index 100% rename from net_orc/network/modules/base/bin/setup_binaries rename to modules/network/base/bin/setup_binaries diff --git a/net_orc/network/modules/base/bin/start_grpc b/modules/network/base/bin/start_grpc similarity index 100% rename from net_orc/network/modules/base/bin/start_grpc rename to modules/network/base/bin/start_grpc diff --git a/net_orc/network/modules/base/bin/start_module b/modules/network/base/bin/start_module similarity index 100% rename from net_orc/network/modules/base/bin/start_module rename to modules/network/base/bin/start_module diff --git a/net_orc/network/modules/base/bin/start_network_service b/modules/network/base/bin/start_network_service similarity index 100% rename from net_orc/network/modules/base/bin/start_network_service rename to modules/network/base/bin/start_network_service diff --git a/net_orc/network/modules/base/bin/wait_for_interface b/modules/network/base/bin/wait_for_interface similarity index 100% rename from net_orc/network/modules/base/bin/wait_for_interface rename to modules/network/base/bin/wait_for_interface diff --git a/net_orc/network/modules/base/conf/module_config.json b/modules/network/base/conf/module_config.json similarity index 100% rename from net_orc/network/modules/base/conf/module_config.json rename to modules/network/base/conf/module_config.json diff --git a/net_orc/network/modules/base/python/requirements.txt b/modules/network/base/python/requirements.txt similarity index 100% rename from net_orc/network/modules/base/python/requirements.txt rename to modules/network/base/python/requirements.txt diff --git a/net_orc/network/modules/base/python/src/grpc/start_server.py b/modules/network/base/python/src/grpc/start_server.py similarity index 100% rename from net_orc/network/modules/base/python/src/grpc/start_server.py rename to modules/network/base/python/src/grpc/start_server.py diff --git a/net_orc/network/modules/base/python/src/logger.py b/modules/network/base/python/src/logger.py similarity index 100% rename from net_orc/network/modules/base/python/src/logger.py rename to modules/network/base/python/src/logger.py diff --git a/net_orc/network/modules/dhcp-1/bin/start_network_service b/modules/network/dhcp-1/bin/start_network_service similarity index 91% rename from net_orc/network/modules/dhcp-1/bin/start_network_service rename to modules/network/dhcp-1/bin/start_network_service index e8e0ad06c..a60806684 100644 --- a/net_orc/network/modules/dhcp-1/bin/start_network_service +++ b/modules/network/dhcp-1/bin/start_network_service @@ -21,8 +21,8 @@ mkdir /var/run/radvd #Create and set permissions on the log files touch $DHCP_LOG_FILE touch $RA_LOG_FILE -chown $HOST_USER:$HOST_USER $DHCP_LOG_FILE -chown $HOST_USER:$HOST_USER $RA_LOG_FILE +chown $HOST_USER $DHCP_LOG_FILE +chown $HOST_USER $RA_LOG_FILE #Move the config files to the correct location diff --git a/net_orc/network/modules/dhcp-1/conf/dhcpd.conf b/modules/network/dhcp-1/conf/dhcpd.conf similarity index 100% rename from net_orc/network/modules/dhcp-1/conf/dhcpd.conf rename to modules/network/dhcp-1/conf/dhcpd.conf diff --git a/net_orc/network/modules/dhcp-1/conf/module_config.json b/modules/network/dhcp-1/conf/module_config.json similarity index 100% rename from net_orc/network/modules/dhcp-1/conf/module_config.json rename to modules/network/dhcp-1/conf/module_config.json diff --git a/net_orc/network/modules/dhcp-1/conf/radvd.conf b/modules/network/dhcp-1/conf/radvd.conf similarity index 100% rename from net_orc/network/modules/dhcp-1/conf/radvd.conf rename to modules/network/dhcp-1/conf/radvd.conf diff --git a/net_orc/network/modules/dhcp-2/dhcp-2.Dockerfile b/modules/network/dhcp-1/dhcp-1.Dockerfile similarity index 56% rename from net_orc/network/modules/dhcp-2/dhcp-2.Dockerfile rename to modules/network/dhcp-1/dhcp-1.Dockerfile index 989992570..766f18c57 100644 --- a/net_orc/network/modules/dhcp-2/dhcp-2.Dockerfile +++ b/modules/network/dhcp-1/dhcp-1.Dockerfile @@ -1,14 +1,17 @@ # Image name: test-run/dhcp-primary FROM test-run/base:latest +ARG MODULE_NAME=dhcp-1 +ARG MODULE_DIR=modules/network/$MODULE_NAME + # Install dhcp server RUN apt-get install -y isc-dhcp-server radvd # Copy over all configuration files -COPY network/modules/dhcp-2/conf /testrun/conf +COPY $MODULE_DIR/conf /testrun/conf # Copy over all binary files -COPY network/modules/dhcp-2/bin /testrun/bin +COPY $MODULE_DIR/bin /testrun/bin # Copy over all python files -COPY network/modules/dhcp-2/python /testrun/python +COPY $MODULE_DIR/python /testrun/python diff --git a/net_orc/network/modules/dhcp-1/python/src/grpc/__init__.py b/modules/network/dhcp-1/python/src/grpc/__init__.py similarity index 100% rename from net_orc/network/modules/dhcp-1/python/src/grpc/__init__.py rename to modules/network/dhcp-1/python/src/grpc/__init__.py diff --git a/net_orc/network/modules/dhcp-1/python/src/grpc/dhcp_config.py b/modules/network/dhcp-1/python/src/grpc/dhcp_config.py similarity index 100% rename from net_orc/network/modules/dhcp-1/python/src/grpc/dhcp_config.py rename to modules/network/dhcp-1/python/src/grpc/dhcp_config.py diff --git a/net_orc/network/modules/dhcp-1/python/src/grpc/network_service.py b/modules/network/dhcp-1/python/src/grpc/network_service.py similarity index 100% rename from net_orc/network/modules/dhcp-1/python/src/grpc/network_service.py rename to modules/network/dhcp-1/python/src/grpc/network_service.py diff --git a/net_orc/network/modules/dhcp-1/python/src/grpc/proto/grpc.proto b/modules/network/dhcp-1/python/src/grpc/proto/grpc.proto similarity index 100% rename from net_orc/network/modules/dhcp-1/python/src/grpc/proto/grpc.proto rename to modules/network/dhcp-1/python/src/grpc/proto/grpc.proto diff --git a/net_orc/network/modules/dhcp-2/bin/start_network_service b/modules/network/dhcp-2/bin/start_network_service similarity index 91% rename from net_orc/network/modules/dhcp-2/bin/start_network_service rename to modules/network/dhcp-2/bin/start_network_service index d58174695..ad5ff09e7 100644 --- a/net_orc/network/modules/dhcp-2/bin/start_network_service +++ b/modules/network/dhcp-2/bin/start_network_service @@ -21,8 +21,8 @@ mkdir /var/run/radvd #Create and set permissions on the log files touch $DHCP_LOG_FILE touch $RA_LOG_FILE -chown $HOST_USER:$HOST_USER $DHCP_LOG_FILE -chown $HOST_USER:$HOST_USER $RA_LOG_FILE +chown $HOST_USER $DHCP_LOG_FILE +chown $HOST_USER $RA_LOG_FILE #Move the config files to the correct location diff --git a/net_orc/network/modules/dhcp-2/conf/dhcpd.conf b/modules/network/dhcp-2/conf/dhcpd.conf similarity index 100% rename from net_orc/network/modules/dhcp-2/conf/dhcpd.conf rename to modules/network/dhcp-2/conf/dhcpd.conf diff --git a/net_orc/network/modules/dhcp-2/conf/module_config.json b/modules/network/dhcp-2/conf/module_config.json similarity index 100% rename from net_orc/network/modules/dhcp-2/conf/module_config.json rename to modules/network/dhcp-2/conf/module_config.json diff --git a/net_orc/network/modules/dhcp-2/conf/radvd.conf b/modules/network/dhcp-2/conf/radvd.conf similarity index 100% rename from net_orc/network/modules/dhcp-2/conf/radvd.conf rename to modules/network/dhcp-2/conf/radvd.conf diff --git a/net_orc/network/modules/dhcp-1/dhcp-1.Dockerfile b/modules/network/dhcp-2/dhcp-2.Dockerfile similarity index 55% rename from net_orc/network/modules/dhcp-1/dhcp-1.Dockerfile rename to modules/network/dhcp-2/dhcp-2.Dockerfile index 99804e0e3..231d0c558 100644 --- a/net_orc/network/modules/dhcp-1/dhcp-1.Dockerfile +++ b/modules/network/dhcp-2/dhcp-2.Dockerfile @@ -1,14 +1,18 @@ # Image name: test-run/dhcp-primary FROM test-run/base:latest +ARG MODULE_NAME=dhcp-2 +ARG MODULE_DIR=modules/network/$MODULE_NAME + # Install dhcp server RUN apt-get install -y isc-dhcp-server radvd # Copy over all configuration files -COPY network/modules/dhcp-1/conf /testrun/conf +COPY $MODULE_DIR/conf /testrun/conf # Copy over all binary files -COPY network/modules/dhcp-1/bin /testrun/bin - +COPY $MODULE_DIR/bin /testrun/bin + # Copy over all python files -COPY network/modules/dhcp-1/python /testrun/python +COPY $MODULE_DIR/python /testrun/python + diff --git a/net_orc/network/modules/dhcp-2/python/src/grpc/__init__.py b/modules/network/dhcp-2/python/src/grpc/__init__.py similarity index 100% rename from net_orc/network/modules/dhcp-2/python/src/grpc/__init__.py rename to modules/network/dhcp-2/python/src/grpc/__init__.py diff --git a/net_orc/network/modules/dhcp-2/python/src/grpc/dhcp_config.py b/modules/network/dhcp-2/python/src/grpc/dhcp_config.py similarity index 100% rename from net_orc/network/modules/dhcp-2/python/src/grpc/dhcp_config.py rename to modules/network/dhcp-2/python/src/grpc/dhcp_config.py diff --git a/net_orc/network/modules/dhcp-2/python/src/grpc/network_service.py b/modules/network/dhcp-2/python/src/grpc/network_service.py similarity index 100% rename from net_orc/network/modules/dhcp-2/python/src/grpc/network_service.py rename to modules/network/dhcp-2/python/src/grpc/network_service.py diff --git a/net_orc/network/modules/dhcp-2/python/src/grpc/proto/grpc.proto b/modules/network/dhcp-2/python/src/grpc/proto/grpc.proto similarity index 100% rename from net_orc/network/modules/dhcp-2/python/src/grpc/proto/grpc.proto rename to modules/network/dhcp-2/python/src/grpc/proto/grpc.proto diff --git a/net_orc/network/modules/dns/bin/start_network_service b/modules/network/dns/bin/start_network_service similarity index 100% rename from net_orc/network/modules/dns/bin/start_network_service rename to modules/network/dns/bin/start_network_service diff --git a/net_orc/network/modules/dns/conf/dnsmasq.conf b/modules/network/dns/conf/dnsmasq.conf similarity index 100% rename from net_orc/network/modules/dns/conf/dnsmasq.conf rename to modules/network/dns/conf/dnsmasq.conf diff --git a/net_orc/network/modules/dns/conf/module_config.json b/modules/network/dns/conf/module_config.json similarity index 100% rename from net_orc/network/modules/dns/conf/module_config.json rename to modules/network/dns/conf/module_config.json diff --git a/net_orc/network/modules/dns/dns.Dockerfile b/modules/network/dns/dns.Dockerfile similarity index 67% rename from net_orc/network/modules/dns/dns.Dockerfile rename to modules/network/dns/dns.Dockerfile index 84c1c7eb1..edfd4dd03 100644 --- a/net_orc/network/modules/dns/dns.Dockerfile +++ b/modules/network/dns/dns.Dockerfile @@ -1,6 +1,9 @@ # Image name: test-run/dns FROM test-run/base:latest +ARG MODULE_NAME=dns +ARG MODULE_DIR=modules/network/$MODULE_NAME + #Update and get all additional requirements not contained in the base image RUN apt-get update --fix-missing @@ -8,7 +11,7 @@ RUN apt-get update --fix-missing RUN apt-get install -y dnsmasq # Copy over all configuration files -COPY network/modules/dns/conf /testrun/conf +COPY $MODULE_DIR/conf /testrun/conf # Copy over all binary files -COPY network/modules/dns/bin /testrun/bin +COPY $MODULE_DIR/bin /testrun/bin diff --git a/net_orc/network/modules/gateway/bin/start_network_service b/modules/network/gateway/bin/start_network_service similarity index 100% rename from net_orc/network/modules/gateway/bin/start_network_service rename to modules/network/gateway/bin/start_network_service diff --git a/net_orc/network/modules/gateway/conf/module_config.json b/modules/network/gateway/conf/module_config.json similarity index 100% rename from net_orc/network/modules/gateway/conf/module_config.json rename to modules/network/gateway/conf/module_config.json diff --git a/net_orc/network/modules/gateway/gateway.Dockerfile b/modules/network/gateway/gateway.Dockerfile similarity index 59% rename from net_orc/network/modules/gateway/gateway.Dockerfile rename to modules/network/gateway/gateway.Dockerfile index b7085ebac..9bfa77dae 100644 --- a/net_orc/network/modules/gateway/gateway.Dockerfile +++ b/modules/network/gateway/gateway.Dockerfile @@ -1,11 +1,14 @@ # Image name: test-run/gateway FROM test-run/base:latest +ARG MODULE_NAME=gateway +ARG MODULE_DIR=modules/network/$MODULE_NAME + # Install required packages RUN apt-get install -y iptables isc-dhcp-client # Copy over all configuration files -COPY network/modules/gateway/conf /testrun/conf +COPY $MODULE_DIR/conf /testrun/conf # Copy over all binary files -COPY network/modules/gateway/bin /testrun/bin +COPY $MODULE_DIR/bin /testrun/bin diff --git a/net_orc/network/modules/ntp/bin/start_network_service b/modules/network/ntp/bin/start_network_service similarity index 82% rename from net_orc/network/modules/ntp/bin/start_network_service rename to modules/network/ntp/bin/start_network_service index 4c0c5dc74..b20cf8831 100644 --- a/net_orc/network/modules/ntp/bin/start_network_service +++ b/modules/network/ntp/bin/start_network_service @@ -7,7 +7,7 @@ echo Starting ntp #Create and set permissions on the log file touch $LOG_FILE -chown $HOST_USER:$HOST_USER $LOG_FILE +chown $HOST_USER $LOG_FILE #Start the NTP server python3 -u $PYTHON_SRC_DIR/ntp_server.py > $LOG_FILE diff --git a/net_orc/network/modules/ntp/conf/module_config.json b/modules/network/ntp/conf/module_config.json similarity index 100% rename from net_orc/network/modules/ntp/conf/module_config.json rename to modules/network/ntp/conf/module_config.json diff --git a/modules/network/ntp/ntp.Dockerfile b/modules/network/ntp/ntp.Dockerfile new file mode 100644 index 000000000..1add3178e --- /dev/null +++ b/modules/network/ntp/ntp.Dockerfile @@ -0,0 +1,16 @@ +# Image name: test-run/ntp +FROM test-run/base:latest + +ARG MODULE_NAME=ntp +ARG MODULE_DIR=modules/network/$MODULE_NAME + +# Copy over all configuration files +COPY $MODULE_DIR/conf /testrun/conf + +# Copy over all binary files +COPY $MODULE_DIR/bin /testrun/bin + +# Copy over all python files +COPY $MODULE_DIR/python /testrun/python + +EXPOSE 123/udp diff --git a/net_orc/network/modules/ntp/python/src/ntp_server.py b/modules/network/ntp/python/src/ntp_server.py similarity index 100% rename from net_orc/network/modules/ntp/python/src/ntp_server.py rename to modules/network/ntp/python/src/ntp_server.py diff --git a/net_orc/network/modules/radius/bin/start_network_service b/modules/network/radius/bin/start_network_service similarity index 89% rename from net_orc/network/modules/radius/bin/start_network_service rename to modules/network/radius/bin/start_network_service index e27a828dd..399a90ae5 100644 --- a/net_orc/network/modules/radius/bin/start_network_service +++ b/modules/network/radius/bin/start_network_service @@ -15,6 +15,6 @@ python3 -u $PYTHON_SRC_DIR/authenticator.py & #Create and set permissions on the log file touch $LOG_FILE -chown $HOST_USER:$HOST_USER $LOG_FILE +chown $HOST_USER $LOG_FILE freeradius -f -X &> $LOG_FILE \ No newline at end of file diff --git a/net_orc/network/modules/radius/conf/ca.crt b/modules/network/radius/conf/ca.crt similarity index 100% rename from net_orc/network/modules/radius/conf/ca.crt rename to modules/network/radius/conf/ca.crt diff --git a/net_orc/network/modules/radius/conf/eap b/modules/network/radius/conf/eap similarity index 100% rename from net_orc/network/modules/radius/conf/eap rename to modules/network/radius/conf/eap diff --git a/net_orc/network/modules/radius/conf/module_config.json b/modules/network/radius/conf/module_config.json similarity index 100% rename from net_orc/network/modules/radius/conf/module_config.json rename to modules/network/radius/conf/module_config.json diff --git a/net_orc/network/modules/radius/python/requirements.txt b/modules/network/radius/python/requirements.txt similarity index 100% rename from net_orc/network/modules/radius/python/requirements.txt rename to modules/network/radius/python/requirements.txt diff --git a/net_orc/network/modules/radius/python/src/authenticator.py b/modules/network/radius/python/src/authenticator.py similarity index 100% rename from net_orc/network/modules/radius/python/src/authenticator.py rename to modules/network/radius/python/src/authenticator.py diff --git a/net_orc/network/modules/radius/radius.Dockerfile b/modules/network/radius/radius.Dockerfile similarity index 74% rename from net_orc/network/modules/radius/radius.Dockerfile rename to modules/network/radius/radius.Dockerfile index a72313826..c44c5f0cc 100644 --- a/net_orc/network/modules/radius/radius.Dockerfile +++ b/modules/network/radius/radius.Dockerfile @@ -1,6 +1,9 @@ # Image name: test-run/radius FROM test-run/base:latest +ARG MODULE_NAME=radius +ARG MODULE_DIR=modules/network/$MODULE_NAME + # Install radius and git RUN apt-get update && apt-get install -y openssl freeradius git @@ -14,13 +17,13 @@ EXPOSE 1812/udp EXPOSE 1813/udp # Copy over all configuration files -COPY network/modules/radius/conf /testrun/conf +COPY $MODULE_DIR/conf /testrun/conf # Copy over all binary files -COPY network/modules/radius/bin /testrun/bin +COPY $MODULE_DIR/bin /testrun/bin # Copy over all python files -COPY network/modules/radius/python /testrun/python +COPY $MODULE_DIR/python /testrun/python # Install all python requirements for the module RUN pip3 install -r /testrun/python/requirements.txt \ No newline at end of file diff --git a/net_orc/network/modules/template/bin/start_network_service b/modules/network/template/bin/start_network_service similarity index 100% rename from net_orc/network/modules/template/bin/start_network_service rename to modules/network/template/bin/start_network_service diff --git a/net_orc/network/modules/template/conf/module_config.json b/modules/network/template/conf/module_config.json similarity index 91% rename from net_orc/network/modules/template/conf/module_config.json rename to modules/network/template/conf/module_config.json index c767c9ad6..e702e1804 100644 --- a/net_orc/network/modules/template/conf/module_config.json +++ b/modules/network/template/conf/module_config.json @@ -15,6 +15,7 @@ }, "docker": { "enable_container": false, + "template":true, "depends_on": "base", "mounts": [ { diff --git a/net_orc/network/modules/template/python/src/template_main.py b/modules/network/template/python/src/template_main.py similarity index 100% rename from net_orc/network/modules/template/python/src/template_main.py rename to modules/network/template/python/src/template_main.py diff --git a/modules/network/template/template.Dockerfile b/modules/network/template/template.Dockerfile new file mode 100644 index 000000000..9efbfb230 --- /dev/null +++ b/modules/network/template/template.Dockerfile @@ -0,0 +1,14 @@ +# Image name: test-run/template +FROM test-run/base:latest + +ARG MODULE_NAME=template +ARG MODULE_DIR=modules/network/$MODULE_NAME + +# Copy over all configuration files +COPY $MODULE_DIR/conf /testrun/conf + +# Copy over all binary files +COPY $MODULE_DIR/bin /testrun/bin + +# Copy over all python files +COPY $MODULE_DIR/python /testrun/python \ No newline at end of file diff --git a/test_orc/modules/base/base.Dockerfile b/modules/test/base/base.Dockerfile similarity index 74% rename from test_orc/modules/base/base.Dockerfile rename to modules/test/base/base.Dockerfile index a508caef7..b8398eae9 100644 --- a/test_orc/modules/base/base.Dockerfile +++ b/modules/test/base/base.Dockerfile @@ -1,17 +1,20 @@ # Image name: test-run/base-test FROM ubuntu:jammy +ARG MODULE_NAME=base +ARG MODULE_DIR=modules/test/$MODULE_NAME + # Install common software RUN apt-get update && apt-get install -y net-tools iputils-ping tcpdump iproute2 jq python3 python3-pip dos2unix nmap --fix-missing # Setup the base python requirements -COPY modules/base/python /testrun/python +COPY $MODULE_DIR/python /testrun/python # Install all python requirements for the module RUN pip3 install -r /testrun/python/requirements.txt -# Add the bin files -COPY modules/base/bin /testrun/bin +# Copy over all binary files +COPY $MODULE_DIR/bin /testrun/bin # Remove incorrect line endings RUN dos2unix /testrun/bin/* diff --git a/test_orc/modules/base/bin/capture b/modules/test/base/bin/capture similarity index 88% rename from test_orc/modules/base/bin/capture rename to modules/test/base/bin/capture index facb6acf7..45cfcd42f 100644 --- a/test_orc/modules/base/bin/capture +++ b/modules/test/base/bin/capture @@ -12,7 +12,7 @@ INTERFACE=$2 # Create the output directory and start the capture mkdir -p $PCAP_DIR -chown $HOST_USER:$HOST_USER $PCAP_DIR +chown $HOST_USER $PCAP_DIR tcpdump -i $INTERFACE -w $PCAP_DIR/$PCAP_FILE -Z $HOST_USER & # Small pause to let the capture to start diff --git a/test_orc/modules/base/bin/get_ipv4_addr b/modules/test/base/bin/get_ipv4_addr similarity index 100% rename from test_orc/modules/base/bin/get_ipv4_addr rename to modules/test/base/bin/get_ipv4_addr diff --git a/test_orc/modules/base/bin/setup_binaries b/modules/test/base/bin/setup_binaries similarity index 100% rename from test_orc/modules/base/bin/setup_binaries rename to modules/test/base/bin/setup_binaries diff --git a/test_orc/modules/base/bin/start_grpc b/modules/test/base/bin/start_grpc similarity index 100% rename from test_orc/modules/base/bin/start_grpc rename to modules/test/base/bin/start_grpc diff --git a/test_orc/modules/base/bin/start_module b/modules/test/base/bin/start_module similarity index 97% rename from test_orc/modules/base/bin/start_module rename to modules/test/base/bin/start_module index c179668ba..3e4737d8b 100644 --- a/test_orc/modules/base/bin/start_module +++ b/modules/test/base/bin/start_module @@ -15,7 +15,7 @@ IFACE=veth0 useradd $HOST_USER # Set permissions on the output files -chown -R $HOST_USER:$HOST_USER $OUTPUT_DIR +chown -R $HOST_USER $OUTPUT_DIR # Enable IPv6 for all containers sysctl net.ipv6.conf.all.disable_ipv6=0 diff --git a/test_orc/modules/base/bin/wait_for_interface b/modules/test/base/bin/wait_for_interface similarity index 100% rename from test_orc/modules/base/bin/wait_for_interface rename to modules/test/base/bin/wait_for_interface diff --git a/test_orc/modules/base/conf/module_config.json b/modules/test/base/conf/module_config.json similarity index 100% rename from test_orc/modules/base/conf/module_config.json rename to modules/test/base/conf/module_config.json diff --git a/test_orc/modules/base/python/requirements.txt b/modules/test/base/python/requirements.txt similarity index 100% rename from test_orc/modules/base/python/requirements.txt rename to modules/test/base/python/requirements.txt diff --git a/test_orc/modules/base/python/src/grpc/start_server.py b/modules/test/base/python/src/grpc/start_server.py similarity index 100% rename from test_orc/modules/base/python/src/grpc/start_server.py rename to modules/test/base/python/src/grpc/start_server.py diff --git a/test_orc/modules/base/python/src/logger.py b/modules/test/base/python/src/logger.py similarity index 100% rename from test_orc/modules/base/python/src/logger.py rename to modules/test/base/python/src/logger.py diff --git a/test_orc/modules/base/python/src/test_module.py b/modules/test/base/python/src/test_module.py similarity index 100% rename from test_orc/modules/base/python/src/test_module.py rename to modules/test/base/python/src/test_module.py diff --git a/test_orc/modules/base/python/src/util.py b/modules/test/base/python/src/util.py similarity index 100% rename from test_orc/modules/base/python/src/util.py rename to modules/test/base/python/src/util.py diff --git a/modules/test/baseline/baseline.Dockerfile b/modules/test/baseline/baseline.Dockerfile new file mode 100644 index 000000000..c2b32e7b7 --- /dev/null +++ b/modules/test/baseline/baseline.Dockerfile @@ -0,0 +1,14 @@ +# Image name: test-run/baseline-test +FROM test-run/base-test:latest + +ARG MODULE_NAME=baseline +ARG MODULE_DIR=modules/test/$MODULE_NAME + +# Copy over all configuration files +COPY $MODULE_DIR/conf /testrun/conf + +# Copy over all binary files +COPY $MODULE_DIR/bin /testrun/bin + +# Copy over all python files +COPY $MODULE_DIR/python /testrun/python \ No newline at end of file diff --git a/test_orc/modules/baseline/bin/start_test_module b/modules/test/baseline/bin/start_test_module similarity index 90% rename from test_orc/modules/baseline/bin/start_test_module rename to modules/test/baseline/bin/start_test_module index 2938eb0f8..a09349cf9 100644 --- a/test_orc/modules/baseline/bin/start_test_module +++ b/modules/test/baseline/bin/start_test_module @@ -31,8 +31,8 @@ LOG_FILE=/runtime/output/$MODULE_NAME.log RESULT_FILE=/runtime/output/$MODULE_NAME-result.json touch $LOG_FILE touch $RESULT_FILE -chown $HOST_USER:$HOST_USER $LOG_FILE -chown $HOST_USER:$HOST_USER $RESULT_FILE +chown $HOST_USER $LOG_FILE +chown $HOST_USER $RESULT_FILE # Run the python scrip that will execute the tests for this module # -u flag allows python print statements diff --git a/test_orc/modules/baseline/conf/module_config.json b/modules/test/baseline/conf/module_config.json similarity index 100% rename from test_orc/modules/baseline/conf/module_config.json rename to modules/test/baseline/conf/module_config.json diff --git a/test_orc/modules/baseline/python/src/baseline_module.py b/modules/test/baseline/python/src/baseline_module.py similarity index 100% rename from test_orc/modules/baseline/python/src/baseline_module.py rename to modules/test/baseline/python/src/baseline_module.py diff --git a/test_orc/modules/baseline/python/src/run.py b/modules/test/baseline/python/src/run.py similarity index 100% rename from test_orc/modules/baseline/python/src/run.py rename to modules/test/baseline/python/src/run.py diff --git a/test_orc/modules/conn/bin/start_test_module b/modules/test/conn/bin/start_test_module similarity index 92% rename from test_orc/modules/conn/bin/start_test_module rename to modules/test/conn/bin/start_test_module index 4550849ce..8290c0764 100644 --- a/test_orc/modules/conn/bin/start_test_module +++ b/modules/test/conn/bin/start_test_module @@ -28,8 +28,8 @@ LOG_FILE=/runtime/output/$MODULE_NAME.log RESULT_FILE=/runtime/output/$MODULE_NAME-result.json touch $LOG_FILE touch $RESULT_FILE -chown $HOST_USER:$HOST_USER $LOG_FILE -chown $HOST_USER:$HOST_USER $RESULT_FILE +chown $HOST_USER $LOG_FILE +chown $HOST_USER $RESULT_FILE # Run the python scrip that will execute the tests for this module # -u flag allows python print statements diff --git a/test_orc/modules/conn/conf/module_config.json b/modules/test/conn/conf/module_config.json similarity index 100% rename from test_orc/modules/conn/conf/module_config.json rename to modules/test/conn/conf/module_config.json diff --git a/test_orc/modules/conn/conn.Dockerfile b/modules/test/conn/conn.Dockerfile similarity index 59% rename from test_orc/modules/conn/conn.Dockerfile rename to modules/test/conn/conn.Dockerfile index cf25d0f02..2526b0046 100644 --- a/test_orc/modules/conn/conn.Dockerfile +++ b/modules/test/conn/conn.Dockerfile @@ -1,6 +1,9 @@ # Image name: test-run/conn-test FROM test-run/base-test:latest +ARG MODULE_NAME=conn +ARG MODULE_DIR=modules/test/$MODULE_NAME + # Install all necessary packages RUN apt-get install -y wget @@ -8,16 +11,16 @@ RUN apt-get install -y wget RUN wget http://standards-oui.ieee.org/oui.txt -P /usr/local/etc/ #Load the requirements file -COPY modules/conn/python/requirements.txt /testrun/python +COPY $MODULE_DIR/python/requirements.txt /testrun/python #Install all python requirements for the module RUN pip3 install -r /testrun/python/requirements.txt # Copy over all configuration files -COPY modules/conn/conf /testrun/conf +COPY $MODULE_DIR/conf /testrun/conf -# Load device binary files -COPY modules/conn/bin /testrun/bin +# Copy over all binary files +COPY $MODULE_DIR/bin /testrun/bin # Copy over all python files -COPY modules/conn/python /testrun/python +COPY $MODULE_DIR/python /testrun/python diff --git a/test_orc/modules/conn/python/requirements.txt b/modules/test/conn/python/requirements.txt similarity index 100% rename from test_orc/modules/conn/python/requirements.txt rename to modules/test/conn/python/requirements.txt diff --git a/test_orc/modules/conn/python/src/connection_module.py b/modules/test/conn/python/src/connection_module.py similarity index 100% rename from test_orc/modules/conn/python/src/connection_module.py rename to modules/test/conn/python/src/connection_module.py diff --git a/test_orc/modules/conn/python/src/run.py b/modules/test/conn/python/src/run.py similarity index 100% rename from test_orc/modules/conn/python/src/run.py rename to modules/test/conn/python/src/run.py diff --git a/test_orc/modules/dns/bin/start_test_module b/modules/test/dns/bin/start_test_module similarity index 90% rename from test_orc/modules/dns/bin/start_test_module rename to modules/test/dns/bin/start_test_module index 2938eb0f8..a09349cf9 100644 --- a/test_orc/modules/dns/bin/start_test_module +++ b/modules/test/dns/bin/start_test_module @@ -31,8 +31,8 @@ LOG_FILE=/runtime/output/$MODULE_NAME.log RESULT_FILE=/runtime/output/$MODULE_NAME-result.json touch $LOG_FILE touch $RESULT_FILE -chown $HOST_USER:$HOST_USER $LOG_FILE -chown $HOST_USER:$HOST_USER $RESULT_FILE +chown $HOST_USER $LOG_FILE +chown $HOST_USER $RESULT_FILE # Run the python scrip that will execute the tests for this module # -u flag allows python print statements diff --git a/test_orc/modules/dns/conf/module_config.json b/modules/test/dns/conf/module_config.json similarity index 100% rename from test_orc/modules/dns/conf/module_config.json rename to modules/test/dns/conf/module_config.json diff --git a/modules/test/dns/dns.Dockerfile b/modules/test/dns/dns.Dockerfile new file mode 100644 index 000000000..f831d0e2b --- /dev/null +++ b/modules/test/dns/dns.Dockerfile @@ -0,0 +1,14 @@ +# Image name: test-run/conn-test +FROM test-run/base-test:latest + +ARG MODULE_NAME=dns +ARG MODULE_DIR=modules/test/$MODULE_NAME + +# Copy over all configuration files +COPY $MODULE_DIR/conf /testrun/conf + +# Copy over all binary files +COPY $MODULE_DIR/bin /testrun/bin + +# Copy over all python files +COPY $MODULE_DIR/python /testrun/python \ No newline at end of file diff --git a/test_orc/modules/dns/python/src/dns_module.py b/modules/test/dns/python/src/dns_module.py similarity index 100% rename from test_orc/modules/dns/python/src/dns_module.py rename to modules/test/dns/python/src/dns_module.py diff --git a/test_orc/modules/dns/python/src/run.py b/modules/test/dns/python/src/run.py similarity index 100% rename from test_orc/modules/dns/python/src/run.py rename to modules/test/dns/python/src/run.py diff --git a/test_orc/modules/nmap/bin/start_test_module b/modules/test/nmap/bin/start_test_module similarity index 93% rename from test_orc/modules/nmap/bin/start_test_module rename to modules/test/nmap/bin/start_test_module index 4bb7e9f96..333566342 100644 --- a/test_orc/modules/nmap/bin/start_test_module +++ b/modules/test/nmap/bin/start_test_module @@ -31,8 +31,8 @@ LOG_FILE=/runtime/output/$MODULE_NAME.log RESULT_FILE=/runtime/output/$MODULE_NAME-result.json touch $LOG_FILE touch $RESULT_FILE -chown $HOST_USER:$HOST_USER $LOG_FILE -chown $HOST_USER:$HOST_USER $RESULT_FILE +chown $HOST_USER $LOG_FILE +chown $HOST_USER $RESULT_FILE # Run the python scrip that will execute the tests for this module # -u flag allows python print statements diff --git a/test_orc/modules/nmap/conf/module_config.json b/modules/test/nmap/conf/module_config.json similarity index 100% rename from test_orc/modules/nmap/conf/module_config.json rename to modules/test/nmap/conf/module_config.json diff --git a/modules/test/nmap/nmap.Dockerfile b/modules/test/nmap/nmap.Dockerfile new file mode 100644 index 000000000..c1a2f96ce --- /dev/null +++ b/modules/test/nmap/nmap.Dockerfile @@ -0,0 +1,20 @@ +# Image name: test-run/nmap-test +FROM test-run/base-test:latest + +ARG MODULE_NAME=nmap +ARG MODULE_DIR=modules/test/$MODULE_NAME + +#Load the requirements file +COPY $MODULE_DIR/python/requirements.txt /testrun/python + +#Install all python requirements for the module +RUN pip3 install -r /testrun/python/requirements.txt + +# Copy over all configuration files +COPY $MODULE_DIR/conf /testrun/conf + +# Copy over all binary files +COPY $MODULE_DIR/bin /testrun/bin + +# Copy over all python files +COPY $MODULE_DIR/python /testrun/python \ No newline at end of file diff --git a/test_orc/modules/nmap/python/requirements.txt b/modules/test/nmap/python/requirements.txt similarity index 100% rename from test_orc/modules/nmap/python/requirements.txt rename to modules/test/nmap/python/requirements.txt diff --git a/test_orc/modules/nmap/python/src/nmap_module.py b/modules/test/nmap/python/src/nmap_module.py similarity index 100% rename from test_orc/modules/nmap/python/src/nmap_module.py rename to modules/test/nmap/python/src/nmap_module.py diff --git a/test_orc/modules/nmap/python/src/run.py b/modules/test/nmap/python/src/run.py similarity index 100% rename from test_orc/modules/nmap/python/src/run.py rename to modules/test/nmap/python/src/run.py diff --git a/net_orc/.gitignore b/net_orc/.gitignore deleted file mode 100644 index 2d77147eb..000000000 --- a/net_orc/.gitignore +++ /dev/null @@ -1,133 +0,0 @@ -# Runtime folder -runtime/ -.vscode/ - -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -pip-wheel-metadata/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -.python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ diff --git a/net_orc/network/modules/ntp/ntp.Dockerfile b/net_orc/network/modules/ntp/ntp.Dockerfile deleted file mode 100644 index 3474a504e..000000000 --- a/net_orc/network/modules/ntp/ntp.Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -# Image name: test-run/ntp -FROM test-run/base:latest - -# Copy over all configuration files -COPY network/modules/ntp/conf /testrun/conf - -# Copy over all binary files -COPY network/modules/ntp/bin /testrun/bin - -# Copy over all python files -COPY network/modules/ntp/python /testrun/python - -EXPOSE 123/udp diff --git a/net_orc/network/modules/template/template.Dockerfile b/net_orc/network/modules/template/template.Dockerfile deleted file mode 100644 index 45f9da6d9..000000000 --- a/net_orc/network/modules/template/template.Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -# Image name: test-run/template -FROM test-run/base:latest - -# Copy over all configuration files -COPY network/modules/template/conf /testrun/conf - -# Load device binary files -COPY network/modules/template/bin /testrun/bin - -# Copy over all python files -COPY network/modules/template/python /testrun/python \ No newline at end of file diff --git a/net_orc/orchestrator.Dockerfile b/net_orc/orchestrator.Dockerfile deleted file mode 100644 index f062a33d4..000000000 --- a/net_orc/orchestrator.Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -# Image name: test-run/orchestrator -FROM test-run/base:latest - -#Update and get all additional requirements not contained in the base image -RUN apt-get update - -RUN apt-get install -y python3-pip curl openvswitch-switch - -#Download and install docker client -ENV DOCKERVERSION=20.10.2 -RUN curl -fsSLO https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKERVERSION}.tgz \ - && tar xzvf docker-${DOCKERVERSION}.tgz --strip 1 -C /usr/local/bin docker/docker \ - && rm docker-${DOCKERVERSION}.tgz - -#Create a directory to load all the app files into -RUN mkdir /python - -#Load the requirements file -COPY python/requirements.txt /python - -#Install all python requirements for the module -RUN pip3 install -r python/requirements.txt diff --git a/net_orc/python/requirements.txt b/net_orc/python/requirements.txt deleted file mode 100644 index 5d8f29214..000000000 --- a/net_orc/python/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -docker -ipaddress -netifaces -scapy \ No newline at end of file diff --git a/test_orc/modules/baseline/baseline.Dockerfile b/test_orc/modules/baseline/baseline.Dockerfile deleted file mode 100644 index 5b634e6ee..000000000 --- a/test_orc/modules/baseline/baseline.Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -# Image name: test-run/baseline-test -FROM test-run/base-test:latest - -# Copy over all configuration files -COPY modules/baseline/conf /testrun/conf - -# Load device binary files -COPY modules/baseline/bin /testrun/bin - -# Copy over all python files -COPY modules/baseline/python /testrun/python \ No newline at end of file diff --git a/test_orc/modules/dns/dns.Dockerfile b/test_orc/modules/dns/dns.Dockerfile deleted file mode 100644 index 7c3497bc3..000000000 --- a/test_orc/modules/dns/dns.Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -# Image name: test-run/baseline-test -FROM test-run/base-test:latest - -# Copy over all configuration files -COPY modules/dns/conf /testrun/conf - -# Load device binary files -COPY modules/dns/bin /testrun/bin - -# Copy over all python files -COPY modules/dns/python /testrun/python \ No newline at end of file diff --git a/test_orc/modules/nmap/nmap.Dockerfile b/test_orc/modules/nmap/nmap.Dockerfile deleted file mode 100644 index 3a8728d9f..000000000 --- a/test_orc/modules/nmap/nmap.Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -# Image name: test-run/baseline-test -FROM test-run/base-test:latest - -#Load the requirements file -COPY modules/nmap/python/requirements.txt /testrun/python - -#Install all python requirements for the module -RUN pip3 install -r /testrun/python/requirements.txt - -# Copy over all configuration files -COPY modules/nmap/conf /testrun/conf - -# Load device binary files -COPY modules/nmap/bin /testrun/bin - -# Copy over all python files -COPY modules/nmap/python /testrun/python \ No newline at end of file diff --git a/test_orc/python/requirements.txt b/test_orc/python/requirements.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/testing/test_baseline b/testing/test_baseline index d7fc1e5c5..bf191b88f 100755 --- a/testing/test_baseline +++ b/testing/test_baseline @@ -3,6 +3,8 @@ TESTRUN_OUT=/tmp/testrun.log +ifconfig + # Setup requirements sudo apt-get update sudo apt-get install openvswitch-common openvswitch-switch tcpdump jq moreutils coreutils @@ -18,9 +20,6 @@ sudo docker network create -d macvlan -o parent=endev0b endev0 # Start OVS sudo /usr/share/openvswitch/scripts/ovs-ctl start -# Fix due to ordering -sudo docker build ./net_orc/ -t test-run/base -f net_orc/network/modules/base/base.Dockerfile - # Build Test Container sudo docker build ./testing/docker/ci_baseline -t ci1 -f ./testing/docker/ci_baseline/Dockerfile