[thread-cert] output more logs in OTBR tests (#7003)

This commit is contained in:
Simon Lin
2021-09-13 08:49:02 -07:00
committed by GitHub
parent f329722edb
commit 7ba6111516
2 changed files with 12 additions and 0 deletions
+1
View File
@@ -276,6 +276,7 @@ do_build_otbr_docker()
"-DOT_SLAAC=ON"
"-DOT_SRP_CLIENT=ON"
"-DOT_TREL=OFF"
"-DOT_FULL_LOGS=ON"
"-DOT_UPTIME=ON"
"-DOTBR_DUA_ROUTING=ON"
"-DCMAKE_CXX_FLAGS='-DOPENTHREAD_CONFIG_DNSSD_SERVER_BIND_UNSPECIFIED_NETIF=1'"
+11
View File
@@ -59,6 +59,7 @@ class OtbrDocker:
_docker_proc = None
def __init__(self, nodeid: int, **kwargs):
self.verbose = int(float(os.getenv('VERBOSE', 0)))
try:
self._docker_name = config.OTBR_DOCKER_NAME_PREFIX + str(nodeid)
self._prepare_ot_rcp_sim(nodeid)
@@ -137,6 +138,8 @@ class OtbrDocker:
cmd = f'docker exec -i {self._docker_name} ot-ctl'
self.pexpect = pexpect.popen_spawn.PopenSpawn(cmd, timeout=30)
if self.verbose:
self.pexpect.logfile_read = sys.stdout.buffer
# Add delay to ensure that the process is ready to receive commands.
timeout = 0.4
@@ -716,6 +719,10 @@ class NodeImpl:
self.thread_stop()
self.interface_down()
def set_log_level(self, level: int):
self.send_command(f'log level {level}')
self._expect_done()
def interface_up(self):
self.send_command('ifconfig up')
self._expect_done()
@@ -1893,6 +1900,9 @@ class NodeImpl:
self.send_command('reset')
time.sleep(self.RESET_DELAY)
if self.is_otbr:
self.set_log_level(5)
def set_router_selection_jitter(self, jitter):
cmd = 'routerselectionjitter %d' % jitter
self.send_command(cmd)
@@ -3137,6 +3147,7 @@ class OtbrNode(LinuxHost, NodeImpl, OtbrDocker):
def start(self):
self._setup_sysctl()
self.set_log_level(5)
super().start()