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}
61 # TestGroup information
64 test_group: $TEST_GROUP
72 echo -e $CODE_REVIEW_YAML
76 if [ -r /etc/SuSE-release ]; then
77 name=$(awk '/SUSE/ { printf("%s %s %s %s", $1, $2, $3, $4) }' \
79 version=$(sed -n -e 's/^VERSION = //p' /etc/SuSE-release)
80 level=$(sed -n -e 's/^PATCHLEVEL = //p' /etc/SuSE-release)
81 dist="${name} ${version}.${level}"
82 elif [ -r /etc/os-release ]; then
83 name=$(sed -n -e 's/"//g' -e 's/^NAME=//p' /etc/os-release)
84 version=$(sed -n -e 's/"//g' -e 's/^VERSION_ID=//p' \
86 dist="${name} ${version}"
87 elif [ -r /etc/system-release ]; then
88 dist=$(awk '/release/ \
89 { printf("%s %s %s", $1, $2, $3) }' \
91 elif [ -r /etc/*-release ]; then
92 dist=$(find /etc/ -maxdepth 1 -name '*release' 2> /dev/null | \
93 sed -e 's/\/etc\///' -e 's/-release//' | head -n1)
102 local TEST_DISTRO=$(release)
103 local LUSTRE_VERSION=$(lustre_build_version)
104 local LUSTRE_BUILD=${LUSTRE_BUILD_SOURCE:-$LUSTRE_VERSION}
105 local FILE_SYSTEM=$(node_fstypes $(hostname -s))
108 lbats_build_id: $LBATS_ID
109 lbats_build_name: $LBATS_NAME
110 architecture: $(uname -m)
112 os_distribution: $TEST_DISTRO
113 lustre_version: $LUSTRE_VERSION
114 lustre_build: $LUSTRE_BUILD
115 lustre_branch: $LUSTRE_BRANCH
116 lustre_revision: $LUSTRE_REVISION
117 kernel_version: $(uname -r)
118 file_system: ${FILE_SYSTEM:-"NA"}
124 mem=$(awk '/MemTotal:/ {print $2 " " $3}' /proc/meminfo)
126 node_name: $(hostname -s)
128 architecture: $(uname -m)
131 for nw in $(lctl list_nids | grep -v @lo | cut -f 2 -d '@' | uniq); do
149 if ! combined_mgs_mds; then
150 host=$(short_hostname $(facet_active_host mgs))
151 f_host=$(short_hostname $(facet_passive_host mgs))
153 yml_entity "MGS" $host >> $logdir/node.$host.yml
155 yml_entity "MGS" $f_host >> $logdir/node.$f_host.yml
158 for i in $(seq $MDSCOUNT); do
159 host=$(short_hostname $(facet_active_host mds$i))
160 f_host=$(short_hostname $(facet_passive_host mds$i))
162 yml_entity "MDS $i" $host >> $logdir/node.$host.yml
164 yml_entity "MDS $i" $f_host >> $logdir/node.$f_host.yml
167 for i in $(seq $OSTCOUNT); do
168 host=$(short_hostname $(facet_active_host ost$i))
169 f_host=$(short_hostname $(facet_passive_host ost$i))
171 yml_entity "OST $i" $host >> $logdir/node.$host.yml
173 yml_entity "OST $i" $f_host >> $logdir/node.$f_host.yml
177 for host in ${CLIENTS//,/ }; do
178 host=$(short_hostname $host)
179 yml_entity "Client $i" $host >> $logdir/node.$host.yml
185 if [ $1 != "FINISHED" ]; then
189 description: $TESTSUITE $1
197 yml_log_test_status() {
204 yml_log_sub_test_begin() {
211 yml_log_sub_test_end() {
221 printf ' error: "%q"\n' "$*"
225 yml_log_sub_test_log() {