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: 4868de2e67bd304e41ac2158ccfcb166cfe16242)

Signed-off-by: Aditya Tayade <Aditya.Tayade@kpit.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 f26680fad5
commit a9ec38c65e

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