-
Notifications
You must be signed in to change notification settings - Fork 1
/
general_setup
executable file
·164 lines (154 loc) · 3.6 KB
/
general_setup
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#
# This file is contains code that is common among the test wrappers.
#
#
# Source .bashrc to keep pbench happy.
#
source ~/.bashrc
# Values setting for test wrappers to use.
#
# TOOLS_BIN: points to the tool directory
# to_home_root: home directory
# to_configuration: configuration information
# to_times_to_run: number of times to run the test
# to_pbench: Run the test via pbench
# to_pbench_copy: Copy the pbench data, not move it.
# to_puser: User running pbench
# to_pstats: pbench stats to use
# to_run_label: Label for the run
# to_user: User on the test system running the test
# to_sys_type: for results info, basically aws, azure or local
# to_sysname: name of the system
# to_tuned_setting: tuned setting
#
# Present usage information.
#
gs_usage_info()
{
echo "General options"
echo " --home_parent <value>: Our parent home directory. If not set, defaults to current working directory."
echo " --host_config <value>: default is the current host name"
echo " --iterations <value>: Number of times to run the test, defaults to 1."
echo " --pbench: use pbench-user-benchmark and place information into pbench, defaults to do not use"
echo " --pbench_user <value>: user who started everything. Defaults to the current user."
echo " --pbench_copy: Copy the pbench data, not move it."
echo " --pbench_stats: What stats to gather."
echo " --run_label: the label to associate with the pbench run"
echo " --run_user: user that is actually running the test on the test system."
echo " --sys_type: Type of system working with, aws, azure, hostname. Defaults to hostname"
echo " --sysname: name of the system running, used in determing config files. Defaults to hostname"
echo " --tuned_setting: used in naming the tar file, default for RHEL is the current active tuned. For non"
echo " RHEL systems, default is none"
echo " --usage: this usage message"
exit
}
to_sys_type=`hostname`
to_configuration=`hostname`
to_home_root=`pwd`
TOOLS_BIN=`pwd`/test_tools
to_pbench=0
to_pbench_copy="0"
to_puser=`whoami`
to_run_user=`whoami`
to_times_to_run=1
to_run_label=""
to_user=`whoami`
to_sysname=`hostname`
to_pstats="default"
if [ -f /usr/sbin/tuned-adm ]; then
tval=`/usr/sbin/tuned-adm active|awk '{print $4}'`
if [[ $tval == "profile." ]]; then
tval=tuned_none
fi
else
tval="tuned_none"
fi
to_tuned_setting=$tval
i=1
j=$#
gen_args_back=$0
while [ $i -le $j ]
do
#
# Ansible causing problems again, getting passed }} for some reason from random workloads, filter it out.
#
value=`echo $2 | sed "s/}//g"`
case "$1" in
--sys_type)
i=$((i + 2))
to_sys_type=$value
shift 2
;;
--home_parent)
i=$((i + 2))
to_home_root=$value
shift 2
;;
--host_config)
i=$((i + 2))
to_configuration=$value
shift 2
;;
--iterations)
i=$((i + 2))
to_times_to_run=$value
shift 2
;;
--pbench)
to_pbench=1
i=$((i + 1))
shift 1
;;
--pbench_copy)
to_pbench_copy=1
i=$((i + 1))
shift 1
;;
--pbench_stats)
i=$((i + 2))
to_pstats=$2
shift 2
;;
--pbench_user)
i=$((i + 2))
to_puser=$2
shift 2
;;
--run_label)
i=$((i + 2))
to_run_label=$2
shift 2
;;
--run_user)
i=$((i + 2))
to_user=$value
shift 2
;;
--sysname)
i=$((i + 2))
to_sysname=$value
shift 2
;;
--tuned_setting)
i=$((i + 2))
to_tuned_setting="${value}"
shift 2
;;
--usage)
gs_usage_info
;;
--)
break;
;;
*)
#
# Option not recognized, must be specific to the wrapper.
#
remove_it=`echo ${1} | sed "s/}//g"`
gen_args_back=${gen_args_back}" "${remove_it}
i=$((i + 1))
shift 1
;;
esac
done
set $gen_args_back