diff --git a/.github/workflows/code_analysis.yml b/.github/workflows/code_analysis.yml index c944c9a1bc..8c5d325b11 100644 --- a/.github/workflows/code_analysis.yml +++ b/.github/workflows/code_analysis.yml @@ -20,6 +20,10 @@ on: schedule: - cron: '25 18 * * 2' +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: analyze: name: Analyze diff --git a/.github/workflows/pytest-auth.yml b/.github/workflows/pytest-auth.yml index d45db0ac91..3b8c10c250 100644 --- a/.github/workflows/pytest-auth.yml +++ b/.github/workflows/pytest-auth.yml @@ -14,7 +14,21 @@ name: Testing platform auth # Determine what events are going to trigger a running of the workflow -on: [pull_request] +on: + workflow_dispatch: + push: + branches: + - develop + - releases/** + pull_request: + branches: + - main + - develop + - releases/** + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true jobs: # The job named build diff --git a/.github/workflows/pytest-dbutils-backup_db.yml b/.github/workflows/pytest-dbutils-backup_db.yml index 865c197ae6..beecf28097 100644 --- a/.github/workflows/pytest-dbutils-backup_db.yml +++ b/.github/workflows/pytest-dbutils-backup_db.yml @@ -15,15 +15,20 @@ name: Testing BackupDatabase # Determine what events are going to trigger a running of the workflow on: + workflow_dispatch: push: branches: - develop - releases/** pull_request: branches: - - main - - develop - - releases/** + - main + - develop + - releases/** + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true jobs: build: diff --git a/.github/workflows/pytest-dbutils-influxdbfuncts.yml b/.github/workflows/pytest-dbutils-influxdbfuncts.yml index 50f6ee79bd..ff3dcc5552 100644 --- a/.github/workflows/pytest-dbutils-influxdbfuncts.yml +++ b/.github/workflows/pytest-dbutils-influxdbfuncts.yml @@ -7,15 +7,19 @@ name: Testing influxdbutils on: + workflow_dispatch: push: branches: - develop - releases/** pull_request: branches: - - main - - develop - - releases/** + - main + - develop + - releases/** +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true jobs: build: diff --git a/.github/workflows/pytest-dbutils-mysqlfuncts.yml b/.github/workflows/pytest-dbutils-mysqlfuncts.yml index 0186950c48..37e3068ffc 100644 --- a/.github/workflows/pytest-dbutils-mysqlfuncts.yml +++ b/.github/workflows/pytest-dbutils-mysqlfuncts.yml @@ -7,15 +7,19 @@ name: Testing mysqlfuncts on: + workflow_dispatch: push: branches: - develop - releases/** pull_request: branches: - - main - - develop - - releases/** + - main + - develop + - releases/** +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true jobs: build: diff --git a/.github/workflows/pytest-dbutils-postgresqlfuncts.yml b/.github/workflows/pytest-dbutils-postgresqlfuncts.yml index 2055564433..0398771cdb 100644 --- a/.github/workflows/pytest-dbutils-postgresqlfuncts.yml +++ b/.github/workflows/pytest-dbutils-postgresqlfuncts.yml @@ -7,15 +7,19 @@ name: Testing postgresqlfuncts on: + workflow_dispatch: push: branches: - develop - releases/** pull_request: branches: - - main - - develop - - releases/** + - main + - develop + - releases/** +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true jobs: build: diff --git a/.github/workflows/pytest-dbutils-sqlitefuncts.yml b/.github/workflows/pytest-dbutils-sqlitefuncts.yml index 5fa741211f..3848e6efa8 100644 --- a/.github/workflows/pytest-dbutils-sqlitefuncts.yml +++ b/.github/workflows/pytest-dbutils-sqlitefuncts.yml @@ -7,16 +7,19 @@ name: Testing sqlitefuncts on: + workflow_dispatch: push: branches: - develop - releases/** pull_request: branches: - - main - - develop - - releases/** - + - main + - develop + - releases/** +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true jobs: build: env: diff --git a/.github/workflows/pytest-dbutils-timescaldbfuncts.yml b/.github/workflows/pytest-dbutils-timescaldbfuncts.yml index ea12f81333..1aeb461487 100644 --- a/.github/workflows/pytest-dbutils-timescaldbfuncts.yml +++ b/.github/workflows/pytest-dbutils-timescaldbfuncts.yml @@ -7,16 +7,19 @@ name: Testing postgresql_timescaledb_functs on: + workflow_dispatch: push: branches: - develop - releases/** pull_request: branches: - - main - - develop - - releases/** - + - main + - develop + - releases/** +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true jobs: build: env: diff --git a/.github/workflows/pytest-miscellaneous-tests.yml b/.github/workflows/pytest-miscellaneous-tests.yml index 1e4e39ebc7..9fc023b5a9 100644 --- a/.github/workflows/pytest-miscellaneous-tests.yml +++ b/.github/workflows/pytest-miscellaneous-tests.yml @@ -14,16 +14,19 @@ name: Miscellaneous platform tests on: + workflow_dispatch: push: branches: - develop - releases/** pull_request: branches: - - main - - develop - - releases/** - + - main + - develop + - releases/** +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true jobs: # The job named build build: @@ -32,10 +35,10 @@ jobs: strategy: fail-fast: false matrix: - # Each entry in the os and python-version matrix will be run + # Each entry in the os and python-version matrix will be run os: [ ubuntu-20.04 ] python-version: [ 3.8 ] - + # Run-on determines the operating system available to run on # - At the current time there is only ubuntu machine 20.04 available # - This uses the matrix os from the strategy above @@ -60,9 +63,9 @@ jobs: os: ${{ matrix.os }} test_path: volttrontesting/platform/web/test_certs.py test_output_suffix: misc - + - name: Run core agent test on ${{ matrix.python-version }}, ${{ matrix.os }} - uses: volttron/volttron-build-action@v5 + uses: volttron/volttron-build-action@v6 with: python_version: ${{ matrix.python-version }} os: ${{ matrix.os }} @@ -70,7 +73,7 @@ jobs: test_output_suffix: misc - name: Run packaging test on ${{ matrix.python-version }}, ${{ matrix.os }} - uses: volttron/volttron-build-action@v5 + uses: volttron/volttron-build-action@v6 with: python_version: ${{ matrix.python-version }} os: ${{ matrix.os }} @@ -78,15 +81,15 @@ jobs: test_output_suffix: misc - name: Run platform init test on ${{ matrix.python-version }}, ${{ matrix.os }} - uses: volttron/volttron-build-action@v5 + uses: volttron/volttron-build-action@v6 with: python_version: ${{ matrix.python-version }} os: ${{ matrix.os }} test_path: volttrontesting/platform/test_platform_init.py test_output_suffix: misc - + - name: Run sqlite3 test on ${{ matrix.python-version }}, ${{ matrix.os }} - uses: volttron/volttron-build-action@v5 + uses: volttron/volttron-build-action@v6 with: python_version: ${{ matrix.python-version }} os: ${{ matrix.os }} diff --git a/.github/workflows/pytest-testutils.yml b/.github/workflows/pytest-testutils.yml index 713ffd4f39..39cebe91aa 100644 --- a/.github/workflows/pytest-testutils.yml +++ b/.github/workflows/pytest-testutils.yml @@ -9,16 +9,19 @@ name: Testing testutils directory on: + workflow_dispatch: push: branches: - develop - releases/** pull_request: branches: - - main - - develop - - releases/** - + - main + - develop + - releases/** +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true jobs: build: # The strategy allows customization of the build and allows matrixing the version of os and software diff --git a/.github/workflows/pytest-vctl.yml b/.github/workflows/pytest-vctl.yml index b10c96613f..d0d5d868fb 100644 --- a/.github/workflows/pytest-vctl.yml +++ b/.github/workflows/pytest-vctl.yml @@ -15,16 +15,19 @@ name: Testing volttron-ctl # Determine what events are going to trigger a running of the workflow on: + workflow_dispatch: push: branches: - develop - releases/** pull_request: branches: - - main - - develop - - releases/** - + - main + - develop + - releases/** +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true jobs: # The job named build build: @@ -71,4 +74,3 @@ jobs: name: pytest-report # should match test-- ... path: output/test-control_tests-${{matrix.os}}-${{ matrix.python-version }}-results.xml - diff --git a/.github/workflows/pytest-web.yml b/.github/workflows/pytest-web.yml index f1ea10838c..482fbe3160 100644 --- a/.github/workflows/pytest-web.yml +++ b/.github/workflows/pytest-web.yml @@ -14,16 +14,19 @@ name: Testing platform web on: + workflow_dispatch: push: branches: - develop - releases/** pull_request: branches: - - main - - develop - - releases/** - + - main + - develop + - releases/** +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true jobs: # The job named build build: @@ -54,7 +57,7 @@ jobs: # Run the specified tests and save the results to a unique file that can be archived for later analysis. - name: Run pytest on ${{ matrix.python-version }}, ${{ matrix.os }} - uses: volttron/volttron-build-action@v6 + uses: volttron/volttron-build-action@v7 with: python_version: ${{ matrix.python-version }} os: ${{ matrix.os }} @@ -68,15 +71,15 @@ jobs: with: name: pytest-report path: output/test-web-${{matrix.os}}-${{ matrix.python-version }}-results.xml - + # - name: Publish Unit Test Results # uses: EnricoMi/publish-unit-test-result-action@v1.5 # if: always() # with: # github_token: ${{ secrets.WORKFLOW_ACCESS_TOKEN }} # files: output/test-testutils*.xml - - + + #-cov=com --cov-report=xml --cov-report=html # pytest tests.py --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html # - name: Lint with flake8 diff --git a/deprecated/Ambient/ambient/agent.py b/deprecated/Ambient/ambient/agent.py index 1de617306e..e69b55c9e1 100644 --- a/deprecated/Ambient/ambient/agent.py +++ b/deprecated/Ambient/ambient/agent.py @@ -1,58 +1,25 @@ # -*- coding: utf-8 -*- {{{ -# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: +# ===----------------------------------------------------------------------=== # -# Copyright (c) 2017, Battelle Memorial Institute -# All rights reserved. +# Component of Eclipse VOLTTRON # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: +# ===----------------------------------------------------------------------=== # -# 1. Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. +# Copyright 2023 Battelle Memorial Institute # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -# FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# 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 # -# The views and conclusions contained in the software and documentation are -# those of the authors and should not be interpreted as representing official, -# policies either expressed or implied, of the FreeBSD Project. +# http://www.apache.org/licenses/LICENSE-2.0 # - -# This material was prepared as an account of work sponsored by an -# agency of the United States Government. Neither the United States -# Government nor the United States Department of Energy, nor Battelle, -# nor any of their employees, nor any jurisdiction or organization -# that has cooperated in the development of these materials, makes -# any warranty, express or implied, or assumes any legal liability -# or responsibility for the accuracy, completeness, or usefulness or -# any information, apparatus, product, software, or process disclosed, -# or represents that its use would not infringe privately owned rights. -# -# Reference herein to any specific commercial product, process, or -# service by trade name, trademark, manufacturer, or otherwise does -# not necessarily constitute or imply its endorsement, recommendation, -# r favoring by the United States Government or any agency thereof, -# or Battelle Memorial Institute. The views and opinions of authors -# expressed herein do not necessarily state or reflect those of the -# United States Government or any agency thereof. +# 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. # -# PACIFIC NORTHWEST NATIONAL LABORATORY -# operated by BATTELLE for the UNITED STATES DEPARTMENT OF ENERGY -# under Contract DE-AC05-76RL01830 - +# ===----------------------------------------------------------------------=== # }}} __docformat__ = 'reStructuredText' diff --git a/deprecated/Ambient/tests/test_ambient_agent.py b/deprecated/Ambient/tests/test_ambient_agent.py index 6c7d56c448..64757dcef8 100644 --- a/deprecated/Ambient/tests/test_ambient_agent.py +++ b/deprecated/Ambient/tests/test_ambient_agent.py @@ -1,39 +1,25 @@ # -*- coding: utf-8 -*- {{{ -# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: +# ===----------------------------------------------------------------------=== # -# Copyright 2017, Battelle Memorial Institute. +# Component of Eclipse VOLTTRON # -# 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 +# ===----------------------------------------------------------------------=== # -# http://www.apache.org/licenses/LICENSE-2.0 +# Copyright 2023 Battelle Memorial Institute # -# 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. +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 # -# This material was prepared as an account of work sponsored by an agency of -# the United States Government. Neither the United States Government nor the -# United States Department of Energy, nor Battelle, nor any of their -# employees, nor any jurisdiction or organization that has cooperated in the -# development of these materials, makes any warranty, express or -# implied, or assumes any legal liability or responsibility for the accuracy, -# completeness, or usefulness or any information, apparatus, product, -# software, or process disclosed, or represents that its use would not infringe -# privately owned rights. Reference herein to any specific commercial product, -# process, or service by trade name, trademark, manufacturer, or otherwise -# does not necessarily constitute or imply its endorsement, recommendation, or -# favoring by the United States Government or any agency thereof, or -# Battelle Memorial Institute. The views and opinions of authors expressed -# herein do not necessarily state or reflect those of the -# United States Government or any agency thereof. +# 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. # -# PACIFIC NORTHWEST NATIONAL LABORATORY operated by -# BATTELLE for the UNITED STATES DEPARTMENT OF ENERGY -# under Contract DE-AC05-76RL01830 +# ===----------------------------------------------------------------------=== # }}} import pytest @@ -347,5 +333,3 @@ def test_polling_locations_valid_config(volttron_instance, query_agent, config, if agent_uuid: volttron_instance.stop_agent(agent_uuid) volttron_instance.remove_agent(agent_uuid) - - diff --git a/examples/CSVDriver/csvdriver.py b/examples/CSVDriver/csvdriver.py index 20259803aa..81a1791df6 100644 --- a/examples/CSVDriver/csvdriver.py +++ b/examples/CSVDriver/csvdriver.py @@ -1,39 +1,25 @@ # -*- coding: utf-8 -*- {{{ -# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: +# ===----------------------------------------------------------------------=== # -# Copyright 2017, Battelle Memorial Institute. +# Component of Eclipse VOLTTRON # -# 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 +# ===----------------------------------------------------------------------=== # -# http://www.apache.org/licenses/LICENSE-2.0 +# Copyright 2023 Battelle Memorial Institute # -# 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. +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 # -# This material was prepared as an account of work sponsored by an agency of -# the United States Government. Neither the United States Government nor the -# United States Department of Energy, nor Battelle, nor any of their -# employees, nor any jurisdiction or organization that has cooperated in the -# development of these materials, makes any warranty, express or -# implied, or assumes any legal liability or responsibility for the accuracy, -# completeness, or usefulness or any information, apparatus, product, -# software, or process disclosed, or represents that its use would not infringe -# privately owned rights. Reference herein to any specific commercial product, -# process, or service by trade name, trademark, manufacturer, or otherwise -# does not necessarily constitute or imply its endorsement, recommendation, or -# favoring by the United States Government or any agency thereof, or -# Battelle Memorial Institute. The views and opinions of authors expressed -# herein do not necessarily state or reflect those of the -# United States Government or any agency thereof. +# 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. # -# PACIFIC NORTHWEST NATIONAL LABORATORY operated by -# BATTELLE for the UNITED STATES DEPARTMENT OF ENERGY -# under Contract DE-AC05-76RL01830 +# ===----------------------------------------------------------------------=== # }}} from csv import DictReader, DictWriter diff --git a/examples/HELICS/helics_federate.py b/examples/HELICS/helics_federate.py index 2b8d42a94f..c4f8db075f 100644 --- a/examples/HELICS/helics_federate.py +++ b/examples/HELICS/helics_federate.py @@ -1,40 +1,25 @@ -# -*- coding: utf-8 -*- -# {{{ -# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: +# -*- coding: utf-8 -*- {{{ +# ===----------------------------------------------------------------------=== # -# Copyright 2020, Battelle Memorial Institute. +# Component of Eclipse VOLTTRON # -# 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 +# ===----------------------------------------------------------------------=== # -# http://www.apache.org/licenses/LICENSE-2.0 +# Copyright 2023 Battelle Memorial Institute # -# 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. +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 # -# This material was prepared as an account of work sponsored by an agency of -# the United States Government. Neither the United States Government nor the -# United States Department of Energy, nor Battelle, nor any of their -# employees, nor any jurisdiction or organization that has cooperated in the -# development of these materials, makes any warranty, express or -# implied, or assumes any legal liability or responsibility for the accuracy, -# completeness, or usefulness or any information, apparatus, product, -# software, or process disclosed, or represents that its use would not infringe -# privately owned rights. Reference herein to any specific commercial product, -# process, or service by trade name, trademark, manufacturer, or otherwise -# does not necessarily constitute or imply its endorsement, recommendation, or -# favoring by the United States Government or any agency thereof, or -# Battelle Memorial Institute. The views and opinions of authors expressed -# herein do not necessarily state or reflect those of the -# United States Government or any agency thereof. +# 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. # -# PACIFIC NORTHWEST NATIONAL LABORATORY operated by -# BATTELLE for the UNITED STATES DEPARTMENT OF ENERGY -# under Contract DE-AC05-76RL01830 +# ===----------------------------------------------------------------------=== # }}} import time @@ -126,7 +111,7 @@ def federate_example(config_path): print('######################## Get from Endpoint #########################################') idx = endid["m{}".format(0)] - while h.helicsEndpointHasMessage(idx): + while h.helicsEndpointHasMessage(idx): msg = h.helicsEndpointGetMessage(idx) end_name = h.helicsEndpointGetName(idx) print("Value from endpoint name: {} is {}".format(end_name, msg.data)) diff --git a/pytest.ini b/pytest.ini index 0261b0897e..1830fef016 100644 --- a/pytest.ini +++ b/pytest.ini @@ -69,3 +69,4 @@ markers = # To support testing asyncio code with pytest (e.g. OpenADRVenAgent), we need to set this configuration option. # See documentation on this configuration option at https://pypi.org/project/pytest-asyncio/ asyncio_mode = auto + diff --git a/services/core/PlatformDriverAgent/platform_driver/interfaces/ecobee.py b/services/core/PlatformDriverAgent/platform_driver/interfaces/ecobee.py index 1e81a01d26..9e4c0f5d4c 100644 --- a/services/core/PlatformDriverAgent/platform_driver/interfaces/ecobee.py +++ b/services/core/PlatformDriverAgent/platform_driver/interfaces/ecobee.py @@ -1,39 +1,25 @@ # -*- coding: utf-8 -*- {{{ -# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: +# ===----------------------------------------------------------------------=== # -# Copyright 2017, Battelle Memorial Institute. +# Component of Eclipse VOLTTRON # -# 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 +# ===----------------------------------------------------------------------=== # -# http://www.apache.org/licenses/LICENSE-2.0 +# Copyright 2023 Battelle Memorial Institute # -# 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. +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 # -# This material was prepared as an account of work sponsored by an agency of -# the United States Government. Neither the United States Government nor the -# United States Department of Energy, nor Battelle, nor any of their -# employees, nor any jurisdiction or organization that has cooperated in the -# development of these materials, makes any warranty, express or -# implied, or assumes any legal liability or responsibility for the accuracy, -# completeness, or usefulness or any information, apparatus, product, -# software, or process disclosed, or represents that its use would not infringe -# privately owned rights. Reference herein to any specific commercial product, -# process, or service by trade name, trademark, manufacturer, or otherwise -# does not necessarily constitute or imply its endorsement, recommendation, or -# favoring by the United States Government or any agency thereof, or -# Battelle Memorial Institute. The views and opinions of authors expressed -# herein do not necessarily state or reflect those of the -# United States Government or any agency thereof. +# 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. # -# PACIFIC NORTHWEST NATIONAL LABORATORY operated by -# BATTELLE for the UNITED STATES DEPARTMENT OF ENERGY -# under Contract DE-AC05-76RL01830 +# ===----------------------------------------------------------------------=== # }}} import datetime @@ -845,4 +831,3 @@ def make_ecobee_request(request_type, url, **kwargs): if isinstance(content, bytes): content = jsonapi.loads(response.decode("UTF-8")) return content - diff --git a/services/core/PlatformDriverAgent/platform_driver/interfaces/home_assistant.py b/services/core/PlatformDriverAgent/platform_driver/interfaces/home_assistant.py index 6088100f24..780b01dab9 100644 --- a/services/core/PlatformDriverAgent/platform_driver/interfaces/home_assistant.py +++ b/services/core/PlatformDriverAgent/platform_driver/interfaces/home_assistant.py @@ -1,39 +1,25 @@ # -*- coding: utf-8 -*- {{{ -# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: +# ===----------------------------------------------------------------------=== # -# Copyright 2020, Battelle Memorial Institute. +# Component of Eclipse VOLTTRON # -# 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 +# ===----------------------------------------------------------------------=== # -# http://www.apache.org/licenses/LICENSE-2.0 +# Copyright 2023 Battelle Memorial Institute # -# 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. +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 # -# This material was prepared as an account of work sponsored by an agency of -# the United States Government. Neither the United States Government nor the -# United States Department of Energy, nor Battelle, nor any of their -# employees, nor any jurisdiction or organization that has cooperated in the -# development of these materials, makes any warranty, express or -# implied, or assumes any legal liability or responsibility for the accuracy, -# completeness, or usefulness or any information, apparatus, product, -# software, or process disclosed, or represents that its use would not infringe -# privately owned rights. Reference herein to any specific commercial product, -# process, or service by trade name, trademark, manufacturer, or otherwise -# does not necessarily constitute or imply its endorsement, recommendation, or -# favoring by the United States Government or any agency thereof, or -# Battelle Memorial Institute. The views and opinions of authors expressed -# herein do not necessarily state or reflect those of the -# United States Government or any agency thereof. +# 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. # -# PACIFIC NORTHWEST NATIONAL LABORATORY operated by -# BATTELLE for the UNITED STATES DEPARTMENT OF ENERGY -# under Contract DE-AC05-76RL01830 +# ===----------------------------------------------------------------------=== # }}} diff --git a/services/core/PlatformDriverAgent/requirements.txt b/services/core/PlatformDriverAgent/requirements.txt index f19047e936..23203ca7eb 100644 --- a/services/core/PlatformDriverAgent/requirements.txt +++ b/services/core/PlatformDriverAgent/requirements.txt @@ -1,4 +1,4 @@ bacpypes==0.16.7 -pymodbus==2.5.2 modbus-tk==1.1.2 +pymodbus==2.5.3 pyserial==3.5 diff --git a/services/core/PlatformDriverAgent/tests/test_home_assistant.py b/services/core/PlatformDriverAgent/tests/test_home_assistant.py index 0d6c59a13e..6d7b09b115 100644 --- a/services/core/PlatformDriverAgent/tests/test_home_assistant.py +++ b/services/core/PlatformDriverAgent/tests/test_home_assistant.py @@ -1,39 +1,25 @@ # -*- coding: utf-8 -*- {{{ -# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: +# ===----------------------------------------------------------------------=== # -# Copyright 2020, Battelle Memorial Institute. +# Component of Eclipse VOLTTRON # -# 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 +# ===----------------------------------------------------------------------=== # -# http://www.apache.org/licenses/LICENSE-2.0 +# Copyright 2023 Battelle Memorial Institute # -# 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. +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 # -# This material was prepared as an account of work sponsored by an agency of -# the United States Government. Neither the United States Government nor the -# United States Department of Energy, nor Battelle, nor any of their -# employees, nor any jurisdiction or organization that has cooperated in the -# development of these materials, makes any warranty, express or -# implied, or assumes any legal liability or responsibility for the accuracy, -# completeness, or usefulness or any information, apparatus, product, -# software, or process disclosed, or represents that its use would not infringe -# privately owned rights. Reference herein to any specific commercial product, -# process, or service by trade name, trademark, manufacturer, or otherwise -# does not necessarily constitute or imply its endorsement, recommendation, or -# favoring by the United States Government or any agency thereof, or -# Battelle Memorial Institute. The views and opinions of authors expressed -# herein do not necessarily state or reflect those of the -# United States Government or any agency thereof. +# 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. # -# PACIFIC NORTHWEST NATIONAL LABORATORY operated by -# BATTELLE for the UNITED STATES DEPARTMENT OF ENERGY -# under Contract DE-AC05-76RL01830 +# ===----------------------------------------------------------------------=== # }}} import json diff --git a/services/ops/ThresholdDetectionAgent/tests/test_threshold_agent.py b/services/ops/ThresholdDetectionAgent/tests/test_threshold_agent.py index 4d71170200..62e1c75a63 100644 --- a/services/ops/ThresholdDetectionAgent/tests/test_threshold_agent.py +++ b/services/ops/ThresholdDetectionAgent/tests/test_threshold_agent.py @@ -2,41 +2,27 @@ # vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: # -*- coding: utf-8 -*- {{{ -# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: +# ===----------------------------------------------------------------------=== # -# Copyright 2017, Battelle Memorial Institute. +# Component of Eclipse VOLTTRON # -# 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 +# ===----------------------------------------------------------------------=== # -# http://www.apache.org/licenses/LICENSE-2.0 +# Copyright 2023 Battelle Memorial Institute # -# 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. +# 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 # -# This material was prepared as an account of work sponsored by an agency of -# the United States Government. Neither the United States Government nor the -# United States Department of Energy, nor Battelle, nor any of their -# employees, nor any jurisdiction or organization that has cooperated in the -# development of these materials, makes any warranty, express or -# implied, or assumes any legal liability or responsibility for the accuracy, -# completeness, or usefulness or any information, apparatus, product, -# software, or process disclosed, or represents that its use would not infringe -# privately owned rights. Reference herein to any specific commercial product, -# process, or service by trade name, trademark, manufacturer, or otherwise -# does not necessarily constitute or imply its endorsement, recommendation, or -# favoring by the United States Government or any agency thereof, or -# Battelle Memorial Institute. The views and opinions of authors expressed -# herein do not necessarily state or reflect those of the -# United States Government or any agency thereof. +# http://www.apache.org/licenses/LICENSE-2.0 # -# PACIFIC NORTHWEST NATIONAL LABORATORY operated by -# BATTELLE for the UNITED STATES DEPARTMENT OF ENERGY -# under Contract DE-AC05-76RL01830 +# 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. +# +# ===----------------------------------------------------------------------=== # }}} #}}} @@ -90,7 +76,7 @@ def test_alert_low(self): def main(argv=sys.argv): agent = ThresholdDetectionAgent() - + if __name__ == '__main__': # Entry point for script diff --git a/update_copyright.py b/update_copyright.py index 762dd6364a..7c4b0e2436 100644 --- a/update_copyright.py +++ b/update_copyright.py @@ -16,7 +16,7 @@ # 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. -# +#green # This material was prepared as an account of work sponsored by an agency of # the United States Government. Neither the United States Government nor the # United States Department of Energy, nor Battelle, nor any of their diff --git a/volttron/platform/vip/__init__.py b/volttron/platform/vip/__init__.py index 07c284d6ed..dc5d9ef286 100644 --- a/volttron/platform/vip/__init__.py +++ b/volttron/platform/vip/__init__.py @@ -1,39 +1,25 @@ # -*- coding: utf-8 -*- {{{ -# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: +# ===----------------------------------------------------------------------=== # -# Copyright 2020, Battelle Memorial Institute. +# Component of Eclipse VOLTTRON # -# 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 +# ===----------------------------------------------------------------------=== # -# http://www.apache.org/licenses/LICENSE-2.0 +# Copyright 2023 Battelle Memorial Institute +# +# 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 +# +# http://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. -#green -# This material was prepared as an account of work sponsored by an agency of -# the United States Government. Neither the United States Government nor the -# United States Department of Energy, nor Battelle, nor any of their -# employees, nor any jurisdiction or organization that has cooperated in the -# development of these materials, makes any warranty, express or -# implied, or assumes any legal liability or responsibility for the accuracy, -# completeness, or usefulness or any information, apparatus, product, -# software, or process disclosed, or represents that its use would not infringe -# privately owned rights. Reference herein to any specific commercial product, -# process, or service by trade name, trademark, manufacturer, or otherwise -# does not necessarily constitute or imply its endorsement, recommendation, or -# favoring by the United States Government or any agency thereof, or -# Battelle Memorial Institute. The views and opinions of authors expressed -# herein do not necessarily state or reflect those of the -# United States Government or any agency thereof. +# 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. # -# PACIFIC NORTHWEST NATIONAL LABORATORY operated by -# BATTELLE for the UNITED STATES DEPARTMENT OF ENERGY -# under Contract DE-AC05-76RL01830 +# ===----------------------------------------------------------------------=== # }}} """VIP - VOLTTRON™ Interconnect Protocol implementation diff --git a/volttron/platform/vip/zmq_connection.py b/volttron/platform/vip/zmq_connection.py index 09e5b04af9..1547724b29 100644 --- a/volttron/platform/vip/zmq_connection.py +++ b/volttron/platform/vip/zmq_connection.py @@ -1,39 +1,25 @@ # -*- coding: utf-8 -*- {{{ -# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: +# ===----------------------------------------------------------------------=== # -# Copyright 2020, Battelle Memorial Institute. +# Component of Eclipse VOLTTRON # -# 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 +# ===----------------------------------------------------------------------=== # -# http://www.apache.org/licenses/LICENSE-2.0 +# Copyright 2023 Battelle Memorial Institute # -# 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. +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 # -# This material was prepared as an account of work sponsored by an agency of -# the United States Government. Neither the United States Government nor the -# United States Department of Energy, nor Battelle, nor any of their -# employees, nor any jurisdiction or organization that has cooperated in the -# development of these materials, makes any warranty, express or -# implied, or assumes any legal liability or responsibility for the accuracy, -# completeness, or usefulness or any information, apparatus, product, -# software, or process disclosed, or represents that its use would not infringe -# privately owned rights. Reference herein to any specific commercial product, -# process, or service by trade name, trademark, manufactufrer, or otherwise -# does not necessarily constitute or imply its endorsement, recommendation, or -# favoring by the United States Government or any agency thereof, or -# Battelle Memorial Institute. The views and opinions of authors expressed -# herein do not necessarily state or reflect those of the -# United States Government or any agency thereof. +# 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. # -# PACIFIC NORTHWEST NATIONAL LABORATORY operated by -# BATTELLE for the UNITED STATES DEPARTMENT OF ENERGY -# under Contract DE-AC05-76RL01830 +# ===----------------------------------------------------------------------=== # }}} import zmq @@ -106,4 +92,3 @@ def close_connection(self, linger=5): _log.debug("********************************************************************") _log.debug("Closing connection to ZMQ: {}".format(self._identity)) _log.debug("********************************************************************") - diff --git a/volttrontesting/fixtures/volttron_platform_fixtures.py b/volttrontesting/fixtures/volttron_platform_fixtures.py index 5264c4b4fd..a568f190e6 100644 --- a/volttrontesting/fixtures/volttron_platform_fixtures.py +++ b/volttrontesting/fixtures/volttron_platform_fixtures.py @@ -49,10 +49,8 @@ def build_wrapper(vip_address: str, should_start: bool = True, messagebus: str = auth_enabled=kwargs.pop('auth_enabled', True)) if should_start: wrapper.startup_platform(vip_address=vip_address, **kwargs) - if wrapper.messagebus == 'rmq': - gevent.sleep(5) - else: - gevent.sleep(2) + if not wrapper.dynamic_agent: + raise ValueError(f"Couldn't start platform successfully for {wrapper.messagebus}") assert wrapper.is_running() return wrapper @@ -135,7 +133,7 @@ def volttron_instance(request, **kwargs): """ address = kwargs.pop("vip_address", get_rand_vip()) if request.param['messagebus'] == 'rmq': - kwargs['timeout'] = 120 + kwargs['timeout'] = 240 wrapper = build_wrapper(address, messagebus=request.param.get('messagebus', 'zmq'), diff --git a/volttrontesting/platform/dbutils/test_mysqlfuncts.py b/volttrontesting/platform/dbutils/test_mysqlfuncts.py index 17d4ddc524..78759d9606 100644 --- a/volttrontesting/platform/dbutils/test_mysqlfuncts.py +++ b/volttrontesting/platform/dbutils/test_mysqlfuncts.py @@ -103,7 +103,7 @@ def test_query_should_return_data(get_container_func, topic_ids, id_name_map, ex value_string TEXT NOT NULL, UNIQUE(topic_id, ts)); REPLACE INTO {DATA_TABLE} - VALUES ('2020-06-01 12:30:59', 43, '[2,3]') + VALUES ('2020-06-01 12:30:59', 43, '[2,3]') """ seed_database(container, query) actual_values = sqlfuncts.query(topic_ids, id_name_map) @@ -248,7 +248,7 @@ def test_get_topic_map_should_succeed(get_container_func): INSERT INTO topics (topic_name) VALUES ('football'); INSERT INTO topics (topic_name) - VALUES ('baseball'); + VALUES ('baseball'); """ seed_database(container, query) expected = ( @@ -270,7 +270,7 @@ def test_get_topic_meta_map_should_succeed(get_container_func): INSERT INTO topics (topic_name) VALUES ('football'); INSERT INTO topics (topic_name, metadata) - VALUES ('baseball', '{\\"metadata\\":\\"value\\"}'); + VALUES ('baseball', '{\\"metadata\\":\\"value\\"}'); """ seed_database(container, query) expected = {1: None, 2: {"metadata": "value"}} @@ -303,7 +303,7 @@ def test_query_topics_by_pattern_should_succeed(get_container_func): INSERT INTO {TOPICS_TABLE} (topic_name) VALUES ('foobar'); INSERT INTO {TOPICS_TABLE} (topic_name) - VALUES ('xyzzzzzzzz'); + VALUES ('xyzzzzzzzz'); """ seed_database(container, query) expected = {"football": 1, "foobar": 2} @@ -333,8 +333,8 @@ def test_insert_aggregate_stmt_should_succeed(get_container_func): container, sqlfuncts, connection_port, historian_version = get_container_func query = """ CREATE TABLE IF NOT EXISTS AVG_1776 - (ts timestamp NOT NULL, topic_id INTEGER NOT NULL, - value_string TEXT NOT NULL, topics_list TEXT, + (ts timestamp NOT NULL, topic_id INTEGER NOT NULL, + value_string TEXT NOT NULL, topics_list TEXT, UNIQUE(topic_id, ts), INDEX (ts ASC)) """ seed_database(container, query) @@ -435,7 +435,7 @@ def get_container_func(request): create_all_tables(container, historian_version) mysqlfuncts = get_mysqlfuncts(connection_port) - sleep(5) + sleep(25) # So that sqlfuncts class can check if metadata is in topics table and sets its variables accordingly mysqlfuncts.setup_historian_tables() yield container, mysqlfuncts, connection_port, historian_version @@ -508,28 +508,28 @@ def create_aggregate_tables(container, historian_version): if historian_version == "<4.0.0": query = f""" CREATE TABLE IF NOT EXISTS {AGG_TOPICS_TABLE} - (agg_topic_id INTEGER NOT NULL AUTO_INCREMENT, - agg_topic_name varchar(512) NOT NULL, - agg_type varchar(512) NOT NULL, - agg_time_period varchar(512) NOT NULL, - PRIMARY KEY (agg_topic_id), + (agg_topic_id INTEGER NOT NULL AUTO_INCREMENT, + agg_topic_name varchar(512) NOT NULL, + agg_type varchar(512) NOT NULL, + agg_time_period varchar(512) NOT NULL, + PRIMARY KEY (agg_topic_id), UNIQUE(agg_topic_name, agg_type, agg_time_period)); CREATE TABLE IF NOT EXISTS {AGG_META_TABLE} - (agg_topic_id INTEGER NOT NULL, + (agg_topic_id INTEGER NOT NULL, metadata TEXT NOT NULL, PRIMARY KEY(agg_topic_id)); """ else: query = f""" CREATE TABLE IF NOT EXISTS {AGG_TOPICS_TABLE} - (agg_topic_id INTEGER NOT NULL AUTO_INCREMENT, - agg_topic_name varchar(512) NOT NULL, - agg_type varchar(20) NOT NULL, - agg_time_period varchar(20) NOT NULL, - PRIMARY KEY (agg_topic_id), + (agg_topic_id INTEGER NOT NULL AUTO_INCREMENT, + agg_topic_name varchar(512) NOT NULL, + agg_type varchar(20) NOT NULL, + agg_time_period varchar(20) NOT NULL, + PRIMARY KEY (agg_topic_id), UNIQUE(agg_topic_name, agg_type, agg_time_period)); CREATE TABLE IF NOT EXISTS {AGG_META_TABLE} - (agg_topic_id INTEGER NOT NULL, + (agg_topic_id INTEGER NOT NULL, metadata TEXT NOT NULL, PRIMARY KEY(agg_topic_id)); """ diff --git a/volttrontesting/platform/test_basehistorian.py b/volttrontesting/platform/test_basehistorian.py index 1b99f8ca00..19a8fafb3b 100644 --- a/volttrontesting/platform/test_basehistorian.py +++ b/volttrontesting/platform/test_basehistorian.py @@ -16,6 +16,7 @@ from volttrontesting.platform.test_instance_setup import create_vcfg_vhome + class QueryHelper: """ Query helper allows us to mock out the Query subsystem and return default diff --git a/volttrontesting/utils/build_agent.py b/volttrontesting/utils/build_agent.py index a925d9fc09..0f5b0af6f3 100644 --- a/volttrontesting/utils/build_agent.py +++ b/volttrontesting/utils/build_agent.py @@ -3,7 +3,6 @@ import gevent from volttron.platform.keystore import KeyStore -from volttron.platform.vip.agent import Agent from volttrontesting.utils.platformwrapper import PlatformWrapper @@ -13,9 +12,11 @@ def build_agent(platform: PlatformWrapper, identity=None, agent_class=None): The agent identity will be set. If the identity is set to None then a random identity will be created. """ + from volttron.platform.vip.agent import Agent + if agent_class is None: agent_class = Agent - + os.environ['VOLTTRON_HOME'] = platform.volttron_home agent = platform.build_agent(identity, agent_class=agent_class) gevent.sleep(0.1) # switch context for a bit diff --git a/volttrontesting/utils/platformwrapper.py b/volttrontesting/utils/platformwrapper.py index 80bf8109b7..5fc82bf4b0 100644 --- a/volttrontesting/utils/platformwrapper.py +++ b/volttrontesting/utils/platformwrapper.py @@ -628,37 +628,37 @@ def add_capabilities(self, publickey, capabilities): # auth.update rpc call. So sleeping here instead expecting individual test cases to sleep for long gevent.sleep(2) return True - + file_types = Union[Literal["raw"], Literal["json"], Literal["csv"]] - + def config_store_get(self, vip_identity: str, name: str, file_type: Optional[Literal["raw"]] = None) -> str: with with_os_environ(self.env): self.__wait_for_control_connection_to_exit__() env = self.env.copy() file_type = None if file_type is None else "--raw" - + cmd = ['volttron-ctl', '--json', 'config', 'get', vip_identity, name] - + if file_type: cmd.append(file_type) - + res = execute_command(cmd, env=env, logger=_log) - + print(res) return res - + def config_store_store(self, identity: str, name: str, infile: Path, file_type: file_types = "json"): with with_os_environ(self.env): self.__wait_for_control_connection_to_exit__() env = self.env.copy() file_type = "--" + file_type - + cmd = ['volttron-ctl', '--json', 'config', 'store', identity, name, infile.absolute().as_posix(), file_type] - + res = execute_command(cmd, env=env, logger=_log) - + print(res) - + def add_capability(self, entry, capabilities): if not self.auth_enabled: @@ -944,7 +944,7 @@ def startup_platform(self, vip_address, auth_dict=None, # if msgdebug: # cmd.append('--msgdebug') if enable_logging: - cmd.append('-vv') + cmd.append('-v') cmd.append('-l{}'.format(self.log_path)) if setupmode: cmd.append('--setup-mode')