Skip to contentSkip to conversation

tests/qtest: Run the fuzz-sdcard-test only on i386 and x86_64

PATCH In review Thomas Huth 1 participant 2 messages Apr 14, 2022 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/qtest: Run the fuzz-sdcard-test only on i386 and x86_64

The fuzz-sdcard-test is currently scheduled for all targets, but the code limits itself to "i386". Move it to the right list in meson.build and allow it to be run on "x86_64", too.

While we're at it, also clean up the wrong indentation in fuzz-sdcard-test.c (it was using 3 spaces instead of 4 in some lines).

---
 tests/qtest/fuzz-sdcard-test.c | 6 +++---
 tests/qtest/meson.build        | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
tests/qtest/fuzz-sdcard-test.c +3 -3
index 0f94965a66..7707038a71 100644
@@ -168,11 +168,11 @@ int main(int argc, char **argv)
 
     g_test_init(&argc, &argv, NULL);
 
-   if (strcmp(arch, "i386") == 0) {
+    if (g_str_equal(arch, "i386") || g_str_equal(arch, "x86_64")) {
         qtest_add_func("fuzz/sdcard/oss_fuzz_29225", oss_fuzz_29225);
         qtest_add_func("fuzz/sdcard/oss_fuzz_36217", oss_fuzz_36217);
         qtest_add_func("fuzz/sdcard/oss_fuzz_36391", oss_fuzz_36391);
-   }
+    }
 
-   return g_test_run();
+    return g_test_run();
 }
tests/qtest/meson.build +1 -1
index 1709fc6ccb..f3bee0b4c5 100644
@@ -22,7 +22,6 @@ qtests_generic = \
   (config_all_devices.has_key('CONFIG_LSI_SCSI_PCI') ? ['fuzz-lsi53c895a-test'] : []) + \
   (config_all_devices.has_key('CONFIG_VIRTIO_SCSI') ? ['fuzz-virtio-scsi-test'] : []) + \
   (config_all_devices.has_key('CONFIG_SB16') ? ['fuzz-sb16-test'] : []) + \
-  (config_all_devices.has_key('CONFIG_SDHCI_PCI') ? ['fuzz-sdcard-test'] : []) + \
   [
   'cdrom-test',
   'device-introspect-test',
@@ -67,6 +66,7 @@ qtests_i386 = \
   (config_all_devices.has_key('CONFIG_TPM_TIS_ISA') ? ['tpm-tis-swtpm-test'] : []) +        \
   (config_all_devices.has_key('CONFIG_RTL8139_PCI') ? ['rtl8139-test'] : []) +              \
   (config_all_devices.has_key('CONFIG_E1000E_PCI_EXPRESS') ? ['fuzz-e1000e-test'] : []) +   \
+  (config_all_devices.has_key('CONFIG_SDHCI_PCI') ? ['fuzz-sdcard-test'] : []) +            \
   (config_all_devices.has_key('CONFIG_ESP_PCI') ? ['am53c974-test'] : []) +                 \
   (config_all_devices.has_key('CONFIG_ACPI_ERST') ? ['erst-test'] : []) +                        \
   (config_all_devices.has_key('CONFIG_VIRTIO_NET') and                                      \
Signature · 1 line
2.27.0
#1 lore raw
Quoted 11 lines · Thomas Huth

The fuzz-sdcard-test is currently scheduled for all targets, but the code limits itself to "i386". Move it to the right list in meson.build and allow it to be run on "x86_64", too.

While we're at it, also clean up the wrong indentation in fuzz-sdcard-test.c (it was using 3 spaces instead of 4 in some lines).

---
  tests/qtest/fuzz-sdcard-test.c | 6 +++---

Oh, well, I just noticed that the other fuzz tests have the same issue, to (they only work on x86) ... so never mind this patch, I'll create a new one that moves the other fuzz tests, too.

Thomas