Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "dengke.du@windriver.com" <dengke.du@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 1/1] quilt: run ptest as normal user
Date: Fri, 25 Mar 2016 16:40:26 +0800	[thread overview]
Message-ID: <56F4F97A.20407@windriver.com> (raw)
In-Reply-To: <fd0548b7b60220ca68bce43e6c27bfbf26a12c38.1458893281.git.dengke.du@windriver.com>

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

On 2016年03月25日 16:28, Dengke Du wrote:
> 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>
> ---
>   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
>
> diff --git a/meta/recipes-devtools/quilt/quilt.inc b/meta/recipes-devtools/quilt/quilt.inc
> index 837b36b..4e393c4 100644
> --- a/meta/recipes-devtools/quilt/quilt.inc
> +++ b/meta/recipes-devtools/quilt/quilt.inc
> @@ -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 \
> diff --git a/meta/recipes-devtools/quilt/quilt/run-ptest b/meta/recipes-devtools/quilt/quilt/run-ptest
> index 958a9df..4b808ae 100755
> --- a/meta/recipes-devtools/quilt/quilt/run-ptest
> +++ b/meta/recipes-devtools/quilt/quilt/run-ptest
> @@ -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
> index 0000000..6563e4a
> --- /dev/null
> +++ b/meta/recipes-devtools/quilt/quilt/test.sh
> @@ -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



      reply	other threads:[~2016-03-25  8:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-25  8:28 [PATCH 0/1] quilt: run ptest as normal user Dengke Du
2016-03-25  8:28 ` [PATCH 1/1] " Dengke Du
2016-03-25  8:40   ` dengke.du [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56F4F97A.20407@windriver.com \
    --to=dengke.du@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox