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

[SDAF] Sanity check for files being created by SDAF #21367

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lpalovsky
Copy link
Contributor

@lpalovsky lpalovsky commented Mar 6, 2025

SDAF test code is missing sanity checks afte 'sap_systems' deployment wchich
would help troubleshooting SDAF failures. This PR adds checks for important
files that should be created by SDAF - 'SUT ssh key' and 'ansible inventory
file'

@@ -43,6 +43,7 @@ our @EXPORT = qw(
generate_deployer_name
get_workload_vnet_code
get_sdaf_inventory_path
get_sut_sshkey_path
Copy link
Contributor Author

Choose a reason for hiding this comment

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

SSH key filename was hardcoded in few other places so I added a common function.

=item * B<sdaf_region_code>: SDAF parameter to choose PC region. Note SDAF is using internal abbreviations (SECE = swedencentral)

=item * B<vnet_code>: SDAF parameter for virtual network code. Library and deployer use different vnet than SUT env
=item * B<config_root_path>: SDAF config root path
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reducing number of arguments. Full path can be obtained but other function get_sdaf_config_path by the caller.

@lpalovsky lpalovsky force-pushed the sdaf_path_checks branch 3 times, most recently from 50b8d6e to e9acbc7 Compare March 6, 2025 14:19
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

if ($playbook_options->{playbook_filename} eq 'pb_get-sshkey.yaml') {
record_info('File check', "Check if SSH key '$sut_private_key_path' was created by SDAF");
assert_script_run("test -f $sut_private_key_path");
}
Copy link
Contributor

@lilyeyes lilyeyes Mar 7, 2025

Choose a reason for hiding this comment

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

It seems no pb_get-sshkey.yaml related Check if SSH key checking in VR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it should be =~ not eq.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh... thanks. Didn't notice that. Will fix it once I refactor the code.

Copy link
Contributor

@lilyeyes lilyeyes left a comment

Choose a reason for hiding this comment

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

Generally LGTM.

@lpalovsky lpalovsky force-pushed the sdaf_path_checks branch 2 times, most recently from 11e9940 to 70207b7 Compare March 10, 2025 13:55
# Conflicts:
#	tests/sles4sap/sap_deployment_automation_framework/execute_playbooks.pm
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