linux/tools/testing/selftests/damon/_common.sh
Enze Li 511914506d selftests/damon: introduce _common.sh to host shared function
The current test scripts contain duplicated root permission checks in
multiple locations.  This patch consolidates these checks into _common.sh
to eliminate code redundancy.

Link: https://lkml.kernel.org/r/20250718064217.299300-1-lienze@kylinos.cn
Signed-off-by: Enze Li <lienze@kylinos.cn>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-07-26 15:08:21 -07:00

11 lines
142 B
Bash

#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
check_dependencies()
{
if [ $EUID -ne 0 ]
then
echo "Run as root"
exit $ksft_skip
fi
}