diff --git a/services/core/DNP3OutstationAgent/README.md b/services/core/DNP3OutstationAgent/README.md index 048ef93416..5938674930 100644 --- a/services/core/DNP3OutstationAgent/README.md +++ b/services/core/DNP3OutstationAgent/README.md @@ -297,3 +297,32 @@ shown in the "Master Operation MENU" and should be self-explanatory. Here we can Note: [run_dnp3_outstation_agent_script.py](demo-scripts/run_dnp3_outstation_agent_script.py) script is a wrapper on the dnp3demo outstation submodle. For details about the interactive dnp3 station operations, please refer to [dnp3demo-Module.md](https://github.com/VOLTTRON/dnp3-python/blob/develop/docs/dnp3demo-Module.md) + +# Run Tests + +1. Install volttron testing dependencies + ```shell + (volttron) $ python bootstrap.py --testing + UPDATE: ['testing'] + Installing required packages + + pip install --upgrade --no-deps wheel==0.30 + Requirement already satisfied: wheel==0.30 in ./env/lib/python3.10/site-packages (0.30.0) + + pip install --upgrade --install-option --zmq=bundled --no-deps pyzmq==22.2.1 + WARNING: Disabling all use of wheels due to the use of --build-option / --global-option / --install-option. + ... + ``` + +1. Run pytest + ```shell + (volttron) $ pytest services/core/DNP3OutstationAgent/tests/. + ===================================================================================================== test session starts ===================================================================================================== + platform linux -- Python 3.10.6, pytest-7.1.2, pluggy-1.0.0 -- /home/kefei/project/volttron/env/bin/python + cachedir: .pytest_cache + rootdir: /home/kefei/project/volttron, configfile: pytest.ini + plugins: rerunfailures-10.2, asyncio-0.19.0, timeout-2.1.0 + asyncio: mode=auto + timeout: 300.0s + timeout method: signal + timeout func_only: False + collected 40 items + ``` diff --git a/services/core/DNP3OutstationAgent/tests/test_dnp3_agent.py b/services/core/DNP3OutstationAgent/tests/test_dnp3_agent.py index 668de98832..74bd58a034 100644 --- a/services/core/DNP3OutstationAgent/tests/test_dnp3_agent.py +++ b/services/core/DNP3OutstationAgent/tests/test_dnp3_agent.py @@ -16,11 +16,12 @@ from volttron.platform.vip.agent.utils import build_agent from time import sleep import datetime -from dnp3_outstation.agent import Dnp3OutstationAgent +# from dnp3_outstation.agent import Dnp3OutstationAgent +from services.core.DNP3OutstationAgent.dnp3_outstation_agent.agent import Dnp3Agent as Dnp3OutstationAgent from dnp3_python.dnp3station.outstation_new import MyOutStationNew import random import subprocess -from volttron.utils import is_volttron_running +# from volttron.utils import is_volttron_running import json # from utils.testing_utils import * from volttrontesting.fixtures.volttron_platform_fixtures import volttron_instance @@ -32,19 +33,19 @@ dnp3_vip_identity = "dnp3_outstation" -@pytest.fixture(scope="module") -def volttron_home(): - """ - VOLTTRON_HOME environment variable suggested to setup at pytest.ini [env] - """ - volttron_home: str = os.getenv("VOLTTRON_HOME") - assert volttron_home - return volttron_home - - -def test_volttron_home_fixture(volttron_home): - assert volttron_home - print(volttron_home) +# @pytest.fixture(scope="module") +# def volttron_home(): +# """ +# VOLTTRON_HOME environment variable suggested to setup at pytest.ini [env] +# """ +# volttron_home: str = os.getenv("VOLTTRON_HOME") +# assert volttron_home +# return volttron_home +# +# +# def test_volttron_home_fixture(volttron_home): +# assert volttron_home +# print(volttron_home) def test_testing_file_path():