Skip to content
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

Removing the escape sequence from the console output! #140

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

Anushree-Mathur
Copy link
Contributor

The output coming from the console Terminal consists of Bracketed Paste escape sequence! I have updated the code in a way that it will check the status output and see if the output has this sequence, it will remove this from the output and then use only integer o/p of status command!

Before applying the patch status output was:
^[[?2004l0

After applying the patch status output is:
0
Signed-off-by: Anushree Mathur [email protected]

The output coming from the console Terminal consists of Bracketed Paste escape sequence! I have updated the code in a way that it will check the status output and see if the output has this sequence, it will remove this from the output and then use only integer o/p of status command!

Before applying the patch status output was:
^[[?2004l0

After applying the patch status output is:
0

Signed-off-by: Anushree Mathur <[email protected]>
@Anushree-Mathur
Copy link
Contributor Author

Debug log for the run:
2045 [stdlog] revision : 2.0 (pvr 0080 0200)
2046 [stdlog]
2047 [stdlog] timebase : 512000000
2048 [stdlog] platform : pSeries
2049 [stdlog] model : IBM pSeries (emulated by qemu)
2050 [stdlog] machine : CHRP IBM pSeries (emulated by qemu)
2051 [stdlog] MMU : Radix
2052 [stdlog] ^[[?2004h[root@localhost ~]# echo $?
2053 [stdlog] ^[[?2004l0
2054 [stdlog] ^[[?2004h[root@localhost ~]#
2055 [stdlog] 2024-11-18 07:19:20,468 avocado.virttest.virsh virsh L1651 DEBUG| Define VM from /var/tmp/avocado_x1g4tgel/tmpi3v0aazb
2056 [stdlog] 2024-11-18 07:19:20,506 avocado.test stacktrace L0041 ERROR|
2057 [stdlog] 2024-11-18 07:19:20,506 avocado.test stacktrace L0043 ERROR| Reproduced traceback from: /usr/local/lib/python3.13/site-packages/avocado_vt/test.py:298
2058 [stdlog] 2024-11-18 07:19:20,507 avocado.test stacktrace L0050 ERROR| Traceback (most recent call last):
2059 [stdlog] 2024-11-18 07:19:20,507 avocado.test stacktrace L0050 ERROR| File "/home/Anu/tests/data/avocado-vt/virttest/test-providers.d/downloads/io-github-autotest-libvirt/l ibvirt/tests/src/virsh_cmd/domain/virsh_create.py", line 142, in run
2060 [stdlog] 2024-11-18 07:19:20,507 avocado.test stacktrace L0050 ERROR| test.fail("Fail to verify console")
2061 [stdlog] 2024-11-18 07:19:20,507 avocado.test stacktrace L0050 ERROR| ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
2062 [stdlog] 2024-11-18 07:19:20,507 avocado.test stacktrace L0050 ERROR| File "/usr/local/lib/python3.13/site-packages/avocado/core/test.py", line 754, in wrapper
2063 [stdlog] 2024-11-18 07:19:20,507 avocado.test stacktrace L0050 ERROR| return func(actual_message)
2064 [stdlog] 2024-11-18 07:19:20,508 avocado.test stacktrace L0050 ERROR| File "/usr/local/lib/python3.13/site-packages/avocado/core/test.py", line 770, in fail
2065 [stdlog] 2024-11-18 07:19:20,508 avocado.test stacktrace L0050 ERROR| raise exceptions.TestFail(msg)
2066 [stdlog] 2024-11-18 07:19:20,508 avocado.test stacktrace L0050 ERROR| avocado.core.exceptions.TestFail: Fail to verify console

Before applying the patch

(04/13) type_specific.io-github-autotest-libvirt.virsh.create.console: STARTED
(04/13) type_specific.io-github-autotest-libvirt.virsh.create.console: FAIL: Fail to verify console (31.39 s)
(05/13) type_specific.io-github-autotest-libvirt.virsh.create.console_autodestroy: STARTED
(05/13) type_specific.io-github-autotest-libvirt.virsh.create.console_autodestroy: FAIL: Fail to verify console (36.26 s)
(06/13) type_specific.io-github-autotest-libvirt.virsh.create.console_paused: STARTED
(06/13) type_specific.io-github-autotest-libvirt.virsh.create.console_paused: FAIL: Fail to verify console (32.15 s)
(07/13) type_specific.io-github-autotest-libvirt.virsh.create.console_autodestroy_paused: STARTED
(07/13) type_specific.io-github-autotest-libvirt.virsh.create.console_autodestroy_paused: FAIL: Fail to verify console (37.00 s)

After applying the patch

 (04/13) type_specific.io-github-autotest-libvirt.virsh.create.console: STARTED
 (04/13) type_specific.io-github-autotest-libvirt.virsh.create.console: PASS (30.13 s)
 (05/13) type_specific.io-github-autotest-libvirt.virsh.create.console_autodestroy: STARTED
 (05/13) type_specific.io-github-autotest-libvirt.virsh.create.console_autodestroy: PASS (34.90 s)
 (06/13) type_specific.io-github-autotest-libvirt.virsh.create.console_paused: STARTED
 (06/13) type_specific.io-github-autotest-libvirt.virsh.create.console_paused: PASS (30.53 s)
 (07/13) type_specific.io-github-autotest-libvirt.virsh.create.console_autodestroy_paused: STARTED
 (07/13) type_specific.io-github-autotest-libvirt.virsh.create.console_autodestroy_paused: PASS (34.43 s)

@Anushree-Mathur
Copy link
Contributor Author

@ldoktor I have closed the last Pull request[https://github.com//pull/139] and created a new one here with changes that you had suggested! Could you please review and merge this PR! Thanks in advance.

Copy link
Contributor

@ldoktor ldoktor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, LGTM. Btw there is no need to open new PR per version, a force push is generally preferred.

@ldoktor ldoktor merged commit 72d2e67 into avocado-framework:main Nov 29, 2024
@Anushree-Mathur
Copy link
Contributor Author

Thank you for merging this PR @ldoktor! I agree with this but I had to close the previous one as 2 commits got added by mistake in that PR while doing force push!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants