Skip to content

Refactor Azure diagnostic log retrieval and improve error handling#25018

Open
mpagot wants to merge 1 commit intoos-autoinst:masterfrom
mpagot:qesap_az_diagnostic
Open

Refactor Azure diagnostic log retrieval and improve error handling#25018
mpagot wants to merge 1 commit intoos-autoinst:masterfrom
mpagot:qesap_az_diagnostic

Conversation

@mpagot
Copy link
Contributor

@mpagot mpagot commented Mar 18, 2026

Centralize the logic for fetching Azure VM boot diagnostics in azure_cli.pm
by enhancing az_vm_diagnostic_log_get with timeout support and
better error reporting.
Refactor qesap_az_diagnostic_log to use this centralized function,
reducing code duplication.
Update unit tests in 15_qesap_azure.t and 21_sles4sap_azure_cli.t
to reflect these changes and cover new failure scenarios.

Verification run:

qesap regression

sle-15-SP7-Qesap-Azure-Byos-x86_64-BuildLATEST_AZURE_SLE15_7

Old az cli

Simulate failure in terraform

publiccloud_tools_azure_cli_2.84.0_18032026.qcow2

publiccloud_tools_azure_cli_2.82.0_18032026.qcow2

publiccloud_tools_azure_cli_2.80.0_18032026.qcow2

sle-12-SP5-Qesap-Azure-Byos-x86_64-BuildLATEST_AZURE_SLE12_5

Old az cli
-> http://openqaworker15.qe.prg2.suse.org/tests/360093

sle-12-SP5-Qesap-Azure-Payg-x86_64-BuildLATEST_AZURE_SLE12_5

Old az cli
-> http://openqaworker15.qe.prg2.suse.org/tests/360094

hanasr

sle-15-SP4-HanaSr-Azure-Byos-x86_64-Build15-SP4_2026

Simulate Ansible failure
-> http://openqaworker15.qe.prg2.suse.org/tests/360099

publiccloud_tools_azure_cli_2.84.0_18032026.qcow2

publiccloud_tools_azure_cli_2.82.0_18032026.qcow2

publiccloud_tools_azure_cli_2.80.0_18032026.qcow2

ipaddr2

sle-15-SP5-SapCloud-Azure-Payg-x86_64-BuildLATEST_AZURE_SLE15_5-ipaddr2_azure_test

publiccloud_tools_azure_cli_2.80.0_18032026.qcow2

There is also a post fail hook failure that result in some leftovers

[2026-03-20T19:26:16.769521+01:00] [debug] [pid:68422] >>> testapi::wait_serial: (?^u:aPTcE-\d+-): fail
[2026-03-20T19:26:16.772708+01:00] [debug] [pid:68422] post_fail_hook failed: command 'scp -J cloudadmin@172.201.58.114 cloudadmin@10.24.0.41:/tmp/cloudregister_1.txt /tmp/ip2t-vm-01/cloudregister_1.txt' timed out at /usr/lib/os-autoinst/testapi.pm line 997.
  	testapi::script_run("scp -J cloudadmin\@172.201.58.114 cloudadmin\@10.24.0.41:/tmp/c"...) called at /var/lib/openqa/pool/41/os-autoinst-distri-opensuse/lib/sles4sap/ipaddr2.pm line 2469

publiccloud_tools_azure_cli_2.82.0_18032026.qcow2

publiccloud_tools_azure_cli_2.84.0_18032026.qcow2

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

my @log_files = qesap_az_diagnostic_log();

ok((any { $_->{resource_group} eq 'DENTIST' } @calls), 'Proper resource group in vm list');
#ok((any { $_->{query} =~ /id:id,name:name/ } @calls), 'Proper query in vm list');
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the commented code still needed?

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

@mpagot mpagot force-pushed the qesap_az_diagnostic branch from b6aa545 to 4a5470e Compare March 20, 2026 17:58
Centralize the logic for fetching Azure VM boot diagnostics in azure_cli.pm
by enhancing az_vm_diagnostic_log_get with timeout support and better
error reporting. Refactor qesap_az_diagnostic_log to use this centralized
function, reducing code duplication. Update unit tests in 15_qesap_azure.t
and 21_sles4sap_azure_cli.t to reflect these changes and cover new
failure scenarios.
@mpagot mpagot force-pushed the qesap_az_diagnostic branch from 4a5470e to e0d3a3f Compare March 20, 2026 23:45
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