From b733213d023ebd27af728bb3471dcca91c1243da Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Mon, 28 Mar 2016 14:15:01 +1100 Subject: [PATCH] * lib/dmucs.exp: New. Signed-off-by: Ben Elliston --- ChangeLog | 4 ++++ lib/dmucs.exp | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 lib/dmucs.exp diff --git a/ChangeLog b/ChangeLog index 2eb5770..4611aae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2016-03-28 Rob Savoye + * lib/dmucs.exp: New. + +2016-03-28 Rob Savoye + * lib/libgloss.exp (find_g++): Look for xgcc++ to use the freshly built compiler, then look in the path. diff --git a/lib/dmucs.exp b/lib/dmucs.exp new file mode 100644 index 0000000..9c5fbfa --- /dev/null +++ b/lib/dmucs.exp @@ -0,0 +1,50 @@ +# Copyright (C) 2016 Free Software Foundation, Inc. + +# This file is part of DejaGnu. +# +# DejaGnu is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# DejaGnu is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with DejaGnu; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + +# This file requires a slightly modified dmucs, which has been +# modified to support mutiple architectures for toolchain +# testing. DMUCS sends the CPU load to a server, which we can query +# using the 'gethost' command to get the next available slave for a +# remote test based on which one is the least busy. The code for this +# enhanced DMUCS is at: http://git.linaro.org/git/toolchain/dmucs.git + +proc dmucs_gethost { server arch } { + # gethost in debug mode returns this output: + # --node and --arch are unique to the Linaro branch of DMUCS + # + # Writing -->host 127.0.1.1 <-- to the server + # Calling Sgets + # Got -->10.6.1.24<-- from the server + # tmp is -->DISTCC_HOSTS=10.6.1.24/100<-- + set slave "" + spawn gethost -s $server --node --arch $arch + expect { + # This is the IP number we want. + "^\[0-9\]*\.\[0-9\]*\.\[0-9\]*\.\[0-9\]*" { + set pos [expr {[string first "/" $expect_out(buffer)] - 1}] + set slave [string range $expect_out(buffer) 0 $pos] + } + timeout { + perror "DMUCS gethost command timed out" + } + eof { + perror "Failed to connect to DMUCS server" + } + } + return $slave +} -- 2.7.4