Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

Commit 7edda4c

Browse files
authored
Merge pull request #452 from openweave/feature/add_siac_support_in_weave_service_test
Add support for a standalone test service instance (SiaC) in OpenWeave service tests.
2 parents 8c398a3 + 2885eeb commit 7edda4c

File tree

3 files changed

+16
-22
lines changed

3 files changed

+16
-22
lines changed

src/test-apps/happy/test-templates/WeaveTunnelStart.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33

44
#
5-
# Copyright (c) 2016-2017 Nest Labs, Inc.
5+
# Copyright (c) 2016-2018 Nest Labs, Inc.
6+
# Copyright (c) 2019 Google, LLC.
67
# All rights reserved.
78
#
89
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -158,7 +159,11 @@ def __pre_check(self):
158159
else:
159160
if "weave_service_address" in os.environ.keys():
160161
self.skip_service_end = True
161-
self.service_dir_server = os.environ['weave_service_address']
162+
if "unstable" not in os.environ["weave_service_address"]:
163+
self.service_dir_server = os.environ["weave_service_address"]
164+
else:
165+
self.customized_tunnel_port = 20895
166+
self.service_dir_server = os.environ["weave_service_address"] + ":%d" % self.customized_tunnel_port
162167
self.logger.debug("[localhost] WeaveTunnelStart against tier %s." % self.service_dir_server)
163168
else:
164169
# Check if service node was given
@@ -318,9 +323,6 @@ def __start_tunnel_at_gateway(self):
318323
self.key_file = self.case_key_path if self.case_key_path else os.path.join(self.main_conf['log_directory'], self.gateway_weave_id.upper() + '-key.weave-b64')
319324
cmd += ' --node-cert ' + self.cert_file + ' --node-key ' + self.key_file
320325

321-
if self.customized_tunnel_port:
322-
self.service_dir_server = self.service_dir_server + ":%d" % self.customized_tunnel_port
323-
324326
if self.service_dir:
325327
cmd += " --service-dir " + str(self.service_weave_id) + ' --service-dir-server ' + self.service_dir_server
326328
else:

src/test-apps/happy/tests/service/pairing/test_weave_pairing_01.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,9 @@ def setUp(self):
5757
if "unstable" not in os.environ["weave_service_address"]:
5858
found = re.search('.(\w+).nestlabs.com', os.environ["weave_service_address"])
5959
self.tier = found.group(1)
60-
self.customized_tunnel_port = None
6160
else:
6261
found = re.search('(\w+.unstable).nestlabs.com', os.environ["weave_service_address"])
6362
self.tier = found.group(1)
64-
self.customized_tunnel_port = 20895
6563

6664
self.topology_setup_required = int(os.environ.get("TOPOLOGY", "1")) == 1
6765

@@ -157,9 +155,6 @@ def __start_tunnel_from(self, gateway):
157155
options["case"] = self.case
158156
options["service_dir"] = self.use_service_dir
159157

160-
if self.customized_tunnel_port:
161-
options["customized_tunnel_port"] = self.customized_tunnel_port
162-
163158
weave_tunnel = WeaveTunnelStart.WeaveTunnelStart(options)
164159
ret = weave_tunnel.run()
165160

src/test-apps/happy/tests/service/run_single_weave_service_test.sh

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33

44
#
5-
# Copyright (c) 2016-2017 Nest Labs, Inc.
5+
# Copyright (c) 2016-2018 Nest Labs, Inc.
6+
# Copyright (c) 2019 Google, LLC.
67
# All rights reserved.
78
#
89
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -28,23 +29,19 @@
2829

2930
export CASE=1
3031
export USE_SERVICE_DIR=1
31-
export weave_service_address='frontdoor.lt3.nestlabs.com'
32+
export weave_service_address='frontdoor.qa.nestlabs.com'
3233
export happy_dns='8.8.8.8 172.16.255.1 172.16.255.153 172.16.255.53'
33-
# export RESOURCE_IDS='gsrbr1'
34+
export RESOURCE_IDS='thd1'
35+
export FABRIC_SEED='00001'
36+
export DEVICE_NUMBERS=1
37+
3438
# exit if something fails
3539
set -e
3640

37-
# By default, run a mutual subscription test. If tests have been
38-
# listed as arguments, run those instead
39-
40-
# pairing/test_weave_pairing_01.py
41-
# echo/test_weave_echo_02.py
42-
# wdmNext/test_weave_wdm_next_service_mutual_subscribe_01.py
43-
# wdmNext/test_weave_wdm_next_service_update_*
44-
4541
if [[ $# -eq 0 ]]
4642
then
47-
#wdmNext/test_weave_wdm_next_service_mutual_subscribe_01.py
43+
pairing/test_weave_pairing_01.py
44+
wdmNext/test_weave_wdm_next_service_mutual_subscribe_01.py
4845
else
4946
for test_to_run in $* ; do python $test_to_run ; done
5047
fi

0 commit comments

Comments
 (0)