Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions config/target_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@
"qemu_num_cores": 2,
"qemu_ram_size": "1G"
},
"safety_processor": {
"name": "S_CORE_ECU_QEMU_BRIDGE_NETWORK_SC",
"ip_address": "192.168.122.76",
"diagnostic_ip_address": "192.168.122.76",
"diagnostic_address": "0x90",
"serial_device": "",
"use_doip": true
},
"other_processors": {}
},
"S_CORE_ECU_QEMU_PORT_FORWARDING": {
Expand All @@ -37,14 +29,6 @@
"qemu_num_cores": 2,
"qemu_ram_size": "1G"
},
"safety_processor": {
"name": "CORE_ECU_QEMU_PORT_FORWARDING_SC",
"ip_address": "localhost",
"diagnostic_ip_address": "localhost",
"diagnostic_address": "0x90",
"serial_device": "",
"use_doip": true
},
"other_processors": {}
}
}
38 changes: 6 additions & 32 deletions itf/core/base/base_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
from itf.core.base.target.config import load_configuration, target_ecu_argparse
from itf.core.base.os.operating_system import OperatingSystem
from itf.core.base.target.qemu_target import qemu_target
from itf.core.base.target.qvp_target import qvp_target
from itf.core.base.target.hw_target import hw_target
from itf.core.base.utils.exec_utils import pre_tests_phase, post_tests_phase
from itf.core.utils import padder
from itf.core.utils.bunch import Bunch
Expand Down Expand Up @@ -56,9 +54,6 @@ def pytest_addoption(parser):
parser.addoption("--qemu", action="store_true", help="Run tests with QEMU image")
parser.addoption("--qemu_image", action="store", help="Path to a QEMU image")

parser.addoption("--qvp", action="store_true", help="Run tests with QVP")
parser.addoption("--hw", action="store_true", help="Run tests against connected HW")


@pytest.hookimpl(hookwrapper=True, tryfirst=True)
def pytest_sessionstart(session):
Expand Down Expand Up @@ -92,31 +87,12 @@ def target_fixture(target_config_fixture, test_config_fixture, request, dlt_conf
multicast_ips=dlt_config.multicast_ips,
binary_path=dlt_config.dlt_receive_path,
):
if test_config_fixture.qemu:
with qemu_target(target_config_fixture, test_config_fixture) as qemu:
try:
pre_tests_phase(qemu, target_config_fixture.ip_address, test_config_fixture, request)
yield qemu
finally:
post_tests_phase(qemu, test_config_fixture)

elif test_config_fixture.qvp:
with qvp_target(target_config_fixture, test_config_fixture) as qvp:
try:
pre_tests_phase(qvp, target_config_fixture.ip_address, test_config_fixture, request)
yield qvp
finally:
post_tests_phase(qvp, test_config_fixture)

elif test_config_fixture.hw:
with hw_target(target_config_fixture, test_config_fixture) as hardware:
try:
pre_tests_phase(hardware, target_config_fixture.ip_address, test_config_fixture, request)
yield hardware
finally:
post_tests_phase(hardware, test_config_fixture)
else:
raise RuntimeError("QEMU, QVP or HW not specified to use")
with qemu_target(target_config_fixture, test_config_fixture) as qemu:
try:
pre_tests_phase(qemu, target_config_fixture.ip_address, test_config_fixture, request)
yield qemu
finally:
post_tests_phase(qemu, test_config_fixture)


def __make_test_config(config):
Expand All @@ -126,8 +102,6 @@ def __make_test_config(config):
os=config.getoption("os"),
qemu=config.getoption("qemu"),
qemu_image=config.getoption("qemu_image"),
qvp=config.getoption("qvp"),
hw=config.getoption("hw"),
)


Expand Down
2 changes: 0 additions & 2 deletions itf/core/base/target/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ py_library(
srcs = [
"__init__.py",
"base_target.py",
"hw_target.py",
"qemu_target.py",
"qvp_target.py",
],
imports = ["."],
visibility = ["//visibility:public"],
Expand Down
16 changes: 0 additions & 16 deletions itf/core/base/target/base_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import logging

from itf.core.base.target.processors.target_processor import TargetProcessor
from itf.core.base.target.processors.safety_processor import TargetSafetyProcessor
from itf.core.base.os.operating_system import OperatingSystem
from itf.core.base.target.config.ecu import Ecu

Expand All @@ -38,7 +37,6 @@ def __init__(
self.__target_ecu = target_ecu
self.__target_sut_os = target_sut_os
self.__sut = None
self.__safety_core = None
# Other processors
for other_ecu in self.target_ecu.others:
setattr(self, other_ecu.name.lower(), None) # Will be set when registering processors
Expand All @@ -60,12 +58,6 @@ def register_processors(self, process=None, initialize_serial_device=True, initi
)
self.__processors.append(self.sut)

self.__safety_core = TargetSafetyProcessor(
self.__target_ecu.sc,
OperatingSystem.UNSPECIFIED,
diagnostic_ip=self.__diagnostic_ip,
)

for processor in self.target_ecu.others:
other_processor = TargetProcessor(processor, OperatingSystem.UNSPECIFIED)
self.__processors.append(other_processor)
Expand All @@ -91,14 +83,6 @@ def sut(self):
def sut(self, value):
self.__sut = value

@property
def safety_core(self):
return self.__safety_core

@safety_core.setter
def safety_core(self, value):
self.__safety_core = value

@property
def processors(self):
return self.__processors
Expand Down
1 change: 0 additions & 1 deletion itf/core/base/target/config/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ py_library(
"config.py",
"ecu.py",
"performance_processor.py",
"safety_processor.py",
],
imports = ["."],
visibility = ["//visibility:public"],
Expand Down
1 change: 0 additions & 1 deletion itf/core/base/target/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@

from .config import ECUS
from .config import PERFORMANCE_PROCESSORS
from .config import SAFETY_PROCESSORS
from .config import OTHER_PROCESSORS
17 changes: 0 additions & 17 deletions itf/core/base/target/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@

from itf.core.base.target.config.base_processor import BaseProcessor
from itf.core.base.target.config.performance_processor import PerformanceProcessor
from itf.core.base.target.config.safety_processor import SafetyProcessor
from itf.core.base.target.config.ecu import Ecu


logger = logging.getLogger(__name__)

PERFORMANCE_PROCESSORS = {}
SAFETY_PROCESSORS = {}
OTHER_PROCESSORS = {}
ECUS = {}

Expand Down Expand Up @@ -55,20 +53,6 @@ def load_configuration(config_file: str):
)
PERFORMANCE_PROCESSORS[perf_config["name"]] = performance_processor

safety_processor = None
if "safety_processor" in ecu_config:
safety_config = ecu_config.get("safety_processor")
safety_processor = SafetyProcessor(
name=safety_config["name"],
ip_address=safety_config["ip_address"],
diagnostic_ip_address=safety_config["diagnostic_ip_address"],
diagnostic_address=int(safety_config["diagnostic_address"], 16),
serial_device=safety_config["serial_device"],
use_doip=safety_config.get("use_doip", False),
params=safety_config.get("params", {}),
)
SAFETY_PROCESSORS[safety_config["name"]] = safety_processor

other_processors = []
for other_name, other_config in ecu_config.get("other_processors", {}).items():
other_processor = BaseProcessor(
Expand All @@ -86,7 +70,6 @@ def load_configuration(config_file: str):
ECUS[ecu_name] = Ecu(
name=ecu_name,
sut=performance_processor,
sc=safety_processor,
others=other_processors,
)

Expand Down
8 changes: 0 additions & 8 deletions itf/core/base/target/config/ecu.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from typing import List
from itf.core.base.target.config.base_processor import BaseProcessor
from itf.core.base.target.config.performance_processor import PerformanceProcessor
from itf.core.base.target.config.safety_processor import SafetyProcessor


class Ecu:
Expand All @@ -22,19 +21,16 @@ def __init__(
self,
name: str,
sut: PerformanceProcessor,
sc: SafetyProcessor,
others: List[BaseProcessor] = [],
):
"""Initialize the Ecu class.

:param str name: The name of the ECU.
:param sut: The SUT (Software Under Test) processor.
:param sc: The Safety Controller processor.
:param others: A list of other processors associated with the ECU.
"""
self.__name = name
self.__sut = sut
self.__sc = sc
self.__others = others

@property
Expand All @@ -45,10 +41,6 @@ def name(self):
def sut(self):
return self.__sut

@property
def sc(self): # pylint: disable=invalid-name
return self.__sc

@property
def others(self):
return self.__others
Expand Down
29 changes: 0 additions & 29 deletions itf/core/base/target/hw_target.py

This file was deleted.

2 changes: 0 additions & 2 deletions itf/core/base/target/processors/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ py_library(
srcs = [
"__init__.py",
"qemu_processor.py",
"qvp_processor.py",
"safety_processor.py",
"target_processor.py",
],
imports = ["."],
Expand Down
27 changes: 0 additions & 27 deletions itf/core/base/target/processors/qvp_processor.py

This file was deleted.

54 changes: 0 additions & 54 deletions itf/core/base/target/qvp_target.py

This file was deleted.