]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virt-aa-helper-test: Silence ls
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 10 Jun 2025 09:58:34 +0000 (11:58 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 2 Jul 2025 11:54:10 +0000 (13:54 +0200)
virt-aa-helper checks presence of files before it adds them into
a profile. Because of that, test cases inside of
virt-aa-helper-test that require presence of /boot/initrd* are
guarded by a check. The check uses ls to find at least one initrd
file. If there's none, then ls prints an error onto stderr. This
is not helpful because the test script prints a message on its
own right after.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/virt-aa-helper-test

index 8259c2679fbf6183342a7ce722994e6ef410bcae..e462e4657088ac969c8b428daea311657a1ff584 100755 (executable)
@@ -201,7 +201,7 @@ testme "1" "bad disk2" "-c -u $valid_uuid" "$test_xml"
 sed -e "s,###UUID###,$uuid,g" -e "s,###DISK###,$disk1,g" -e "s,</devices>,<devices>,g" "$template_xml" > "$test_xml"
 testme "1" "malformed xml" "-c -u $valid_uuid" "$test_xml"
 
-initrd=`ls -1 /boot/initrd* | head -1`
+initrd=`ls -1 /boot/initrd* 2>/dev/null | head -1`
 if [ -z "$initrd" ]; then
     echo "Skipping /boot/initrd* tests. Could not find /boot/initrd*"
 else