UEFI shell color codes + fastmodels emulated serial console makes it impossible to parse output with pexpect.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
LAVA Dispatcher |
Won't Fix
|
Critical
|
Anmar Oueja |
Bug Description
For reference:
http://
[a] Boot Manager
[b] Shell
[c] Reboot
[d] Shutdown
Start:
Invalid input, please choose a menu option from the list above
Start: b
[2J[01;
[1m[33m
[1m[33m[40m FS1:[0m[37m[40m [1m[37m
[1m[33m[40m FS0:[0m[37m[40m [1m[37m
[1m[33m[40m BLK6:[0m[37m[40m [1m[37m
[1m[33m[40m BLK0:[0m[37m[40m [1m[37m
[1m[33m[40m BLK4:[0m[37m[40m [1m[37m
[1m[33m[40m BLK5:[0m[37m[40m [1m[37m
[1m[33m[40m BLK1:[0m[37m[40m [1m[37m
[1m[33m[40m BLK3:[0m[37m[40m [1m[37m
[22;01HPress [1m[37m
As you can see from the job above, LAVA is unable to parse the output due to the presense of color codes used in the UEFI shell. This is a major blocker as LAVA cannot be used to test UEFI properly, and should be fixed ASAP.
Related branches
- Antonio Terceiro: Needs Resubmitting
-
Diff: 242 lines (+104/-8)11 files modifiedlava_dispatcher/client/targetdevice.py (+1/-1)
lava_dispatcher/device/fastmodel.py (+4/-2)
lava_dispatcher/device/ipmi_pxe.py (+1/-1)
lava_dispatcher/device/master.py (+1/-1)
lava_dispatcher/device/qemu.py (+1/-1)
lava_dispatcher/device/sdmux.py (+1/-1)
lava_dispatcher/device/target.py (+1/-1)
lava_dispatcher/tests/__init__.py (+1/-0)
lava_dispatcher/tests/simulate_uefi_on_fastmodel.py (+10/-0)
lava_dispatcher/tests/test_utils.py (+61/-0)
lava_dispatcher/utils.py (+22/-0)
Changed in lava-dispatcher: | |
status: | New → Confirmed |
importance: | Undecided → Critical |
assignee: | nobody → Georgy Redkozubov (gesha) |
summary: |
- UEFI shell color codes make it impossible to parse output with pexpect. + UEFI shell color codes makes it impossible to parse output with pexpect. |
description: | updated |
Changed in lava-dispatcher: | |
milestone: | none → 2013.07 |
Changed in lava-dispatcher: | |
assignee: | Georgy Redkozubov (gesha) → Antonio Terceiro (terceiro) |
Changed in lava-dispatcher: | |
status: | Confirmed → In Progress |
assignee: | Antonio Terceiro (terceiro) → Anmar Oueja (anmar) |
summary: |
- UEFI shell color codes makes it impossible to parse output with pexpect. + UEFI shell color codes + fastmodels emulated serial console makes it + impossible to parse output with pexpect. |
Changed in lava-dispatcher: | |
status: | In Progress → Won't Fix |
We could filter the data from the serial line using this regular expresssion:
'\x1b\[[0-9;]*m'
An example:
$ cat /tmp/remove- ansi-codes. py
import re
import sys
input_file = sys.argv[1]
with open(input_file, 'r') as data: '\x1b\[ [0-9;]* m', '', line)
print( filtered. strip() )
for line in data.readlines():
filtered = re.sub(