Skip to contentSkip to conversation

dosfstools: Add ptests

PATCH Superseded [email protected] 2 participants 3 messages Jul 10, 2025 – Jul 11, 2025

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dosfstools: Add ptests

From: Ricardo Simoes <[email protected]>

---
 .../distro/include/ptest-packagelists.inc     |  1 +
 .../dosfstools/dosfstools_4.2.bb              | 30 ++++++++++++++++++-
 .../dosfstools/files/run-ptest                |  5 ++++
 3 files changed, 35 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/dosfstools/files/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 4253c7b062..46c8945eb4 100644
@@ -99,6 +99,7 @@ PTESTS_SLOW = "\
     coreutils \
     curl \
     dbus \
+    dosfstools \
     e2fsprogs \
     elfutils \
     gettext \
meta/recipes-devtools/dosfstools/dosfstools_4.2.bb +29 -1
index 86fb68f664..a7ba279f3a 100644
@@ -10,18 +10,46 @@ LICENSE = "GPL-3.0-only"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 
 SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/${BP}.tar.gz \
+           file://run-ptest \
            file://source-date-epoch.patch \
            file://0001-fsck.fat-Adhere-to-the-fsck-exit-codes.patch \
            file://0002-manpages-Document-fsck.fat-new-exit-codes.patch \
            "
 SRC_URI[sha256sum] = "64926eebf90092dca21b14259a5301b7b98e7b1943e8a201c7d726084809b527"
 
-inherit autotools gettext pkgconfig update-alternatives github-releases
+inherit autotools gettext pkgconfig ptest update-alternatives github-releases
 
 EXTRA_OECONF = "--enable-compat-symlinks --without-iconv"
 
 CFLAGS += "-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
 
+do_install_ptest () {
+    mkdir -p ${D}${PTEST_PATH}/tests
+    install -m 0744 ${S}/tests/* ${D}${PTEST_PATH}/tests/
+    install -m 0744 ${S}/test-driver ${D}${PTEST_PATH}/tests/
+
+    mkdir -p ${D}${PTEST_PATH}/src
+    ln -sf /sbin/mkfs.fat ${D}${PTEST_PATH}/src/mkfs.fat
+    ln -sf /sbin/fsck.fat ${D}${PTEST_PATH}/src/fsck.fat
+    ln -sf /sbin/fatlabel ${D}${PTEST_PATH}/src/fatlabel
+
+    # dosfstools tests depends on variables defined in the tests/Makefile.
+    # To run the tests, we need to modify the following:
+    # - srcdir: used to find the test scripts for each dosfstools tools
+    # - top_srcdir: used to find the test-driver script
+    # - Makefile: originally used to recreate build rules when needed. They're not needed here
+    #             because we only want to run the tests.
+    # - XXD_FOUND: Always satisfied by RDEPENDS of ptest package
+    sed \
+        -e 's/^srcdir = ..*/srcdir = \./'         \
+        -e 's/^top_srcdir = ..*/top_srcdir = \./' \
+        -e 's/^Makefile: ..*/Makefile: /'         \
+        -e 's/XXD_FOUND=/XXD_FOUND=yes/'          \
+        ${B}/tests/Makefile > ${D}${PTEST_PATH}/tests/Makefile
+}
+
+RDEPENDS:${PN}-ptest += "make xxd gawk"
+
 BBCLASSEXTEND = "native nativesdk"
 
 ALTERNATIVE_PRIORITY = "100"
meta/recipes-devtools/dosfstools/files/run-ptest new file +5 -0
new file mode 100644
index 0000000000..4f6e349a23
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+cd tests
+
+make check
Signature · 1 line
2.34.1
#1 lore raw
Quoted 5 lines · Mark Jonas via lists.openembedded.org

From: Ricardo Simoes <[email protected]>

---

Hi Ricardo,

Thanks for your patch!

It looks like some of the added ptests are failing:

WARNING: core-image-ptest-dosfstools-1.0-r0 do_testimage: There were failing ptests.
...
{'dosfstools': 'START: ptest-runner\n'
'2025-07-11T10:03\n'
'make test-mkfs test-fsck test-label referenceFAT12.mkfs ' 'referenceFAT12.xxd referenceFAT16.mkfs referenceFAT16.xxd ' 'referenceFAT32.mkfs referenceFAT32.xxd referenceFAT32mbr.mkfs ' 'referenceFAT32mbr.xxd mkfs-fat32_2_res_sects.mkfs ' 'mkfs-fat32_2_res_sects.xxd mkfs-fat32_4K.mkfs ' 'mkfs-fat32_4K.xxd check-bad_names.fsck check-bad_names.xxd ' 'check-fat12_first_cluster.fsck check-fat12_first_cluster.args ' 'check-fat12_first_cluster.xxd check-fat16_first_cluster.fsck ' 'check-fat16_first_cluster.args check-fat16_first_cluster.xxd ' 'check-fat32_first_cluster.fsck check-fat32_first_cluster.args ' 'check-fat32_first_cluster.xxd check-fat16_dos_cln_shut.fsck ' 'check-fat16_dos_cln_shut.xxd check-fat32_dos_cln_shut.fsck ' 'check-fat32_dos_cln_shut.xxd check-chain_to_free_cluster.fsck ' 'check-chain_to_free_cluster.xxd check-chain_too_long.fsck ' 'check-chain_too_long.xxd check-chain_to_other_file.fsck ' 'check-chain_to_other_file.xxd check-circular_chain.fsck ' 'check-circular_chain.xxd check-duplicate_names.fsck ' 'check-duplicate_names.xxd check-dot_entries.fsck ' 'check-dot_entries.xxd check-huge.fsck ' 'check-label-different.fsck check-label-different.xxd ' 'check-label-only-boot.fsck check-label-only-boot.xxd ' 'check-label-only-root.fsck check-label-only-root.xxd ' 'label-fat32_mkdosfs_label1_dosfslabel_empty.label ' 'label-fat32_mkdosfs_label1_dosfslabel_empty.xxd ' 'label-fat32_mkdosfs_label1_dosfslabel_label2.label ' 'label-fat32_mkdosfs_label1_dosfslabel_label2.xxd ' 'label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.label ' 'label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.xxd ' 'label-fat32_mkdosfs_label1_mlabel_erase.label ' 'label-fat32_mkdosfs_label1_mlabel_erase.xxd ' 'label-fat32_mkdosfs_label1_mlabel_NO_NAME.label ' 'label-fat32_mkdosfs_label1_mlabel_NO_NAME.xxd ' 'label-fat32_mkdosfs_label1_xp_erase.label ' 'label-fat32_mkdosfs_label1_xp_erase.xxd ' 'label-fat32_mkdosfs_label1_xp_label2.label ' 'label-fat32_mkdosfs_label1_xp_label2.xxd ' 'label-fat32_mkdosfs_label1.label ' 'label-fat32_mkdosfs_label1.xxd ' 'label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.label ' 'label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.xxd ' 'label-fat32_mkdosfs_none_dosfslabel_label1.label ' 'label-fat32_mkdosfs_none_dosfslabel_label1.xxd ' 'label-fat32_mkdosfs_none_dosfslabel_NO_NAME.label ' 'label-fat32_mkdosfs_none_dosfslabel_NO_NAME.xxd ' 'label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.label ' 'label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.xxd ' 'label-fat32_mkdosfs_none_xp_label1.label ' 'label-fat32_mkdosfs_none_xp_label1.xxd ' 'label-fat32_mkdosfs_none.label label-fat32_mkdosfs_none.xxd ' 'label-fat32_xp_label1.label label-fat32_xp_label1.xxd ' 'label-fat32_xp_none_dosfslabel_label1.label ' 'label-fat32_xp_none_dosfslabel_label1.xxd ' 'label-fat32_xp_none_mlabel_label1.label ' 'label-fat32_xp_none_mlabel_label1.xxd ' 'label-fat32_xp_none.label label-fat32_xp_none.xxd\n' 'make: /bin/bash: No such file or directory\n'
'make: *** [Makefile:858: check-am] Error 127\n'
'\n'
'ERROR: Exit status is 2\n'
'DURATION: 0\n'}

ptests which had no test results:
['dosfstools']

https://autobuilder.yoctoproject.org/valkyrie/#/builders/73/builds/1880
https://autobuilder.yoctoproject.org/valkyrie/#/builders/56/builds/201

Full ptest logs can be found here:

https://valkyrie.yocto.io/pub/non-release/20250711-49/testresults/qemux86-64-ptest/core-image-ptest-dosfstools/
https://valkyrie.yocto.io/pub/non-release/20250711-47/testresults/qemuriscv64-ptest/core-image-ptest-dosfstools/

Can you have a look at these failures please?

Signature · 3 lines
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

Salut Mathieu,

We tested using core-image-base and ptest-pkgs. Thus, we missed out on some dependencies. We'll send an updated patch shortly.

Thank you for testing.

Cheers,
Mark

Quoted 158 lines

-----Ursprüngliche Nachricht-----
Von: Mathieu Dubois-Briand <[email protected]>
Gesendet: Freitag, 11. Juli 2025 13:23
An: Jonas Mark (BT-FS/ENG1-Mue) <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; Simoes Ricardo (BT- FS/ENG1.1-2) <[email protected]>
Betreff: Re: [OE-core] [PATCH] dosfstools: Add ptests

Quoted 5 lines · Mark Jonas via lists.openembedded.org

From: Ricardo Simoes <[email protected]>

---

Hi Ricardo,

Thanks for your patch!

It looks like some of the added ptests are failing:

WARNING: core-image-ptest-dosfstools-1.0-r0 do_testimage: There were failing ptests.
...
{'dosfstools': 'START: ptest-runner\n'
'2025-07-11T10:03\n'
'make test-mkfs test-fsck test-label
referenceFAT12.mkfs '
'referenceFAT12.xxd referenceFAT16.mkfs
referenceFAT16.xxd '
'referenceFAT32.mkfs referenceFAT32.xxd
referenceFAT32mbr.mkfs '
'referenceFAT32mbr.xxd mkfs-fat32_2_res_sects.mkfs ' 'mkfs-fat32_2_res_sects.xxd mkfs-fat32_4K.mkfs ' 'mkfs-fat32_4K.xxd check-bad_names.fsck check-
bad_names.xxd '
'check-fat12_first_cluster.fsck check-
fat12_first_cluster.args '
'check-fat12_first_cluster.xxd check-
fat16_first_cluster.fsck '
'check-fat16_first_cluster.args check-
fat16_first_cluster.xxd '
'check-fat32_first_cluster.fsck check-
fat32_first_cluster.args '
'check-fat32_first_cluster.xxd check-
fat16_dos_cln_shut.fsck '
'check-fat16_dos_cln_shut.xxd check-
fat32_dos_cln_shut.fsck '
'check-fat32_dos_cln_shut.xxd check-
chain_to_free_cluster.fsck '
'check-chain_to_free_cluster.xxd check-
chain_too_long.fsck '
'check-chain_too_long.xxd check-
chain_to_other_file.fsck '
'check-chain_to_other_file.xxd check-
circular_chain.fsck '
'check-circular_chain.xxd check-duplicate_names.fsck ' 'check-duplicate_names.xxd check-dot_entries.fsck ' 'check-dot_entries.xxd check-huge.fsck ' 'check-label-different.fsck check-label-different.xxd ' 'check-label-only-boot.fsck check-label-only-boot.xxd ' 'check-label-only-root.fsck check-label-only-root.xxd ' 'label-fat32_mkdosfs_label1_dosfslabel_empty.label ' 'label-fat32_mkdosfs_label1_dosfslabel_empty.xxd ' 'label-fat32_mkdosfs_label1_dosfslabel_label2.label ' 'label-fat32_mkdosfs_label1_dosfslabel_label2.xxd ' 'label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.label ' 'label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.xxd ' 'label-fat32_mkdosfs_label1_mlabel_erase.label ' 'label-fat32_mkdosfs_label1_mlabel_erase.xxd ' 'label-fat32_mkdosfs_label1_mlabel_NO_NAME.label ' 'label-fat32_mkdosfs_label1_mlabel_NO_NAME.xxd ' 'label-fat32_mkdosfs_label1_xp_erase.label ' 'label-fat32_mkdosfs_label1_xp_erase.xxd ' 'label-fat32_mkdosfs_label1_xp_label2.label ' 'label-fat32_mkdosfs_label1_xp_label2.xxd ' 'label-fat32_mkdosfs_label1.label ' 'label-fat32_mkdosfs_label1.xxd '
'label-
fat32_mkdosfs_none_dosfslabel_label1_xp_label2.label '

               'label-
fat32_mkdosfs_none_dosfslabel_label1_xp_label2.xxd '
               'label-fat32_mkdosfs_none_dosfslabel_label1.label '
               'label-fat32_mkdosfs_none_dosfslabel_label1.xxd '
               'label-fat32_mkdosfs_none_dosfslabel_NO_NAME.label '
               'label-fat32_mkdosfs_none_dosfslabel_NO_NAME.xxd '
               'label-
fat32_mkdosfs_none_xp_label1_dosfslabel_label2.label '
               'label-
fat32_mkdosfs_none_xp_label1_dosfslabel_label2.xxd '
               'label-fat32_mkdosfs_none_xp_label1.label '
               'label-fat32_mkdosfs_none_xp_label1.xxd '
               'label-fat32_mkdosfs_none.label label-
fat32_mkdosfs_none.xxd '
               'label-fat32_xp_label1.label label-fat32_xp_label1.xxd
'
               'label-fat32_xp_none_dosfslabel_label1.label '
               'label-fat32_xp_none_dosfslabel_label1.xxd '
               'label-fat32_xp_none_mlabel_label1.label '
               'label-fat32_xp_none_mlabel_label1.xxd '
               'label-fat32_xp_none.label label-fat32_xp_none.xxd\n'
               'make: /bin/bash: No such file or directory\n'
               'make: *** [Makefile:858: check-am] Error 127\n'
               '\n'
               'ERROR: Exit status is 2\n'
               'DURATION: 0\n'}

ptests which had no test results:
['dosfstools']

https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fauto
builder.yoctoproject.org%2Fvalkyrie%2F%23%2Fbuilders%2F73%2Fbuilds%2F1 880&data=05%7C02%7Cmark.jonas%40de.bosch.com%7Cc6d83af9dc9c4ef0162408d dc06d4402%7C0ae51e1907c84e4bbb6d648ee58410f4%7C0%7C0%7C638878297694194 990%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMC IsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata= JLHTr%2B93pDfaG8w2ttgLkIMFtszab48Niv5CwrFvxlU%3D&reserved=0
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fauto
builder.yoctoproject.org%2Fvalkyrie%2F%23%2Fbuilders%2F56%2Fbuilds%2F2 01&data=05%7C02%7Cmark.jonas%40de.bosch.com%7Cc6d83af9dc9c4ef0162408dd c06d4402%7C0ae51e1907c84e4bbb6d648ee58410f4%7C0%7C0%7C6388782976942331 92%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCI sIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=s JxNAIJKERr%2F6t3AQRVhCloJFH%2FuSF4PPk2RH5QgujY%3D&reserved=0

Full ptest logs can be found here:

https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvalk
yrie.yocto.io%2Fpub%2Fnon-release%2F20250711- 49%2Ftestresults%2Fqemux86-64-ptest%2Fcore-image-ptest- dosfstools%2F&data=05%7C02%7Cmark.jonas%40de.bosch.com%7Cc6d83af9dc9c4 ef0162408ddc06d4402%7C0ae51e1907c84e4bbb6d648ee58410f4%7C0%7C0%7C63887 8297694260488%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIw LjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C %7C&sdata=nFrw9Yyy%2BLH1O8jwD6C0w%2FgaIRC958%2BOG%2FWIb5kFH4Y%3D&reser ved=0
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvalk
yrie.yocto.io%2Fpub%2Fnon-release%2F20250711- 47%2Ftestresults%2Fqemuriscv64-ptest%2Fcore-image-ptest- dosfstools%2F&data=05%7C02%7Cmark.jonas%40de.bosch.com%7Cc6d83af9dc9c4 ef0162408ddc06d4402%7C0ae51e1907c84e4bbb6d648ee58410f4%7C0%7C0%7C63887 8297694287660%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIw LjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C %7C&sdata=%2FJnchgCRVyxKyCrdiOoaUG67MJrBXBXdlXfOdw0CP04%3D&reserved=0

Can you have a look at these failures please?

--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fboot
lin.com%2F&data=05%7C02%7Cmark.jonas%40de.bosch.com%7Cc6d83af9dc9c4ef0 162408ddc06d4402%7C0ae51e1907c84e4bbb6d648ee58410f4%7C0%7C0%7C63887829 7694316436%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjA uMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C &sdata=w8F1v4O34UOnwZ3G5DE1abJRBWD1cMMme9Uz4PM6MxA%3D&reserved=0