-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
astring.strip_console_codes raises error on recent kernel messages #133
Comments
smitterl
added a commit
to smitterl/aexpect
that referenced
this issue
Aug 7, 2024
Fixes: avocado-framework#133 In recent kernel boots, stripping raised error because of missing control characters. Add them: `c` is clear/reset screen `!p` - don't know `]104` - don't know Signed-off-by: Sebastian Mitterle <[email protected]>
It looks to me the sequences are: ESC c: terminal reset I don't have details about the OS command 104. Ref. https://gist.github.com/justinmk/a5102f9a0c1810437885a04a07ef0a91 |
smitterl
added a commit
to smitterl/aexpect
that referenced
this issue
Aug 30, 2024
Fixes: avocado-framework#133 In recent kernel boots, stripping raised error because of missing control characters. Add them: `c` reset screen `!p` soft reset terminal `]104` - execute OS command '104' These control characters are listed in the xterm control sequence cheat sheet at https://gist.github.com/justinmk/a5102f9a0c1810437885a04a07ef0a91 Signed-off-by: Sebastian Mitterle <[email protected]>
smitterl
added a commit
to smitterl/tp-libvirt
that referenced
this issue
Jan 15, 2025
aexpect will raise an error if the console contains certain control codes, s. avocado-framework/aexpect#133 This happens in `get_stripped_output`. By using `get_output`, this can't happen and the test passes. Signed-off-by: Sebastian Mitterle <[email protected]>
Found a good reproducer With the attached file 'min_ouptut': from aexpect.utils import astring
f = open("output.log", "rb")
output = f.read().decode("UTF-8", 'backslashreplace')
astring.strip_console_codes(output) will result in error: Traceback (most recent call last):
File "/root/aexpect/aexpect/utils/astring.py", line 55, in strip_console_codes
special_code = re.findall(console_codes, tmp_word)[0]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/root/aexpect/aexpect/utils/astring.py", line 58, in strip_console_codes
raise ValueError(f"{tmp_word} is not included in the known "
ValueError: [!p is not included in the known console codes list %[G@8]|\[[@A-HJ-MPXa-hl-nqrsu\`]|\[[\d;]+[HJKgqnrm]|#8|\([B0UK]|\)|\[\?2004[lh] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Applying the strip_console_codes to the output of a recent (rescue) kernel "6.10.0-15" boot messages, a test error is raised:
The location that hits this is after the 'read-only' in
The tmp_word at this point is:
before it's recognized as unknown word.
IIUC "ESC c" is used to clear the console and in python this ESC is
\x1b
displayed as^[
. https://man7.org/linux/man-pages/man4/console_codes.4.htmlThe text was updated successfully, but these errors were encountered: