]> code.ossystems Code Review - openembedded-core.git/commitdiff
quilt: run ptest as normal user
authorDengke Du <dengke.du@windriver.com>
Fri, 25 Mar 2016 08:28:54 +0000 (04:28 -0400)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 26 Mar 2016 22:49:36 +0000 (22:49 +0000)
When the user is root, run quilt ptest, the faildiff.test failed.
Because in the faildiff.test, we drop the read permission of the
file test.txt, we can't "quilt refresh" as normal user, so we got
the following:
>~ .*diff:test\.txt: Permission denied
> Diff failed on file 'test.txt', aborting
But when the user is root, we can access the file, so we got the
following:
> Nothing in patch patchs/test.diff
So the faildiff.test was failed. We should create a normal user
to run the ptest in the run-ptest scripts to slove the problem.

Signed-off-by: Dengke Du <dengke.du@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/quilt/quilt.inc
meta/recipes-devtools/quilt/quilt/run-ptest
meta/recipes-devtools/quilt/quilt/test.sh [new file with mode: 0755]

index 837b36ba8c94c6174d1edec0d7bc2b64290a3b76..4e393c4d8f6c1b5ce20e2a2934fb5e02ebe5cf64 100644 (file)
@@ -8,6 +8,7 @@ SRC_URI = "${SAVANNAH_GNU_MIRROR}/quilt/quilt-${PV}.tar.gz \
         file://install.patch \
         file://run-ptest \
         file://Makefile \
+       file://test.sh \
 "
 
 SRC_URI[md5sum] = "fc0310db5868a0873d602d4332a76d43"
@@ -50,8 +51,9 @@ do_install_ptest() {
        tar -cf - bin/ --exclude \*.in | ( cd ${D}${PTEST_PATH} && tar -xf - )
        tar -cf - compat/ --exclude \*.in | ( cd ${D}${PTEST_PATH} && tar -xf - )
        tar -cf - quilt/ --exclude \*.in | ( cd ${D}${PTEST_PATH} && tar -xf - )
-       tar -cf - test/ --exclude mail.test --exclude delete.test | ( cd ${D}${PTEST_PATH} && tar -xf - )
+       tar -cf - test/ --exclude mail.test --exclude delete.test | ( cd ${D}${PTEST_PATH} && tar -xf - && chmod 777 test)
        cp ${WORKDIR}/Makefile ${D}${PTEST_PATH}
+       cp ${WORKDIR}/test.sh ${D}${PTEST_PATH}
 }
 
 RDEPENDS_${PN}-ptest = "make file sed gawk diffutils findutils ed perl \
index 958a9df5b61eea6f2e277f6e7ef7519d5e184986..4b808aee4fa1589f69afb0ae97bfc6fc7062f2b1 100755 (executable)
@@ -1,5 +1,8 @@
 #!/bin/sh
 
+THIS_SH=/bin/sh
 ln -sf /bin/ed /usr/bin/ed
-for i in `ls test/*.test |awk -F. '{print $1}' |awk -F/ '{print $2}'`; do make check-$i; if [ $? -eq 0 ]; then echo PASS: $i.test; else echo FAIL: $i.test; fi; done
+/usr/sbin/adduser --disabled-password quilttest
+su -c "${THIS_SH} ./test.sh" quilttest
+/usr/sbin/deluser quilttest
 rm -f /usr/bin/ed
diff --git a/meta/recipes-devtools/quilt/quilt/test.sh b/meta/recipes-devtools/quilt/quilt/test.sh
new file mode 100755 (executable)
index 0000000..6563e4a
--- /dev/null
@@ -0,0 +1 @@
+for i in `ls test/*.test |awk -F. '{print $1}' |awk -F/ '{print $2}'`; do make check-$i; if [ $? -eq 0 ]; then echo PASS: $i.test; else echo FAIL: $i.test; fi; done