X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fyaml.sh;h=7269cb8a109923240a7be1a57a9f3b267568dc71;hb=25374e3b35f5776a9fd6e5b4cac273f7000511e9;hp=4dbdfe74329ec7abd79c9fa8933684785bcab06a;hpb=e44a6b616764810093a3c6f3d15254793865ffb7;p=fs%2Flustre-release.git diff --git a/lustre/tests/yaml.sh b/lustre/tests/yaml.sh index 4dbdfe7..7269cb8 100644 --- a/lustre/tests/yaml.sh +++ b/lustre/tests/yaml.sh @@ -1,5 +1,5 @@ #!/bin/bash -# vim:expandtab:shiftwidth=4:softtabstop=4:tabstop=4: +# vim:shiftwidth=4:softtabstop=4:tabstop=4: # # Shell routines for logging results to a yaml file. @@ -17,10 +17,10 @@ yml_nodes_file() { export logdir=$1 if [ -f $logdir/shared ]; then - do_rpc_nodes $(comma_list $(nodes_list)) \ - "yml_node >> $logdir/node.\\\$(hostname).yml" + do_rpc_nodes $(comma_list $(all_nodes)) \ + "yml_node >> $logdir/node.\\\$(hostname -s).yml" else - do_rpc_nodes $(comma_list $(nodes_list)) yml_node | split_output + do_rpc_nodes $(comma_list $(all_nodes)) yml_node | split_output fi yml_entities } @@ -31,13 +31,15 @@ yml_results_file() { #TestGroup yml_test_group + #CodeReview + yml_code_review + # Tests printf "Tests:\n" } # Called on the node for which we the info is needed. yml_node() { - local node=$(hostname) logdir=$1 printf "Build:\n" @@ -52,8 +54,8 @@ yml_node() { } yml_test_group() { - TEST_GROUP=${TEST_GROUP:-"acc-sm-$(hostname)"} - TEST_HOST=${TEST_HOST:-$(hostname)} + TEST_GROUP=${TEST_GROUP:-"acc-sm-$(hostname -s)"} + TEST_HOST=${TEST_HOST:-$(hostname -s)} TEST_USER=${TEST_USER:-$USER} # TestGroup information @@ -63,29 +65,34 @@ TestGroup: testhost: $TEST_HOST submission: $(date) user_name: $TEST_USER - EOF } -release() { - if [ -r /etc/lsb-release ]; then - dist=$(grep 'DISTRIB_ID' /etc/lsb-release | sed 's/DISTRIB_ID=//' | head -1) - elif [ -r /etc/redhat-release ]; then - dist=$(awk '/release/ { printf("%s %s %s", $1, $2, $3)}' /etc/redhat-release) - elif [ -r /etc/*-release ]; then - dist=$(find /etc/ -maxdepth 1 -name '*release' 2> /dev/null | \ - sed -e 's/\/etc\///' -e 's/-release//' | head -1) - else - dist="UNKNOWN" - fi +yml_code_review() { + echo -e $CODE_REVIEW_YAML +} - echo $dist +release() { + if [ -r /etc/lsb-release ]; then + dist=$(sed -ne '/^DISTRIB_ID/s/DISTRIB_ID=//p' /etc/lsb-release) + elif [ -r /etc/redhat-release ]; then + dist=$(awk '/release/ { printf("%s %s %s", $1, $2, $3) }' \ + /etc/redhat-release) + elif [ -r /etc/*-release ]; then + dist=$(find /etc/ -maxdepth 1 -name '*release' 2> /dev/null | + sed -e 's/\/etc\///' -e 's/-release//' | head -n1) + else + dist="UNKNOWN" + fi + + echo $dist } yml_build_info() { - TEST_DISTRO=$(release) - LUSTRE_VERSION=$(lctl lustre_build_version | awk '/Lustre version:/ {print $3}') - LUSTRE_BUILD=$(sed 's/-.*//' <<<$LUSTRE_VERSION) + local TEST_DISTRO=$(release) + local LUSTRE_VERSION=$(lctl lustre_build_version | awk '/Lustre version:/ {print $3}') + local LUSTRE_BUILD=${LUSTRE_BUILD_SOURCE:-$(sed 's/-.*//' <<<$LUSTRE_VERSION)} + local FILE_SYSTEM=$(node_fstypes $(hostname -s)) cat <> $logdir/node.$host.yml - done - - for num in $(seq $OSTCOUNT); do - host=$(facet_active_host ost$num) - yml_entity "OST $num" $host >> $logdir/node.$host.yml - done - - i=1 - for host in ${CLIENTS//,/ }; do - yml_entity "Client $i" $host >> $logdir/node.$host.yml - i=$((i+1)) - done + local host + local f_host + local i + + if ! combined_mgs_mds; then + host=$(short_hostname $(facet_active_host mgs)) + f_host=$(short_hostname $(facet_passive_host mgs)) + + yml_entity "MGS" $host >> $logdir/node.$host.yml + [[ -n $f_host ]] && + yml_entity "MGS" $f_host >> $logdir/node.$f_host.yml + fi + + for i in $(seq $MDSCOUNT); do + host=$(short_hostname $(facet_active_host mds$i)) + f_host=$(short_hostname $(facet_passive_host mds$i)) + + yml_entity "MDS $i" $host >> $logdir/node.$host.yml + [[ -n $f_host ]] && + yml_entity "MDS $i" $f_host >> $logdir/node.$f_host.yml + done + + for i in $(seq $OSTCOUNT); do + host=$(short_hostname $(facet_active_host ost$i)) + f_host=$(short_hostname $(facet_passive_host ost$i)) + + yml_entity "OST $i" $host >> $logdir/node.$host.yml + [[ -n $f_host ]] && + yml_entity "OST $i" $f_host >> $logdir/node.$f_host.yml + done + + i=1 + for host in ${CLIENTS//,/ }; do + host=$(short_hostname $host) + yml_entity "Client $i" $host >> $logdir/node.$host.yml + i=$((i+1)) + done } yml_log_test() { @@ -147,6 +178,7 @@ yml_log_test() { name: $1 description: $TESTSUITE $1 submission: $(date) + report_version: 2 SubTests: EOF fi @@ -154,8 +186,8 @@ EOF yml_log_test_status() { cat <