This does not help, login at test system succeeds and prompt settings
seem to be correct now, but Telnet.Login keyword fails anyway:
No match found for 'prompt=(#|>)' in 5 secondsUnfortunately
I am not familiar with Python and therefore I do not really understand
what is going on there in Telnet library, but I did put some prints in
the library code to see what is called and what is currently
self._prompt:
def set_prompt(self, prompt, prompt_is_regexp=False):
...
print >> sys.stderr, 'setting ... self prompt is {0},{1}'.format(self._prompt[0], self._prompt[1])
return old
def _prompt_is_set(self):
print >> sys.stderr, 'checking ... self prompt is {0},{1}'.format(self._prompt[0], self._prompt[1])
return self._prompt[0] is not NoneThe results are surprising. Before TC starts there are always about 15 (!) consecutive prints "
setting ... self prompt is None,False".
If we set the prompt by library import statement or by open connection keyword then in both cases the test succeeds and we get:
setting ... self prompt is <_sre.SRE_Pattern object at 0x027963E0>,True
setting ... self prompt is None,False
checking ... self prompt is <_sre.SRE_Pattern object at 0x027963E0>,True
checking ... self prompt is <_sre.SRE_Pattern object at 0x027963E0>,True
checking ... self prompt is <_sre.SRE_Pattern object at 0x027963E0>,True
test connection | PASS |
Hmm, I do not really understand here why prompt setting is undone and why nevertheless checking succeeds anyway !?
If
we use neither prompt setting by import statement nor by open
connection keyword but by using the set prompt keyword instead then we
get:
setting ... self prompt is None,False
setting ... self prompt is None,False
setting ... self prompt is <_sre.SRE_Pattern object at 0x027112F0>,True
setting ... self prompt is None,False
checking ... self prompt is None,False
checking ... self prompt is None,False
test connection | FAIL |
Prompt is not set
Well,
we had intermediately at least one valid prompt which was anyhow
overwritten afterwards like above. But now the check function tells the
truth and the test fails.
Last but not least the result of your proposal:
setting ... self prompt is None,False
setting ... self prompt is None,False
setting ... self prompt is <_sre.SRE_Pattern object at 0x026E1F50>,True
checking ... self prompt is <_sre.SRE_Pattern object at 0x026E1F50>,True
checking ... self prompt is <_sre.SRE_Pattern object at 0x026E1F50>,True
test connection | FAIL |
No match found for 'prompt=(#|>)' in 5 secondsWell,
the debug prints look better now than in all the other tries before,
but nevertheless the testcase fails although the prompt seems to be set
correctly.
Andreas