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 if [ -r /etc/SuSE-release ]; then
79 name=$(awk '/SUSE/ { printf("%s %s %s %s", $1, $2, $3, $4) }' \
81 version=$(sed -n -e 's/^VERSION = //p' /etc/SuSE-release)
82 level=$(sed -n -e 's/^PATCHLEVEL = //p' /etc/SuSE-release)
83 dist="${name} ${version}.${level}"
84 elif [ -r /etc/os-release ]; then
85 name=$(sed -n -e 's/"//g' -e 's/^NAME=//p' /etc/os-release)
86 version=$(sed -n -e 's/"//g' -e 's/^VERSION_ID=//p' \
88 dist="${name} ${version}"
89 elif [ -r /etc/system-release ]; then
90 dist=$(awk '/release/ \
91 { printf("%s %s %s", $1, $2, $3) }' \
93 elif [ -r /etc/*-release ]; then
94 dist=$(find /etc/ -maxdepth 1 -name '*release' 2> /dev/null | \
95 sed -e 's/\/etc\///' -e 's/-release//' | head -n1)
104 local TEST_DISTRO=$(release)
105 local LUSTRE_VERSION=$(lustre_build_version)
106 local LUSTRE_BUILD=${LUSTRE_BUILD_SOURCE:-$LUSTRE_VERSION}
107 local FILE_SYSTEM=$(node_fstypes $(hostname -s))
110 lbats_build_id: $LBATS_ID
111 lbats_build_name: $LBATS_NAME
112 architecture: $(uname -m)
114 os_distribution: $TEST_DISTRO
115 lustre_version: $LUSTRE_VERSION
116 lustre_build: $LUSTRE_BUILD
117 lustre_branch: $LUSTRE_BRANCH
118 lustre_revision: $LUSTRE_REVISION
119 kernel_version: $(uname -r)
120 file_system: ${FILE_SYSTEM:-"NA"}
126 mem=$(awk '/MemTotal:/ {print $2 " " $3}' /proc/meminfo)
128 node_name: $(hostname -s)
130 architecture: $(uname -m)
133 for nw in $(lctl list_nids | grep -v @lo | cut -f 2 -d '@' | uniq); do
151 if ! combined_mgs_mds; then
152 host=$(short_hostname $(facet_active_host mgs))
153 f_host=$(short_hostname $(facet_passive_host mgs))
155 yml_entity "MGS" $host >> $logdir/node.$host.yml
157 yml_entity "MGS" $f_host >> $logdir/node.$f_host.yml
160 for i in $(seq $MDSCOUNT); do
161 host=$(short_hostname $(facet_active_host mds$i))
162 f_host=$(short_hostname $(facet_passive_host mds$i))
164 yml_entity "MDS $i" $host >> $logdir/node.$host.yml
166 yml_entity "MDS $i" $f_host >> $logdir/node.$f_host.yml
169 for i in $(seq $OSTCOUNT); do
170 host=$(short_hostname $(facet_active_host ost$i))
171 f_host=$(short_hostname $(facet_passive_host ost$i))
173 yml_entity "OST $i" $host >> $logdir/node.$host.yml
175 yml_entity "OST $i" $f_host >> $logdir/node.$f_host.yml
179 for host in ${CLIENTS//,/ }; do
180 host=$(short_hostname $host)
181 yml_entity "Client $i" $host >> $logdir/node.$host.yml
187 if [ $1 != "FINISHED" ]; then
191 description: $TESTSUITE $1
199 yml_log_test_status() {
206 yml_log_sub_test_begin() {
213 yml_log_sub_test_end() {
223 printf ' error: "%q"\n' "$*"
227 yml_log_sub_test_log() {