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

Change the prompt wait after crash approach #20245

Conversation

mpagot
Copy link
Contributor

@mpagot mpagot commented Sep 20, 2024

HanaSR test has a command to crash the SUT to be sent through ssh to the remote SUT. There is code after sending this command to check the prompt is available and eventually unlock it.
Fix an issue where this prompt checking break the next command sending procedure.

Verification run:

sle-15-SP6-HanaSr-Aws-Byos-x86_64-Build15-SP6_2024-09-19T02:04:03Z-hanasr_aws_test_fencing_sbd ec2_r4.8xlarge

sle-15-SP6-HanaSr-Azure-Byos-x86_64-Build15-SP6_2024-09-19T02:04:03Z-hanasr_azure_test_saptune_msi az_Standard_E4s_v3

Crash command typed here at 17:31:28

[2024-09-20T17:31:28.601214+02:00] [debug] [pid:58842] <<< consoles::serial_screen::type_string(cmd="backend_type_string", text="ssh

Execution immediately returns from script_run and run_ssh_command. At this point stop_hana calls wait_serial at 17:31:28

[2024-09-20T17:31:28.605581+02:00] [debug] [pid:58700] tests/sles4sap/publiccloud/hana_sr_takeover.pm:62 called sles4sap_publiccloud::stop_hana -> lib/sles4sap_publiccloud.pm:408 called testapi::wait_serial

Prompt is detected in no time 17:31:28, was not blocked.

[2024-09-20T17:31:28.839548+02:00] [info] [pid:58842] ::: consoles::serial_screen::read_until: Matched output from SUT in 3 loops & 0.231783708790317 seconds: # 

The new code from the PR sends a ret to get one more prompt for the next serial_run to check

[2024-09-20T17:31:28.842139+02:00] [debug] [pid:58700] <<< testapi::send_key(key="ret", wait_screen_change=0)

Here the next test stage that sends the next command

[2024-09-20T17:31:28.846574+02:00] [debug] [pid:58700] <<< testapi::script_run(cmd="nc -vz -w 1

And now, with the PR fix, it get is immediately

[2024-09-20T17:31:28.849796+02:00] [info] [pid:58842] ::: consoles::serial_screen::read_until: Matched output from SUT in 2 loops & 0.000877343816682696 seconds: # 
[2024-09-20T17:31:28.850659+02:00] [debug] [pid:58700] >>> testapi::wait_serial: # : ok

Copy link

Great PR! Please pay attention to the following items before merging:

Files matching lib/**.pm:

  • Consider adding or extending unit tests in t/

This is an automatically generated QA checklist based on modified files.

@mpagot mpagot changed the title Change way to wait prompt after crash Change the prompt wait after crash approach Sep 20, 2024
@mpagot mpagot force-pushed the sles4sap_publiccloud_hanasr_crash_wait_serial branch from 44b4810 to 3d9254d Compare September 20, 2024 14:46
@mpagot mpagot marked this pull request as ready for review September 20, 2024 16:04
Copy link
Contributor

@alvarocarvajald alvarocarvajald left a comment

Choose a reason for hiding this comment

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

LGTM

lib/sles4sap_publiccloud.pm Outdated Show resolved Hide resolved
Copy link
Contributor

@lpalovsky lpalovsky left a comment

Choose a reason for hiding this comment

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

LGTM

HanaSR test has a command for crashing the SUT.
There is code after sending this command to check that the
prompt is available and eventually unlock it.
Fix an issue where this prompt checking break the next command sending
procedure.
@mpagot mpagot force-pushed the sles4sap_publiccloud_hanasr_crash_wait_serial branch from 3d9254d to 0df406b Compare September 23, 2024 06:22
@mpagot mpagot enabled auto-merge (squash) September 23, 2024 06:23
@mpagot mpagot merged commit e896ce1 into os-autoinst:master Sep 23, 2024
10 checks passed
linguini-dev pushed a commit to linguini-dev/os-autoinst-distri-opensuse that referenced this pull request Sep 27, 2024
HanaSR test has a command for crashing the SUT.
There is code after sending this command to check that the
prompt is available and eventually unlock it.
Fix an issue where this prompt checking break the next command sending
procedure.
feri pushed a commit to feri/os-autoinst-distri-opensuse that referenced this pull request Oct 30, 2024
HanaSR test has a command for crashing the SUT.
There is code after sending this command to check that the
prompt is available and eventually unlock it.
Fix an issue where this prompt checking break the next command sending
procedure.
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.

3 participants