xref: /linux/tools/testing/selftests/safesetid/safesetid-test.sh (revision 597473720f4dc69749542bfcfed4a927a43d935e)
1#!/bin/bash
2
3TCID="safesetid-test.sh"
4errcode=0
5
6# Kselftest framework requirement - SKIP code is 4.
7ksft_skip=4
8
9check_root()
10{
11	uid=$(id -u)
12	if [ $uid -ne 0 ]; then
13		echo $TCID: must be run as root >&2
14		exit $ksft_skip
15	fi
16}
17
18main_function()
19{
20  check_root
21  ./safesetid-test
22}
23
24main_function
25echo "$TCID: done"
26exit $errcode
27