part of the host name for log files.
This means stripping of everything off the name after and including the first .
This change is only designed to make the .yml files consistent. The log files
will append the fully qualified name and appear to do this consitantly.
We can create a jira to make the log and yml files consistant, but the reality
is that the yml files have a short life and are only used to send to Maloo.
This change will allow automated posting of results and automated testing to
begin.
1. Carries out the above using hostname -s [Thanks Andreas]
2. Adds in a quick change so that LUSTRE_BUILD in yaml.sh can be a reference to
the source rather than just the lustre version string which is recorded and
written to the yaml anyway as LUSTER_VERSION
Additionally a couple of other changes sneaked in.
1. Allows the review information to be applied to the yaml output file
by way of exporting the variable CODE_REVIEW_YAML to be a yaml description
for maloo
2. The addition of a couple of fixes to make the permissions for yaml
files be allow-all. This permissions are bracketed and so do not change any
other parts of the code.
Change-Id: Ied9a2117cd1b68e048bbc2bf1bffe782485c6150
Signed-off-by: Chris Gearing <chris@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/312
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Yu Jian <yujian@whamcloud.com>
fi
echo "run_suite $suite_name $suite_script"
fi
echo "run_suite $suite_name $suite_script"
- local log_name=${suite_name}.suite_log.$(hostname).log
+ local log_name=${suite_name}.suite_log.$(hostname -s).log
if $verbose; then
run_suite $suite_name $suite_script 2>&1 |tee $LOGDIR/$log_name
else
if $verbose; then
run_suite $suite_name $suite_script 2>&1 |tee $LOGDIR/$log_name
else
do_rpc_nodes $list lst_setup
}
do_rpc_nodes $list lst_setup
}
+###
+# short_hostname
+#
+# Passed a single argument, strips everything off following and includes the first period.
+# client-20.lab.whamcloud.com becomes client-20
+short_hostname() {
+ echo $(sed 's/\..*//' <<< $1)
+}
+
run_one_logged() {
local BEFORE=`date +%s`
local TEST_ERROR
run_one_logged() {
local BEFORE=`date +%s`
local TEST_ERROR
- local name=${TESTSUITE}.test_${1}.test_log.$(hostname).log
+ local name=${TESTSUITE}.test_${1}.test_log.$(hostname -s).log
local test_log=$LOGDIR/$name
rm -rf $LOGDIR/err
local test_log=$LOGDIR/$name
rm -rf $LOGDIR/err
+ local SAVE_UMASK=`umask`
+ umask 0022
echo
log_sub_test_begin test_${1}
echo
log_sub_test_begin test_${1}
$FAIL_ON_ERROR && exit $RC
fi
$FAIL_ON_ERROR && exit $RC
fi
if [ "$CLIENTONLY" -o "$PDSH" == "no_dsh" ]; then
echo "Dumping logs only on local client."
if [ "$CLIENTONLY" -o "$PDSH" == "no_dsh" ]; then
echo "Dumping logs only on local client."
- $LCTL dk > ${prefix}.debug_log.$(hostname).${suffix}
- dmesg > ${prefix}.dmesg.$(hostname).${suffix}
+ $LCTL dk > ${prefix}.debug_log.$(hostname -s).${suffix}
+ dmesg > ${prefix}.dmesg.$(hostname -s).${suffix}
return
fi
do_nodesv $list \
return
fi
do_nodesv $list \
- "$LCTL dk > ${prefix}.debug_log.\\\$(hostname).${suffix};
- dmesg > ${prefix}.dmesg.\\\$(hostname).${suffix}"
+ "$LCTL dk > ${prefix}.debug_log.\\\$(hostname -s).${suffix};
+ dmesg > ${prefix}.dmesg.\\\$(hostname -s).${suffix}"
if [ ! -f $LOGDIR/shared ]; then
do_nodes $list rsync -az "${prefix}.*.${suffix}" $HOSTNAME:$LOGDIR
fi
if [ ! -f $LOGDIR/shared ]; then
do_nodes $list rsync -az "${prefix}.*.${suffix}" $HOSTNAME:$LOGDIR
fi
# Not found. Create local logdir
mkdir -p $dir
else
# Not found. Create local logdir
mkdir -p $dir
else
- touch $dir/node.$(hostname).yml
+ touch $dir/node.$(hostname -s).yml
check_write_access() {
local dir=$1
for node in $(nodes_list); do
check_write_access() {
local dir=$1
for node in $(nodes_list); do
- if [ ! -f "$dir/node.${node}.yml" ]; then
+ if [ ! -f "$dir/node.$(short_hostname ${node}).yml" ]; then
# Logdir not accessible/writable from this node.
return 1
fi
# Logdir not accessible/writable from this node.
return 1
fi
if [[ -n $YAML_LOG ]]; then
return
fi
if [[ -n $YAML_LOG ]]; then
return
fi
+ local SAVE_UMASK=`umask`
+ umask 0000
+
export YAML_LOG=${LOGDIR}/results.yml
mkdir -p $LOGDIR
init_clients_lists
export YAML_LOG=${LOGDIR}/results.yml
mkdir -p $LOGDIR
init_clients_lists
yml_nodes_file $LOGDIR >> $YAML_LOG
yml_results_file >> $YAML_LOG
yml_nodes_file $LOGDIR >> $YAML_LOG
yml_results_file >> $YAML_LOG
min_ost_size () {
$LCTL get_param -n osc.*.kbytesavail | sort -n | head -n1
}
min_ost_size () {
$LCTL get_param -n osc.*.kbytesavail | sort -n | head -n1
}
if [ -f $logdir/shared ]; then
do_rpc_nodes $(comma_list $(nodes_list)) \
if [ -f $logdir/shared ]; then
do_rpc_nodes $(comma_list $(nodes_list)) \
- "yml_node >> $logdir/node.\\\$(hostname).yml"
+ "yml_node >> $logdir/node.\\\$(hostname -s).yml"
else
do_rpc_nodes $(comma_list $(nodes_list)) yml_node | split_output
fi
else
do_rpc_nodes $(comma_list $(nodes_list)) yml_node | split_output
fi
#TestGroup
yml_test_group
#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() {
# Tests
printf "Tests:\n"
}
# Called on the node for which we the info is needed.
yml_node() {
logdir=$1
printf "Build:\n"
logdir=$1
printf "Build:\n"
- 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
TEST_USER=${TEST_USER:-$USER}
# TestGroup information
testhost: $TEST_HOST
submission: $(date)
user_name: $TEST_USER
testhost: $TEST_HOST
submission: $(date)
user_name: $TEST_USER
+yml_code_review() {
+ echo -e $CODE_REVIEW_YAML
+}
+
release() {
if [ -r /etc/lsb-release ]; then
dist=$(grep 'DISTRIB_ID' /etc/lsb-release | sed 's/DISTRIB_ID=//' | head -1)
release() {
if [ -r /etc/lsb-release ]; then
dist=$(grep 'DISTRIB_ID' /etc/lsb-release | sed 's/DISTRIB_ID=//' | head -1)
yml_build_info() {
TEST_DISTRO=$(release)
LUSTRE_VERSION=$(lctl lustre_build_version | awk '/Lustre version:/ {print $3}')
yml_build_info() {
TEST_DISTRO=$(release)
LUSTRE_VERSION=$(lctl lustre_build_version | awk '/Lustre version:/ {print $3}')
- LUSTRE_BUILD=$(sed 's/-.*//' <<<$LUSTRE_VERSION)
+ LUSTRE_BUILD=${LUSTRE_BUILD_SOURCE:-$(sed 's/-.*//' <<<$LUSTRE_VERSION)}
cat <<EOF
lbats_build_id: $LBATS_ID
cat <<EOF
lbats_build_id: $LBATS_ID
{
mem=$(awk '/MemTotal:/ {print $2 " " $3}' /proc/meminfo)
cat <<EOF
{
mem=$(awk '/MemTotal:/ {print $2 " " $3}' /proc/meminfo)
cat <<EOF
+ node_name: $(hostname -s)
mem_size: $mem
architecture: $(uname -m)
networks:
mem_size: $mem
architecture: $(uname -m)
networks:
yml_entities() {
local host
for num in $(seq $MDSCOUNT); do
yml_entities() {
local host
for num in $(seq $MDSCOUNT); do
- host=$(facet_active_host mds$num)
+ host=$(short_hostname $(facet_active_host mds$num))
yml_entity "MDS $num" $host >> $logdir/node.$host.yml
done
for num in $(seq $OSTCOUNT); do
yml_entity "MDS $num" $host >> $logdir/node.$host.yml
done
for num in $(seq $OSTCOUNT); do
- host=$(facet_active_host ost$num)
+ host=$(short_hostname $(facet_active_host ost$num))
yml_entity "OST $num" $host >> $logdir/node.$host.yml
done
i=1
for host in ${CLIENTS//,/ }; do
yml_entity "OST $num" $host >> $logdir/node.$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_entity "Client $i" $host >> $logdir/node.$host.yml
i=$((i+1))
done