[test] support full log (#4071)

This is useful when more logs are enabled and the logs contain
"leader", "child", "router" or "leader".
This commit is contained in:
Yakun Xu
2019-08-08 08:34:14 -07:00
committed by Jonathan Hui
parent 5d09ce7124
commit f740fda8d6
+2 -2
View File
@@ -476,11 +476,11 @@ class Node:
self._expect('Done')
def get_state(self):
states = ['detached', 'child', 'router', 'leader']
states = [r'\ndetached', r'\nchild', r'\nrouter', r'\nleader']
self.send_command('state')
match = self._expect(states)
self._expect('Done')
return states[match]
return states[match].strip(r'\n')
def set_state(self, state):
cmd = 'state %s' % state