run-ptest: use error handling for useradd and userdel

Error handling in shell scripts is too easy to forget and
get wrong. It is possible to check every external command
for return values but it is better to use a generic setting
which halts execution of the script on any failures.

Upstream-Status: Pending
(From OE-Core rev: ca415c4250e32e9430a13b9edf7b308637ce597f)

Signed-off-by: Aditya Tayade <Aditya.Tayade@kpit.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Aditya Tayade
2019-03-25 15:27:11 +00:00
committed by Richard Purdie
parent fe415144db
commit 6a6756f46a

View File

@@ -1,5 +1,6 @@
#! /bin/sh
set -eux
useradd glib2-test
su glib2-test -c gnome-desktop-testing-runner glib
userdel glib2-test