lib/sles4sap/crash.pm

SYNOPSIS

Library to manage cloud crash tests

crash_deploy_name

my $name = crash_deploy_name();

Return the deploy name. Azure use it as resource group name

crash_deploy_azure

Run the Azure deployment for the crash test

region - existing resource group
os - existing Load balancer NAME

crash_deploy_aws

Run the AWS deployment for the crash test Returns the instance ID

region - existing resource group
image_name - OS image name
image_owner - OS image owner
instance_type - Instance type of the VM
ssh_pub_key - ssh public key to be uploaded in the VM

crash_deploy_gcp

Run the GCP deployment for the crash test

region - GCP region
zone - GCP zone (e.g., 'us-central1-a')
project - GCP project ID
version - OS version
image_project - image project name
machine_type - machine type (e.g., 'n1-standard-2')
ssh_key - ssh_key file

crush_pubip

Get the deployment public IP of the VM. Die if an unsupported csp name is provided.

provider - Cloud provider name using same format of PUBLIC_CLOUD_PROVIDER setting
region deployment region

crash_get_username

my $username = crash_get_username(provider => 'GCE');

Get the username for SSH login based on cloud provider

provider - Cloud provider name (EC2, AZURE, GCE)

crash_get_instance

my $instance = crash_get_instance(
    provider => 'GCE',
    region => 'us-central1');

Create and return a publiccloud::instance object for the crash test VM

provider - Cloud provider name (EC2, AZURE, GCE)
region - Cloud region

crash_cleanup

crash_cleanup(
    provider => 'GCE',
    region => 'us-central1');

Clean up cloud resources for crash test

provider - Cloud provider name (EC2, AZURE, GCE)
region - Cloud region

crash_system_ready

Polls C<systemctl is-system-running> via SSH for up to 5 minutes.
If C<reg_code> is provided, registers the system and verifies with C<SUSEConnect -s>.
reg_code Registration code.
ssh_command SSH command for registration.
scc_endpoint The way of doing registration, SUSEConnect or registercloudguest.

crash_softrestart

crash_softrestart(instance => $instance [, timeout => 600]);

Does a soft restart of the given instance by running the command shutdown -r.

instance instance of the PC class.
timeout

crash_wait_back

crash_wait_back(vm_ip => '1.2.3.4');

Wait until SUT is back again polling port 22 on the given IP. Then list for failed services and die if find one.

vm_ip Public IP address of the SUT, can be calculated by crash_pubip
username Public IP address of the SUT, can be calculated by crash_pubip

crash_destroy_azure

Delete the Azure deployment

crash_destroy_aws

Delete the AWS deployment

region region where the deployment has been deployed in AWS

crash_destroy_gcp

Delete the GCP deployment

zone - GCP zone where the deployment was created
region - GCP region