2 # vim:shiftwidth=4:softtabstop=4:tabstop=4:
5 # Shell routines for logging results to a yaml file.
11 echo "$line" | sed "s/^${host}: //" | sed "s/^${host}://" \
12 >> $logdir/node.$host.yml;
19 if [ -f $logdir/shared ]; then
20 do_rpc_nodes $(comma_list $(all_nodes)) \
21 "yml_node >> $logdir/node.\\\$(hostname -s).yml"
23 do_rpc_nodes $(comma_list $(all_nodes)) yml_node | split_output
41 # Called on the node for which we the info is needed.
53 printf "LustreEntities:\n"
57 TEST_GROUP=${TEST_GROUP:-"acc-sm-$(hostname -s)"}
58 TEST_HOST=${TEST_HOST:-$(hostname -s)}
59 TEST_USER=${TEST_USER:-$USER}
60 TEST_PROJECT=${TEST_PROJECT:-"LUSTRE"}
62 # TestGroup information
65 test_group: $TEST_GROUP
69 project: $TEST_PROJECT
74 echo -e $CODE_REVIEW_YAML
78 rhel_pat=".*release \([[:digit:]]\+\.[[:digit:]]\+\).*"
80 if [ -r /etc/centos-release ]; then
81 name=$(sed -n -e "s/^\([A-Za-z]\+\).*/\1/p" /etc/centos-release)
82 version=$(sed -n -e "s/${rhel_pat}/\1/p" /etc/centos-release)
83 dist="${name} ${version}"
84 elif [ -r /etc/redhat-release ]; then
85 version=$(sed -n -e "s/${rhel_pat}/\1/p" /etc/redhat-release)
86 dist="RHEL ${version}"
87 elif [ -r /etc/os-release ]; then
88 name=$(sed -n -e 's/"//g' -e 's/ [A-Za-z]*$//' \
89 -e 's/^NAME=//p' /etc/os-release)
90 version=$(sed -n -e 's/"//g' -e 's/^VERSION_ID=//p' \
92 dist="${name} ${version}"
101 local TEST_DISTRO=$(release)
102 local LUSTRE_VERSION=$(lustre_build_version)
103 local LUSTRE_BUILD=${LUSTRE_BUILD_SOURCE:-$LUSTRE_VERSION}
104 local FILE_SYSTEM=$(node_fstypes $(hostname -s))
107 lbats_build_id: $LBATS_ID
108 lbats_build_name: $LBATS_NAME
109 architecture: $(uname -m)
111 os_distribution: $TEST_DISTRO
112 version: $LUSTRE_VERSION
114 branch: $LUSTRE_BRANCH
115 revision: $LUSTRE_REVISION
116 kernel_version: $(uname -r)
117 file_system: ${FILE_SYSTEM:-"NA"}
123 mem=$(awk '/MemTotal:/ {print $2 " " $3}' /proc/meminfo)
125 node_name: $(hostname -s)
127 architecture: $(uname -m)
130 for nw in $(lctl list_nids | grep -v @lo | cut -f 2 -d '@' | uniq); do
148 if ! combined_mgs_mds; then
149 host=$(short_hostname $(facet_active_host mgs))
150 f_host=$(short_hostname $(facet_passive_host mgs))
152 yml_entity "MGS" $host >> $logdir/node.$host.yml
154 yml_entity "MGS" $f_host >> $logdir/node.$f_host.yml
157 for i in $(seq $MDSCOUNT); do
158 host=$(short_hostname $(facet_active_host mds$i))
159 f_host=$(short_hostname $(facet_passive_host mds$i))
161 yml_entity "MDS $i" $host >> $logdir/node.$host.yml
163 yml_entity "MDS $i" $f_host >> $logdir/node.$f_host.yml
166 for i in $(seq $OSTCOUNT); do
167 host=$(short_hostname $(facet_active_host ost$i))
168 f_host=$(short_hostname $(facet_passive_host ost$i))
170 yml_entity "OST $i" $host >> $logdir/node.$host.yml
172 yml_entity "OST $i" $f_host >> $logdir/node.$f_host.yml
176 for host in ${CLIENTS//,/ }; do
177 host=$(short_hostname $host)
178 yml_entity "Client $i" $host >> $logdir/node.$host.yml
184 if [ $1 != "FINISHED" ]; then
188 description: $TESTSUITE $1
196 yml_log_test_status() {
203 yml_log_sub_test_begin() {
210 yml_log_sub_test_end() {
220 printf ' error: "%q"\n' "$*"
224 yml_log_sub_test_log() {