mirror of
https://git.yoctoproject.org/poky
synced 2026-04-21 21:32:12 +02:00
quilt: run tests as ptest user, and let that user write into the tests
The tests need to run as a non-root user, but that user also needs to be able to write into the tests directory to create the work directories. Use the new ptest user that ptest-runner creates to avoid having to add a new user, and ensure that the test/ directory is owned by the ptest group and that group has write access. This solves the ptest regression where since oe-core 9a287b4 no quilt tests were actually running. A better solution would be to allow the tests to create a work directory in another directory, but that would need work upstream which can happen later. (From OE-Core rev: 70dc9c114283cde18771287fb17fcebc537e7387) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
598fafb89e
commit
ea4c56e2e8
@@ -61,6 +61,9 @@ do_install:append:class-native () {
|
||||
touch ${D}${sysconfdir}/quiltrc
|
||||
}
|
||||
|
||||
# The tests need to run as a non-root user, so pull in the ptest user
|
||||
DEPENDS:append:class-target = "${@bb.utils.contains('PTEST_ENABLED', '1', ' ptest-runner', '', d)}"
|
||||
|
||||
do_install_ptest() {
|
||||
install ${WORKDIR}/test.sh ${D}${PTEST_PATH}
|
||||
mkdir ${D}${PTEST_PATH}/test
|
||||
@@ -69,6 +72,14 @@ do_install_ptest() {
|
||||
rm -f ${D}${PTEST_PATH}/test/mail.test ${D}${PTEST_PATH}/test/patch-wrapper.test
|
||||
}
|
||||
|
||||
# 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 ptest ${D}${PTEST_PATH}/test
|
||||
chmod g+w ${D}${PTEST_PATH}/test
|
||||
}
|
||||
|
||||
PACKAGES += "guards guards-doc"
|
||||
|
||||
FILES:${PN} = "${sysconfdir} ${datadir}/quilt \
|
||||
@@ -84,5 +95,5 @@ RDEPENDS:${PN}-ptest += "file sed gawk diffutils findutils ed perl \
|
||||
perl-module-filehandle perl-module-getopt-std \
|
||||
perl-module-posix perl-module-file-temp \
|
||||
perl-module-text-parsewords perl-module-overloading \
|
||||
bash util-linux-getopt \
|
||||
bash util-linux-getopt ptest-runner \
|
||||
"
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
/usr/sbin/adduser --disabled-password --gecos "" quilttest
|
||||
|
||||
su -c ./test.sh quilttest
|
||||
|
||||
/usr/sbin/deluser quilttest
|
||||
su -c ./test.sh ptest
|
||||
|
||||
Reference in New Issue
Block a user