why does ptest for cpio and quilt need to "chgrp" to ptest?

"Robert P. J. Day" <[email protected]> Thu, 25 Jun 2026 10:07:56 -0400 (EDT)
Newsgroups org.yoctoproject.lists.docs
Message-ID <[email protected]>
  currently writing some additional documentation for ptest and poring
over the class and recipes and ran across something i had not noticed
before.

  the ptest-runner recipe, near the end, creates a "ptest" account:

# Create a non-root user that test suites can use easily
inherit useradd
USERADD_PACKAGES = "${PN}"
USERADD_PARAM:${PN} = "--system --no-create-home --home / --user-group ptest"

  ok, so that suggests that *some* ptests will want to, what, run
under the "ptest" user or group? so i kept looking and, first, in
"ptest.bbclass", there's this in the middle of do
_install_ptest_base():

    do_install_ptest
    chown -R root:root ${D}${PTEST_PATH}

ok, so the ptest directory for any ptest-enabled recipe will be
"root:root", meaning that a non-root account will have no ability to
write anything under there.

  but the cpio recipe (as is quilt) is a special case as it contains
the following:

# ptest.bbclass currently chowns the ptest directory explicitly, so we need to
# change permission after that has happened so the ptest user can write a
# temporary directory.
do_install_ptest_base:append() {
    chgrp -R ptest ${D}${PTEST_PATH}/
    chmod -R g+w ${D}${PTEST_PATH}/
}

  so i guess the ptest for cpio wants to write under the ptest
directory; hence the need for "chgrp" to "ptest". i'm not sure what is
going on here since i see only two recipes -- cpio and quilt -- that
do this. i am unclear on the relationship between the user and group
under which ptest-runner is running, and what about cpio *requires*
its ptest directory to have a group of "ptest".

  i just find it odd that ptest-runner creates a "ptest" account, but
only two OE recipes take advantage of it.

rday