mirror of
https://github.com/espressif/openthread.git
synced 2026-10-05 07:17:39 +00:00
detect harness configuration (#1367)
This commit is contained in:
@@ -27,6 +27,7 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
import ConfigParser
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
@@ -223,7 +224,12 @@ class HarnessCase(unittest.TestCase):
|
|||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
self._hc.start()
|
self._hc.start()
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
os.system('taskkill /t /f /im chrome.exe')
|
|
||||||
|
harness_config = ConfigParser.ConfigParser()
|
||||||
|
harness_config.read('%s\\Config\\Configuration.ini' % settings.HARNESS_HOME)
|
||||||
|
if harness_config.has_option('THREAD_HARNESS_CONFIG', 'BrowserAutoNavigate') and \
|
||||||
|
harness_config.getboolean('THREAD_HARNESS_CONFIG', 'BrowserAutoNavigate'):
|
||||||
|
os.system('taskkill /t /f /im chrome.exe')
|
||||||
|
|
||||||
def _destroy_harness(self):
|
def _destroy_harness(self):
|
||||||
"""Stop harness backend service
|
"""Stop harness backend service
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
|
import ConfigParser
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
@@ -37,6 +38,9 @@ from autothreadharness import settings
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
HARNESS_SVN_VERSION_R44 = 1471
|
||||||
|
"""int: this is the first published release that miniweb was removed from Harness"""
|
||||||
|
|
||||||
def _try_kill(proc):
|
def _try_kill(proc):
|
||||||
logger.info('Try kill process')
|
logger.info('Try kill process')
|
||||||
times = 1
|
times = 1
|
||||||
@@ -71,6 +75,10 @@ class HarnessController(object):
|
|||||||
self.result_dir = result_dir
|
self.result_dir = result_dir
|
||||||
self.harness_file = ''
|
self.harness_file = ''
|
||||||
|
|
||||||
|
harness_info = ConfigParser.ConfigParser()
|
||||||
|
harness_info.read('%s\\info.ini' % settings.HARNESS_HOME)
|
||||||
|
self.version = harness_info.getint('Thread_Harness_Info', 'SVN')
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
logger.info('Starting harness service')
|
logger.info('Starting harness service')
|
||||||
if self.harness:
|
if self.harness:
|
||||||
@@ -89,7 +97,7 @@ class HarnessController(object):
|
|||||||
env=env)
|
env=env)
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|
||||||
if settings.HARNESS_VERSION > 33:
|
if self.version >= HARNESS_SVN_VERSION_R44:
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.miniweb:
|
if self.miniweb:
|
||||||
@@ -110,7 +118,7 @@ class HarnessController(object):
|
|||||||
else:
|
else:
|
||||||
logger.warning('Harness not started yet')
|
logger.warning('Harness not started yet')
|
||||||
|
|
||||||
if settings.HARNESS_VERSION > 33:
|
if self.version >= HARNESS_SVN_VERSION_R44:
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.miniweb:
|
if self.miniweb:
|
||||||
|
|||||||
@@ -116,6 +116,3 @@ Example parameters for the 'APC_PDU_CONTROLLER':
|
|||||||
Example parameters for the 'NORDIC_BOARD_PDU_CONTOLLER':
|
Example parameters for the 'NORDIC_BOARD_PDU_CONTOLLER':
|
||||||
{'boards_serial_numbers': ('12345123', ...)}
|
{'boards_serial_numbers': ('12345123', ...)}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
HARNESS_VERSION = 35
|
|
||||||
"""int: Version of the installed Thread Harness."""
|
|
||||||
|
|||||||
Reference in New Issue
Block a user