labgrid icon indicating copy to clipboard operation
labgrid copied to clipboard

linux shell prompt not found

Open khilman opened this issue 9 months ago • 6 comments

I'm having problems getting linux shell prompt to match in ShellDriver. This is what have this in config yaml

      - ShellDriver:
#          prompt: 'root@\w+:[^ ]+ '
          prompt: 'root@BeaglePlay'
          login_prompt: ' login: '
          username: 'root'

The default shell prompt on this platform is root@BeaglePlay:~# and the initial prompt (copied from the labgrid docs) didn't work, so I tried a more basic match without the regex and it still doesn't match. What am I doing wrong here?

In the backtrace below, you can see exactly what's in the pexpect buffer (including the $MARKER) and the re.compile expression, but I can't figure out why this isn't matching.

<labgrid.util.expect.PtxExpect object at 0x7f4581da2750>
command: None
args: None
buffer (last 100 chars): b"T'\r\n\x1b[?2004hroot@BeaglePlay:~# echo 'MMNW''MJJJKT'\r\n\x1b[?2004l\rMMNWMJJJKT\r\n\x1b[?2004hroot@BeaglePlay:~# "
before (last 100 chars): b"T'\r\n\x1b[?2004hroot@BeaglePlay:~# echo 'MMNW''MJJJKT'\r\n\x1b[?2004l\rMMNWMJJJKT\r\n\x1b[?2004hroot@BeaglePlay:~# "
after: <class 'pexpect.exceptions.TIMEOUT'>
match: None
match_index: None
exitstatus: None
pid: None
child_fd: -1
closed: True
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 1
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
    0: re.compile(b'MMNWMJJJKT\\s+root@BeaglePlay')

khilman avatar May 07 '24 22:05 khilman