From 24e2ebea23f6869ff1ca13c5f070236d395b5181 Mon Sep 17 00:00:00 2001 From: Michele Pagot Date: Mon, 2 Sep 2024 09:24:25 +0200 Subject: [PATCH] Fix cloud-init log collection (#20096) Properly takes in account IPADDR_CLOUDINIT setting default when deciding if log collection is needed or not. --- tests/sles4sap/ipaddr2/configure.pm | 2 +- tests/sles4sap/ipaddr2/deploy.pm | 2 +- tests/sles4sap/ipaddr2/sanity.pm | 2 +- tests/sles4sap/ipaddr2/test.pm | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/sles4sap/ipaddr2/configure.pm b/tests/sles4sap/ipaddr2/configure.pm index 5161e4a956d3..681fd5cb7ef0 100644 --- a/tests/sles4sap/ipaddr2/configure.pm +++ b/tests/sles4sap/ipaddr2/configure.pm @@ -57,7 +57,7 @@ sub test_flags { sub post_fail_hook { my ($self) = shift; ipaddr2_deployment_logs() if check_var('IPADDR2_DIAGNOSTIC', 1); - ipaddr2_os_cloud_init_logs() if (check_var('IPADDR2_CLOUDINIT', 1)); + ipaddr2_os_cloud_init_logs() unless check_var('IPADDR2_CLOUDINIT', 0); ipaddr2_destroy(); $self->SUPER::post_fail_hook; } diff --git a/tests/sles4sap/ipaddr2/deploy.pm b/tests/sles4sap/ipaddr2/deploy.pm index 439681ea6c25..ba30e80b12aa 100644 --- a/tests/sles4sap/ipaddr2/deploy.pm +++ b/tests/sles4sap/ipaddr2/deploy.pm @@ -39,7 +39,7 @@ sub test_flags { sub post_fail_hook { my ($self) = shift; ipaddr2_deployment_logs() if check_var('IPADDR2_DIAGNOSTIC', 1); - ipaddr2_os_cloud_init_logs() if (check_var('IPADDR2_CLOUDINIT', 1)); + ipaddr2_os_cloud_init_logs() unless check_var('IPADDR2_CLOUDINIT', 0); ipaddr2_destroy(); $self->SUPER::post_fail_hook; } diff --git a/tests/sles4sap/ipaddr2/sanity.pm b/tests/sles4sap/ipaddr2/sanity.pm index 47bce3084df0..4ad65f8de19d 100644 --- a/tests/sles4sap/ipaddr2/sanity.pm +++ b/tests/sles4sap/ipaddr2/sanity.pm @@ -29,7 +29,7 @@ sub test_flags { sub post_fail_hook { my ($self) = shift; ipaddr2_deployment_logs() if check_var('IPADDR2_DIAGNOSTIC', 1); - ipaddr2_os_cloud_init_logs() if (check_var('IPADDR2_CLOUDINIT', 1)); + ipaddr2_os_cloud_init_logs() unless check_var('IPADDR2_CLOUDINIT', 0); ipaddr2_destroy(); $self->SUPER::post_fail_hook; } diff --git a/tests/sles4sap/ipaddr2/test.pm b/tests/sles4sap/ipaddr2/test.pm index 3ed0e64cb880..6c14f64b0f9c 100644 --- a/tests/sles4sap/ipaddr2/test.pm +++ b/tests/sles4sap/ipaddr2/test.pm @@ -78,7 +78,7 @@ sub test_flags { sub post_fail_hook { my ($self) = shift; ipaddr2_deployment_logs() if check_var('IPADDR2_DIAGNOSTIC', 1); - ipaddr2_os_cloud_init_logs() if (check_var('IPADDR2_CLOUDINIT', 1)); + ipaddr2_os_cloud_init_logs() unless check_var('IPADDR2_CLOUDINIT', 0); ipaddr2_destroy(); $self->SUPER::post_fail_hook; }