File: run.sh

package info (click to toggle)
damo 3.1.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 27,544 kB
  • sloc: python: 14,931; sh: 986; makefile: 30; ansic: 13
file content (35 lines) | stat: -rwxr-xr-x 747 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0

bindir=$(dirname "$0")
cd "$bindir" || exit 1

restart_damon_stat="false"
damon_stat_enabled_file="/sys/module/damon_stat/parameters/enabled"
if [ -f "$damon_stat_enabled_file" ] && \
	[ $(cat "$damon_stat_enabled_file") = "Y" ]
then
	echo "DAMON_STAT is running.  Disable for testing."
	echo N > "$damon_stat_enabled_file"
	restart_damon_stat="true"
fi

for test_dir in unit pre-commit record report schemes \
	damon_reclaim damon_lru_sort start_stop
do
	if ! "./$test_dir/test.sh"
	then
		if [ "$restart_damon_stat" = "true" ]
		then
			echo Y > "$damon_stat_enabled_file"
		fi
		exit 1
	fi
done

if [ "$restart_damon_stat" = "true" ]
then
	echo Y > "$damon_stat_enabled_file"
fi

echo "PASS ALL"