From 91e19b16b1438e4db973e2670f3b7ffd4247b7fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Mon, 19 Oct 2026 19:01:02 -0300 Subject: [PATCH] test(profiles): check packaged modes independently of checkout RPM preparation removes group write permission from source files. Assert the packaged data and postinstall modes instead of comparing them with checkout permissions. Report modes in octal and keep the content, alias and customization checks. --- xCAT-test/native/profile_package_payload.t | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT-test/native/profile_package_payload.t b/xCAT-test/native/profile_package_payload.t index 6aedc3d0c..0711a6d9b 100644 --- a/xCAT-test/native/profile_package_payload.t +++ b/xCAT-test/native/profile_package_payload.t @@ -36,8 +36,8 @@ for my $source (@assets) { my $delivered = "$root/opt/xcat/share/xcat/$relative"; ok(-r $delivered, "$relative is readable after extraction") or next; is(read_binary($delivered), read_binary($source), "$relative retains its complete contents"); - is(S_IMODE((stat($delivered))[2]), S_IMODE((stat($source))[2]), - "$relative retains its permissions"); + is(sprintf('%04o', S_IMODE((stat($delivered))[2])), $source =~ /\.postinstall$/ ? '0755' : '0644', + "$relative has the packaged permissions"); } my ($status, $output) = run_command($^X, repo_path('xCAT-test/unit/profile_customization.t'), "$root/opt/xcat"); @@ -57,8 +57,8 @@ if (!-f '/etc/debian_version') { ok(-r $delivered, "reduced RPM: $relative still resolves") or next; is(read_binary($delivered), read_binary($source), "reduced RPM: $relative retains its complete contents"); - is(S_IMODE((stat($delivered))[2]), S_IMODE((stat($source))[2]), - "reduced RPM: $relative retains its permissions"); + is(sprintf('%04o', S_IMODE((stat($delivered))[2])), $source =~ /\.postinstall$/ ? '0755' : '0644', + "reduced RPM: $relative has the packaged permissions"); } }