提交 a33b13a9 编写于 作者: L Lucas Meneghel Rodrigues

utils_test: Introduce verify_running_as_root()

Some tests do require admin privileges, so, when running
as a regular user and reaching one of those tests, it is
good to just skip the test instead of trying to execute
it.

Therefore, introduce a utility function to verify whether
we're running as root (actually, uid=0), and if not,
throw an exception. Also add a postprocess param, that
will throw an error if the param 'requires_root' is set.

This will also make possible to tell in the test runner
list whether a test requires root or not, making one
more useful information clear to the users.
Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
上级 08cc8a27
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册