labgrid-project / labgrid-project/labgrid

linux shell prompt not found

Open
#1,397 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
528
Forks
278
Avg merge
2d 19h
Merged PRs (30d)
4

Description

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')

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the ShellDriver prompt-matching entry point and compare the configured prompt with the pexpect buffer and compiled expression shown in the report. Done means the configured Linux shell prompt is recognized on this platform without the timeout, with the behavior covered by the relevant existing test entry point if one is identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.