Skip to contentSkip to conversation

quilt: run ptest as normal user

PATCH In review Dengke Du 1 participant 3 messages Mar 25, 2016

lore
Share & tools
lore

Dengke Du

author
#0 lore raw

cover quilt: run ptest as normal user

The following changes since commit b58e5b1fb3bcacbcfce17a748bca5f60c3528b4f:

bitbake: bitbake: xmlrpc: set single use mode differently (2016-03-24 12:31:50 +0000)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib dengke/quilt-ptest-fail-fixed
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=dengke/quilt-ptest-fail-fixed

Dengke Du (1):
quilt: run ptest as normal user

 meta/recipes-devtools/quilt/quilt.inc       | 4 +++-
 meta/recipes-devtools/quilt/quilt/run-ptest | 5 ++++-
 meta/recipes-devtools/quilt/quilt/test.sh   | 1 +
 3 files changed, 8 insertions(+), 2 deletions(-)
 create mode 100755 meta/recipes-devtools/quilt/quilt/test.sh
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/1 quilt: run ptest as normal user

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.

---
 meta/recipes-devtools/quilt/quilt.inc       | 4 +++-
 meta/recipes-devtools/quilt/quilt/run-ptest | 5 ++++-
 meta/recipes-devtools/quilt/quilt/test.sh   | 1 +
 3 files changed, 8 insertions(+), 2 deletions(-)
 create mode 100755 meta/recipes-devtools/quilt/quilt/test.sh
meta/recipes-devtools/quilt/quilt.inc +3 -1
index 837b36b..4e393c4 100644
@@ -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 \
meta/recipes-devtools/quilt/quilt/run-ptest +4 -1
index 958a9df..4b808ae 100755
@@ -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
meta/recipes-devtools/quilt/quilt/test.sh new file +1 -0
new file mode 100755
index 0000000..6563e4a
@@ -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
Signature · 1 line
1.9.1
#2 lore raw

Hi Ross, Tudor Florea

I have added a normal user "quilttest" to run the quilt ptest. When the ptest finish, delete the "quilttest" user.

//dengke

Quoted 64 lines · Dengke Du

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.

---
  meta/recipes-devtools/quilt/quilt.inc       | 4 +++-
  meta/recipes-devtools/quilt/quilt/run-ptest | 5 ++++-
  meta/recipes-devtools/quilt/quilt/test.sh   | 1 +
  3 files changed, 8 insertions(+), 2 deletions(-)

create mode 100755 meta/recipes-devtools/quilt/quilt/test.sh

meta/recipes-devtools/quilt/quilt.inc +3 -1
index 837b36b..4e393c4 100644
@@ -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 \
meta/recipes-devtools/quilt/quilt/run-ptest +4 -1
index 958a9df..4b808ae 100755
@@ -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
meta/recipes-devtools/quilt/quilt/test.sh new file +1 -0
new file mode 100755
index 0000000..6563e4a
@@ -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