xref: /linux/tools/testing/selftests/damon/_chk_dependency.sh (revision f3956ebb3bf06ab2266ad5ee2214aed46405810c)
1#!/bin/bash
2# SPDX-License-Identifier: GPL-2.0
3
4# Kselftest framework requirement - SKIP code is 4.
5ksft_skip=4
6
7DBGFS=/sys/kernel/debug/damon
8
9if [ $EUID -ne 0 ];
10then
11	echo "Run as root"
12	exit $ksft_skip
13fi
14
15if [ ! -d "$DBGFS" ]
16then
17	echo "$DBGFS not found"
18	exit $ksft_skip
19fi
20
21for f in attrs target_ids monitor_on
22do
23	if [ ! -f "$DBGFS/$f" ]
24	then
25		echo "$f not found"
26		exit 1
27	fi
28done
29