lib/publiccloud/img_proof.pm

NAME

publiccloud::img_proof - Routines to run img-proof and parse its output

SYNOPSIS

use publiccloud::img_proof qw(run_img_proof);

my $results = run_img_proof($provider, instance => $instance, tests => $tests);

DESCRIPTION

Helper module for interacting with the img-proof tool during public cloud image testing.

run_img_proof

run_img_proof(
    $provider,
    instance => $instance,
    [provider => 'ec2',]
    [tests => 'test_security',]
    [distro => 'sles',]
    [timeout => 7200,]
    [results_dir => 'img_proof_results',]
    [user => 'ec2-user',]
    [key_name => 'my_key',]
    [credentials_file => 'aws_creds.json',]
    [running_instance_id => 'i-12345',]
    [exclude => 'test_a, test_b',]
    [beta => 0]
);

Calls the img-proof CLI tool and retrieves a hash reference containing the test results.

Updates $instance-public_ip> with the instance IP extracted from the command output. Returns a hash reference containing the parsed results (with instance_id and ip deleted from the returned hash).

provider - Public cloud provider instance object (first positional parameter)
instance - Mandatory public cloud instance object
provider - Cloud provider name string (e.g., 'azure', 'ec2', 'gce')
tests - Comma-separated or space-separated list of test cases to run (default: '')
distro - Target Linux distribution name passed to --distro (default: 'sles')
timeout - Execution timeout in seconds (default: 7200)
results_dir - Directory path for img-proof test results passed to --results-dir (default: 'img_proof_results')
user - SSH username used for accessing the target instance (-u)
key_name - Name or file path of the SSH key passed to --ssh-key-name
credentials_file - Path to service account or cloud credentials file passed to --service-account-file
running_instance_id - Override instance ID if different from $instance-instance_id>
exclude - Comma-separated list of test cases to exclude from execution (--exclude)
beta - Enable beta features flag in img-proof (default: 0)