Skip to contentSkip to conversation

dosfstools: Add ptests

PATCH Superseded [email protected] 3 participants 5 messages Jul 11, 2025 – Jul 15, 2025

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 dosfstools: Add ptests

From: Ricardo Simoes <[email protected]>

---
v1 -> v2:
- Add missing RDEPENDS of ptest
- Link tools to /usr/sbin instead of /sbin

 .../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..0772f39381 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 /usr/sbin/mkfs.fat ${D}${PTEST_PATH}/src/mkfs.fat
+    ln -sf /usr/sbin/fsck.fat ${D}${PTEST_PATH}/src/fsck.fat
+    ln -sf /usr/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 += "bash diffutils gawk make xxd"
+
 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

A small nit
There are some tabs vs spaces discrepancies

Quoted 100 lines · On Fri, Jul 11, 2025 at 9:54 AM <[email protected]> wrote:

From: Ricardo Simoes <[email protected]>

---
v1 -> v2:
- Add missing RDEPENDS of ptest
- Link tools to /usr/sbin instead of /sbin

 .../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 +1 -0
index 86fb68f664..0772f39381 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"

meta/recipes-devtools/dosfstools/dosfstools_4.2.bb +1 -1
-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"

meta/recipes-devtools/dosfstools/dosfstools_4.2.bb +15 -0
+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 /usr/sbin/mkfs.fat ${D}${PTEST_PATH}/src/mkfs.fat
+    ln -sf /usr/sbin/fsck.fat ${D}${PTEST_PATH}/src/fsck.fat
+    ln -sf /usr/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

meta/recipes-devtools/dosfstools/dosfstools_4.2.bb +12 -0
+    #             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 += "bash diffutils gawk make xxd"
+
 BBCLASSEXTEND = "native nativesdk"
 
 ALTERNATIVE_PRIORITY = "100"
meta/recipes-devtools/dosfstools/files/run-ptest new file +5 -1
new file mode 100644
index 0000000000..4f6e349a23
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+cd tests
+
+make check
--

2.34.1

#2 lore raw

Hi Khem,

We really tried but were not able to find any tabs at all in neither dosfstools_4.2.bb, run-ptest, nor ptest-packagelists.inc. Also oelint-adv did not find anything. Can you give us a concrete hint what to look out for?

Later today we will anyhow send a v3 of the patch. We’ll replace the verbatim /usr/sbin with $sbindir and use install instead of mkdir.

Thanks for the review,
Mark

Von: Khem Raj <[email protected]>
Gesendet: Freitag, 11. Juli 2025 19:05
An: Jonas Mark (BT-FS/ENG1-Mue) <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Simoes Ricardo (BT-FS/ENG1.1-2) <[email protected]>
Betreff: Re: [PATCH v2] dosfstools: Add ptests

A small nit
There are some tabs vs spaces discrepancies

On Fri, Jul 11, 2025 at 9:54 AM <[email protected]<mailto:[email protected]>> wrote:
From: Ricardo Simoes <[email protected]<mailto:[email protected]>>

---
v1 -> v2:
- Add missing RDEPENDS of ptest
- Link tools to /usr/sbin instead of /sbin

 .../distro/include/ptest-packagelists.inc     |  1 +
 .../dosfstools/dosfstools_4.2.bb<http://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<http://dosfstools_4.2.bb/> +29 -1
index 86fb68f664..0772f39381 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 /usr/sbin/mkfs.fat ${D}${PTEST_PATH}/src/mkfs.fat
+    ln -sf /usr/sbin/fsck.fat ${D}${PTEST_PATH}/src/fsck.fat
+    ln -sf /usr/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 += "bash diffutils gawk make xxd"
+
 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

--
2.34.1

#3 lore raw

Patchtest results for AW: [PATCH v2] dosfstools: Add ptests

Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:

---
Testing patch /home/patchtest/share/mboxes/AW-PATCH-v2-dosfstools-Add-ptests.patch

FAIL: test Signed-off-by presence: Mbox is missing Signed-off-by. Add it manually or with "git commit --amend -s" (test_mbox.TestMbox.test_signed_off_by_presence)

PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)

SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: pretest src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.pretest_src_uri_left_files)
SKIP: test CVE check ignore: No modified recipes or older target branch, skipping test (test_metadata.TestMetadata.test_cve_check_ignore)
SKIP: test CVE tag format: No new CVE patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new CVE patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new CVE patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum modified not mentioned: No modified recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.test_src_uri_left_files)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!

#4 lore raw
In reply to Jonas Mark (BT-FS/ENG1-Mue)

Hi Khem,

We just sent a v3 of the patch.

The only thing which came to our minds in regards of tabs vs. spaces was the shell function formatting rule of the Yocto Project and OpenEmbedded Contributor Guide:

The formatting of shell functions should be consistent within layers. Some use tabs, some use spaces.

We checked the existing recipes and found recipes using tabs, 4 spaces, 8 spaces, or a mixture. We went for 4 spaces because this matches the indentation of Python functions. This gives recipes using Python as well as shell functions a coherent look.

Cheers,
Mark

Von: Jonas Mark (BT-FS/ENG1-Mue) <[email protected]>
Gesendet: Montag, 14. Juli 2025 09:55
An: Khem Raj <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Simoes Ricardo (BT-FS/ENG1.1-2) <[email protected]>; Jonas Mark (BT-FS/ENG1-Mue) <[email protected]>
Betreff: AW: [PATCH v2] dosfstools: Add ptests

Hi Khem,

We really tried but were not able to find any tabs at all in neither dosfstools_4.2.bb, run-ptest, nor ptest-packagelists.inc. Also oelint-adv did not find anything. Can you give us a concrete hint what to look out for?

Later today we will anyhow send a v3 of the patch. We’ll replace the verbatim /usr/sbin with $sbindir and use install instead of mkdir.

Thanks for the review,
Mark

Von: Khem Raj <[email protected]<mailto:[email protected]>>
Gesendet: Freitag, 11. Juli 2025 19:05
An: Jonas Mark (BT-FS/ENG1-Mue) <[email protected]<mailto:[email protected]>>
Cc: [email protected]<mailto:[email protected]>; [email protected]<mailto:[email protected]>; [email protected]<mailto:[email protected]>; Simoes Ricardo (BT-FS/ENG1.1-2) <[email protected]<mailto:[email protected]>>
Betreff: Re: [PATCH v2] dosfstools: Add ptests

A small nit
There are some tabs vs spaces discrepancies

On Fri, Jul 11, 2025 at 9:54 AM <[email protected]<mailto:[email protected]>> wrote:
From: Ricardo Simoes <[email protected]<mailto:[email protected]>>

---
v1 -> v2:
- Add missing RDEPENDS of ptest
- Link tools to /usr/sbin instead of /sbin

 .../distro/include/ptest-packagelists.inc     |  1 +
 .../dosfstools/dosfstools_4.2.bb<http://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<http://dosfstools_4.2.bb/> +29 -1
index 86fb68f664..0772f39381 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 /usr/sbin/mkfs.fat ${D}${PTEST_PATH}/src/mkfs.fat
+    ln -sf /usr/sbin/fsck.fat ${D}${PTEST_PATH}/src/fsck.fat
+    ln -sf /usr/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 += "bash diffutils gawk make xxd"
+
 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

--
2.34.1