From 773a72e131685081955ca6848786158817cff2f2 Mon Sep 17 00:00:00 2001 From: Mark Bonicillo Date: Fri, 10 Jul 2020 14:06:29 -0700 Subject: [PATCH 1/4] Remove sudo in rabbit_dependencies.sh --- scripts/rabbit_dependencies.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/rabbit_dependencies.sh b/scripts/rabbit_dependencies.sh index 338cdcd818..4d15cd3a22 100755 --- a/scripts/rabbit_dependencies.sh +++ b/scripts/rabbit_dependencies.sh @@ -73,10 +73,10 @@ function install_on_debian { ${prefix} apt-get install apt-transport-https libwxbase3.0-0v5 libwxgtk3.0-0v5 libsctp1 build-essential python-dev openssl libssl-dev libevent-dev git ${prefix} apt-get purge -yf erlang* # Add the signing key - wget -O- https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc | sudo apt-key add - + wget -O- https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc | apt-key add - if [[ ! -f "/etc/apt/sources.list.d/erlang.solutions.list" ]]; then - echo "deb https://packages.erlang-solutions.com/ubuntu $DIST contrib" | sudo tee /etc/apt/sources.list.d/erlang.solutions.list + echo "deb https://packages.erlang-solutions.com/ubuntu $DIST contrib" | tee /etc/apt/sources.list.d/erlang.solutions.list fi version=${erlang_package_version} From 6d16531d3beee78288e06f8a7645747caf74ae30 Mon Sep 17 00:00:00 2001 From: Mark Bonicillo Date: Mon, 13 Jul 2020 15:54:24 -0700 Subject: [PATCH 2/4] Use prefix user to run commands --- scripts/rabbit_dependencies.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/rabbit_dependencies.sh b/scripts/rabbit_dependencies.sh index 4d15cd3a22..0c08b9389b 100755 --- a/scripts/rabbit_dependencies.sh +++ b/scripts/rabbit_dependencies.sh @@ -73,10 +73,10 @@ function install_on_debian { ${prefix} apt-get install apt-transport-https libwxbase3.0-0v5 libwxgtk3.0-0v5 libsctp1 build-essential python-dev openssl libssl-dev libevent-dev git ${prefix} apt-get purge -yf erlang* # Add the signing key - wget -O- https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc | apt-key add - + wget -O- https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc | ${prefix} apt-key add - if [[ ! -f "/etc/apt/sources.list.d/erlang.solutions.list" ]]; then - echo "deb https://packages.erlang-solutions.com/ubuntu $DIST contrib" | tee /etc/apt/sources.list.d/erlang.solutions.list + echo "deb https://packages.erlang-solutions.com/ubuntu $DIST contrib" | ${prefix} tee /etc/apt/sources.list.d/erlang.solutions.list fi version=${erlang_package_version} From b9447e992d0ce3df0ae372c832b6ac1bade91877 Mon Sep 17 00:00:00 2001 From: Craig A Date: Tue, 14 Jul 2020 14:57:15 -0400 Subject: [PATCH 3/4] Make sure the tests clean up after themselves, because they are using PlatformWrapper explicitly --- .../testutils/test_platformwrapper.py | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/volttrontesting/testutils/test_platformwrapper.py b/volttrontesting/testutils/test_platformwrapper.py index 2e3864bb14..fb2c75f455 100644 --- a/volttrontesting/testutils/test_platformwrapper.py +++ b/volttrontesting/testutils/test_platformwrapper.py @@ -73,20 +73,30 @@ # p.join() -@pytest.mark.parametrize("messagebus, ssl_auth", [('rmq', True)]) # , ('rmq', False), ('zmq', False)] ) +@pytest.mark.parametrize("messagebus, ssl_auth", [ + ('zmq', False) + # , ('zmq', False) + # , ('rmq', True) +]) def test_can_create(messagebus, ssl_auth): + p = PlatformWrapper(messagebus=messagebus, ssl_auth=ssl_auth) - assert not p.is_running() - assert p.volttron_home.startswith("/tmp/tmp") + try: + assert not p.is_running() + assert p.volttron_home.startswith("/tmp/tmp") + + p.startup_platform(vip_address=get_rand_tcp_address()) + assert p.is_running() + finally: + if p: + p.shutdown_platform() - p.startup_platform(vip_address=get_rand_tcp_address()) - assert p.is_running() - p.shutdown_platform() assert not p.is_running() + @pytest.mark.wrapper def test_volttron_config_created(volttron_instance): config_file = os.path.join(volttron_instance.volttron_home, "config") From 132c2a9fb9cdff1bc488281cb1b2bc7e07184322 Mon Sep 17 00:00:00 2001 From: Craig A Date: Tue, 14 Jul 2020 15:00:34 -0400 Subject: [PATCH 4/4] Build agent should disable store support, and allow a sleep so connections are successful --- volttrontesting/utils/platformwrapper.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/volttrontesting/utils/platformwrapper.py b/volttrontesting/utils/platformwrapper.py index 7d55853bed..63473c3b29 100644 --- a/volttrontesting/utils/platformwrapper.py +++ b/volttrontesting/utils/platformwrapper.py @@ -422,6 +422,9 @@ def build_agent(self, address=None, should_spawn=True, identity=None, self.logit("BUILD agent VOLTTRON HOME: {}".format(self.volttron_home)) if self.bind_web_address: kwargs['enable_web'] = True + + if 'enable_store' not in kwargs: + kwargs['enable_store'] = False agent = agent_class(address=address, identity=identity, publickey=publickey, secretkey=secretkey, serverkey=serverkey, @@ -716,6 +719,7 @@ def startup_platform(self, vip_address, auth_dict=None, # Use dynamic_agent so we can look and see the agent with peerlist. if not setupmode: + gevent.sleep(2) self.dynamic_agent = self.build_agent(identity="dynamic_agent") assert self.dynamic_agent is not None assert isinstance(self.dynamic_agent, Agent)