summaryrefslogtreecommitdiff
path: root/qa/admin
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2014-10-26 12:33:50 +0400
committerIgor Pashev <pashev.igor@gmail.com>2014-10-26 12:33:50 +0400
commit47e6e7c84f008a53061e661f31ae96629bc694ef (patch)
tree648a07f3b5b9d67ce19b0fd72e8caa1175c98f1a /qa/admin
downloadpcp-debian.tar.gz
Debian 3.9.10debian/3.9.10debian
Diffstat (limited to 'qa/admin')
-rw-r--r--qa/admin/README6
-rwxr-xr-xqa/admin/check-vm361
-rwxr-xr-xqa/admin/myconfigure27
-rwxr-xr-xqa/admin/pcp-daily838
-rwxr-xr-xqa/admin/pcp-qa-summary320
-rwxr-xr-xqa/admin/show-me-all59
6 files changed, 1611 insertions, 0 deletions
diff --git a/qa/admin/README b/qa/admin/README
new file mode 100644
index 0000000..9a58bc6
--- /dev/null
+++ b/qa/admin/README
@@ -0,0 +1,6 @@
+Scripts for running lots of QA in Ken's sandpit
+
+Build does not go here.
+
+Scripts are getting sufficiently complicated that some form of
+version control is needed.
diff --git a/qa/admin/check-vm b/qa/admin/check-vm
new file mode 100755
index 0000000..4e0a5c4
--- /dev/null
+++ b/qa/admin/check-vm
@@ -0,0 +1,361 @@
+#!/bin/sh
+#
+# Check what's installed on a PCP/PCPQA VM looking for missing apps
+# and packages
+#
+
+_usage()
+{
+ echo "Usage: $0 [-v]"
+ exit 1
+}
+
+verbose=false
+while getopts 'v?' p
+do
+ case "$p"
+ in
+ v) verbose=true
+ ;;
+
+ ?) _usage
+ # NOTREACHED
+ esac
+done
+shift `expr $OPTIND - 1`
+[ $# -eq 0 ] || _usage
+
+tmp=/var/tmp/$$
+trap "rm -f $tmp.*; exit 0" 0 1 2 3 15
+
+# add additional and optional directories
+for dir in /sbin /usr/sbin
+do
+ if [ -d "$dir" ]
+ then
+ if echo ":$PATH:" | grep -q ":$dir:"
+ then
+ :
+ else
+ export PATH="$PATH:$dir"
+ #debug# echo add $dir to \$PATH
+ fi
+ fi
+done
+
+# perl ? apt-get install -qqy --force-yes libxml-tokeparser-perl
+# perl ? apt-get install -qqy --force-yes libspreadsheet-read-perl
+cat <<End-of-File >$tmp.control
+# one line per app, alternate items separated by white space
+# first item ending in ? means this item is a guard, if it does not
+# exist silently ignore the rest of the line
+# tests items can be
+# starting with a / test for existence of file or directory
+# (alternates separated by |)
+# containing :: test for presence of the associated Perl module
+# otherwise test for an executable with which(1)
+# (alternates separated by |)
+#
+# text after # is treated as a comment
+# text after [ is treated as annotation
+#
+# executables
+ed
+git
+make
+gcc
+autoconf
+flex
+bison
+gdb
+mktemp
+gawk
+# optional executables
+dpkg? dpkg-buildpackage [dpkg-dev]
+dpkg? dh [debhelper]
+dpkg? chrpath [chrpath]
+dpkg? sysv-rc-conf [sysv-rc-conf]
+rpm? rpmbuild [rpm-build]
+# other build prerequisites
+dpkg? /usr/share/doc/pkg-config [pkg-config]
+dpkg? /usr/share/doc/python-all-dev [python-all-dev]
+dpkg? /usr/include/microhttpd.h [libmicrohttpd-dev]
+rpm? /usr/include/microhttpd.h [libmicrohttpd-devel]
+dpkg? /usr/include/sasl/sasl.h [libsasl2-dev]
+rpm? /usr/include/sasl/sasl.h [cyrus-sasl-devel]
+rpm? /usr/include/systemd/sd-daemon.h [systemd-devel but not for CentOS 5.8]
+dpkg? /usr/include/infiniband/umad.h [libibumad-dev]
+rpm? /usr/include/infiniband/umad.h [libibumad-devel]
+dpkg? /usr/include/infiniband/mad.h [libibmad-dev]
+rpm? /usr/include/infiniband/mad.h [libibmad-devel]
+dpkg? /usr/include/avahi-common [libavahi-common-dev]
+rpm? /usr/include/avahi-common [avahi-devel]
+dpkg? g++ [g++]
+rpm? g++ [gcc-c++]
+# files
+dpkg? /usr/include/readline/readline.h [libreadline-dev]
+rpm? /usr/include/readline/readline.h [readline-devel]
+rpm? /usr/include/ncurses.h [ncurses-devel] # is this a bug in the spec file?
+# perl modules
+Time::HiRes [Perl Time-HiRes perl-Time-HiRes(rpm)]
+Date::Format [Perl TimeDate perl-TimeDate(rpm)]
+Date::Parse [Perl TimeDate perl-TimeDate(rpm)]
+Getopt::Std [base Perl]
+dpkg? ExtUtils::MakeMaker [libextutils-autoinstall-perl]
+rpm? ExtUtils::MakeMaker [perl-ExtUtils-MakeMaker]
+dpkg? XML::TokeParser [libxml-tokeparser-perl]
+rpm? XML::TokeParser [perl-XML-TokeParser]
+Spreadsheet::Read [libspreadsheet-read-perl(dpkg)]
+dpkg? Spreadsheet::WriteExcel [libspreadsheet-writeexcel-perl]
+rpm? Spreadsheet::WriteExcel [perl-Spreadsheet-WriteExcel]
+Spreadsheet::ReadSXC [cpan?]
+# other run-time
+sadf [sysstat]
+# QA
+bc
+curl
+Spreadsheet::XLSX [libspreadsheet-xlsx-perl(dpkg)]
+dpkg? Text::CSV_XS [Text-CSV_XS]
+rpm? Text::CSV_XS [perl-Text-CSV_XS]
+crontab [from vixie-cron?]
+valgrind
+dpkg? mail [bsd-mailx]
+rpm? mail [mailx]
+host [bind-utils(redhat)]
+dpkg? apache2 [apache2]
+rpm? httpd [httpd]
+time [time(redhat)]
+dpkg? realpath [realpath]
+# pcp-gui
+dpkg? qmake [qt4-qmake]
+rpm? qmake|qmake-qt4 [qt-devel]
+dpkg? /usr/lib/libQtCore.so|/usr/lib/*/libQtCore.so [libqt4-dev]
+dpkg? /usr/lib/libSoQt4.so|/usr/lib/*/libSoQt4.so [libsoqt4-dev]
+rpm? /usr/lib/libQtCore.so|/usr/lib*/libQtCore.so [qt-devel]
+dpkg? /usr/include/Inventor/Qt/SoQt.h [libsoqt-dev-common]
+dpkg? /usr/include/Inventor/SoPath.h [libcoin60-dev or libcoin80-dev]
+# python
+rpm? /usr/include/python*/Python.h [python-devel]
+dpkg? /usr/include/python*/Python.h [python-dev]
+# nss
+dpkg? /usr/include/nspr/nspr.h [libnspr4-dev]
+rpm? /usr/include/nspr4/nspr.h [nspr-devel]
+dpkg? /usr/include/nss/nss.h [libnss3-dev]
+rpm? /usr/include/nss3/nss.h [nss-devel]
+dpkg? certutil [libnss3-tools]
+rpm? certutil [nss-tools]
+End-of-File
+
+if which python >/dev/null 2>&1
+then
+ # For python-ctypes, check for python before 2.5 ... expect something like
+ # Python 2.7.3
+ eval `python -V 2>&1 | sed -e 's/Python //' -e 's/^/maj=/' -e 's/\./ min=/' -e 's/\..*//'`
+ if [ -n "$maj" -a -n "$min" ]
+ then
+ rm -f $tmp.need
+ if [ "$maj" -lt 2 ]
+ then
+ touch $tmp.need
+ elif [ "$maj" -eq 2 -a "$min" -lt 5 ]
+ then
+ touch $tmp.need
+ fi
+ [ -f $tmp.need ] && \
+ echo "rpm? /usr/share/doc/packages/python-ctypes [python-ctypes]" >>$tmp.control
+ fi
+fi
+
+cat $tmp.control \
+| sed -e 's/#.*//' -e '/^[ ]*$/d' \
+| while read apps
+do
+ rm -f $tmp.ok
+ for app in $apps
+ do
+ case $app
+ in
+ \[*)
+ break
+ ;;
+ *\?)
+ app=`echo $app | sed -e 's/?$//'`
+ optional=true
+ ;;
+ *)
+ optional=false
+ ;;
+ esac
+ case $app
+ in
+ \[*)
+ break
+ ;;
+ /*)
+ rm -f $tmp.tmp
+ for file in `echo "$app" | sed -e 's/|/ /g'`
+ do
+ if [ -f "$file" -o -d "$file" ]
+ then
+ touch $tmp.tmp
+ break
+ fi
+ done
+ [ -f $tmp.tmp ]
+ ok=$?
+ ;;
+ *::*)
+ echo "use $app;" | perl >/dev/null 2>&1
+ ok=$?
+ ;;
+ *)
+ rm -f $tmp.tmp
+ for exec in `echo "$app" | sed -e 's/|/ /g'`
+ do
+ if which $exec >/dev/null 2>&1
+ then
+ touch $tmp.tmp
+ break
+ fi
+ done
+ [ -f $tmp.tmp ]
+ ok=$?
+ ;;
+ esac
+ if $verbose
+ then
+ echo -n " .. $app"
+ $optional && echo -n "[optional]"
+ if [ $ok = 0 ]
+ then
+ echo -n " yes"
+ else
+ echo -n " no"
+ fi
+ fi
+ if [ $ok = 0 ]
+ then
+ $optional && continue
+ touch $tmp.ok
+ break
+ else
+ if $optional
+ then
+ # guard not true, skip checks for other apps
+ touch $tmp.ok
+ break
+ fi
+ fi
+ done
+ $verbose && echo
+ if [ ! -f $tmp.ok ]
+ then
+ echo "Missing: `echo $apps \
+ | sed \
+ -e 's/[ ][ ]*/ /g' \
+ -e '/ /{
+s/? /?@/
+:loop1
+s/\(\[.*\) /\1@/
+t loop1
+:loop2
+s/ \([^[]\)/@|@\1/
+t loop2
+s/@/ /g
+}'`"
+ fi
+done
+
+# Some platform-specific and special case tests
+#
+if which dpkg >/dev/null 2>&1
+then
+ # Debian based
+ #
+ dpkg -l >$tmp.tmp
+ for pkg in python-all python-all-dev
+ do
+ if grep "^ii *$pkg" <$tmp.tmp >/dev/null
+ then
+ :
+ else
+ echo "Need # apt-get install $pkg"
+ fi
+ done
+fi
+
+# Networking goo
+#
+_check_host()
+{
+ ipaddr=`sed -n </etc/hosts -e '/^#/d' -e '/::/d' -e 's/$/ /' -e "/[ ]$1[ ]/"'{
+s/[ ].*//
+p
+}'`
+ if [ -z "$ipaddr" ]
+ then
+ echo "No /etc/hosts entry for $1"
+ return
+ fi
+
+ if [ `echo "$ipaddr" | wc -l | sed -e 's/ *//g'` -gt 1 ]
+ then
+ echo "Multiple /etc/hosts entries for $1"
+ return
+ fi
+
+ ifconfig \
+ | awk '
+/^[^ ]/ { iface = $1; next }
+/inet addr:'$ipaddr' / || /inet '$ipaddr' / {
+ if (iface == "lo")
+ print "Warning: '$1' associated with loopback network interface"
+ found = 1
+ exit
+ }
+END { if (found != 1)
+ print "Warning: '$1' ('$ipaddr') not associated with a network interface"
+ }'
+}
+
+host=`hostname`
+_check_host $host
+if which pmhostname >/dev/null 2>&1
+then
+ pmhost=`pmhostname`
+ if [ -z "$pmhost" ]
+ then
+ echo "Warning: pmhostname returns nothing!"
+ else
+ case $pmhost
+ in
+ $host|$host.*)
+ ;;
+ *)
+ echo "Warning: hostname ($host) is not a prefix of pmhostname ($pmhost)"
+ ;;
+ esac
+ _check_host $pmhost
+ fi
+fi
+
+if [ -f /etc/pcp.conf ]
+then
+ . /etc/pcp.conf
+
+ # need QA access to pmlogger via pmlc
+ #
+ if [ -f $PCP_SYSCONF_DIR/pmlogger/config.default ]
+ then
+ if grep -q 'allow 192\.168\.1\.\*' $PCP_SYSCONF_DIR/pmlogger/config.default
+ then
+ :
+ else
+ echo "Missing: \"allow 192.168.1.* : all;\" [access] in $PCP_SYSCONF_DIR/pmlogger/config.default"
+ fi
+ else
+ echo "Warning: \"$PCP_SYSCONF_DIR/pcp/pmlogger/config.default\" is missing"
+ fi
+else
+ echo "Warning: \"/etc/pcp.conf\" is missing"
+fi
diff --git a/qa/admin/myconfigure b/qa/admin/myconfigure
new file mode 100755
index 0000000..ce0e9a4
--- /dev/null
+++ b/qa/admin/myconfigure
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# Run configure like it is run for current system ... makes workarea
+# src/include/pcp.conf match /etc/pcp.conf so "sudo make install"
+# works without surprises
+#
+
+VERS=`uname -s | cut -c-5`
+ARCH=`uname -m`
+configure_options="--prefix=/usr --libexecdir=/usr/lib --sysconfdir=/etc --localstatedir=/var --with-rcdir=/etc/init.d"
+case "$VERS"
+in
+ MINGW)
+ configure_options="$configure_options --disable-ssp"
+ ;;
+ Linux)
+ if [ -f /etc/slackware-version ]
+ then
+ if [ "$ARCH" = x86_64 ]
+ then
+ configure_options="$configure_options --libdir=/usr/lib64"
+ fi
+ fi
+ ;;
+esac
+
+./configure $configure_options
diff --git a/qa/admin/pcp-daily b/qa/admin/pcp-daily
new file mode 100755
index 0000000..2dc7067
--- /dev/null
+++ b/qa/admin/pcp-daily
@@ -0,0 +1,838 @@
+#!/bin/sh
+#
+# Run test builds on one or more PCP machines
+#
+
+tmp=/var/tmp/$$
+sts=0
+trap "rm -f $tmp.*; exit \$sts" 0 1 2 3 15
+
+list_1="vm03 vm01 vm04 vm07 vm12 vm14 vm16 vm18 vm20 vm22 vm24"
+list_2="fuji grundy vm02 vm00 vm05 vm11 vm15 vm19 vm21 vm23"
+
+_usage()
+{
+ echo >&2 "Usage: `basename $0` [options] vm ..."
+ echo >&2 "options:"
+ echo >&2 " -a all except shutdown VM [implies -pmiqh]"
+ echo >&2 " -b branch pcp branch to checkout [default $pcp_branch]"
+ echo >&2 " -c check git repositories"
+ echo >&2 " -d output debugging diagnostics"
+ echo >&2 " -e file prerun script"
+ echo >&2 " -f force shutdown"
+ echo >&2 " -g what QA tests or groups to run, e.g. -g \"123 -g sanity -x remote\""
+ if [ "X$what" = Xall ]
+ then
+ echo >&2 " [default <nothing> => all tests]"
+ else
+ echo >&2 " [default $what]"
+ fi
+ echo >&2 " -h harvest QA failures"
+ echo >&2 " -i install built pcp packages"
+ echo >&2 " -m build (Makepkgs) for pcp"
+ echo >&2 " -p git pull for pcp"
+ echo >&2 " -q run qa"
+ echo >&2 " -r rerun qa for failing cases"
+ echo >&2 " -s shutdown VM"
+ echo >&2 " -S single-thread, not parallel"
+ echo >&2 " -t tree for pcp [default $pcp_tree]"
+ echo >&2 "default: -pmiqhs"
+ echo >&2 "vmlist1: $list_1"
+ echo >&2 "vmlist2: $list_2"
+ echo >&2 "[both vmlists run in parallel for the default case without -S]"
+}
+
+args="$*"
+pcp_branch=dev
+pcp_tree=pcp
+cflag=false
+fflag=false
+hflag=false
+iflag=false
+mflag=false
+pflag=false
+qflag=false
+rflag=false
+what="-g sanity -g libpcp -g pdu -g pmda -g valgrind -g pmie"
+what=all
+sflag=false
+Sflag=false
+options=false
+work=false
+efile=''
+debug=false
+while getopts "ab:B:cde:fg:himpqrsSt:T:?" c
+do
+ case $c
+ in
+ a)
+ options=true
+ work=true
+ pflag=true
+ mflag=true
+ iflag=true
+ qflag=true
+ hflag=true
+ ;;
+ b)
+ pcp_branch="$OPTARG"
+ ;;
+ c)
+ options=true
+ work=true
+ cflag=true
+ ;;
+ d)
+ debug=true
+ ;;
+ e)
+ efile="$OPTARG"
+ if [ -f "$efile" ]
+ then
+ :
+ else
+ echo "Error: $efile: cannot be found"
+ sts=1
+ exit
+ fi
+ ;;
+ f)
+ fflag=true
+ ;;
+ g)
+ what="$OPTARG"
+ ;;
+ h)
+ options=true
+ work=true
+ hflag=true
+ ;;
+ i)
+ options=true
+ work=true
+ iflag=true
+ ;;
+ m)
+ options=true
+ work=true
+ mflag=true
+ ;;
+ p)
+ options=true
+ work=true
+ pflag=true
+ ;;
+ q)
+ options=true
+ work=true
+ qflag=true
+ ;;
+ r)
+ options=true
+ work=true
+ rflag=true
+ ;;
+ s)
+ options=true
+ sflag=true
+ ;;
+ S)
+ Sflag=true
+ ;;
+ t)
+ pcp_tree="$OPTARG"
+ ;;
+ ?)
+ _usage
+ sts=1
+ exit
+ ;;
+ esac
+done
+shift `expr $OPTIND - 1`
+
+if [ $# -eq 0 ]
+then
+ if $Sflag
+ then
+ # serial run
+ set -- $list_1 $list_2
+ else
+ # run in parallel
+ set -- $list_1
+ pcp-daily $args $list_2 &
+ fi
+fi
+
+if $options
+then
+ :
+else
+ # defaults
+ #
+ work=true
+ pflag=true
+ mflag=true
+ iflag=true
+ qflag=true
+ hflag=true
+ sflag=true
+fi
+
+today=`date +%Y-%m-%d`
+mkdir -p $HOME/Logs/by-date/$today
+
+rm -f $tmp.domains
+echo "bozo" >>$tmp.domains
+echo "bozo-vm" >>$tmp.domains
+echo "bozo-laptop" >>$tmp.domains
+echo "fuji" >>$tmp.domains
+echo "grundy.sgi.com" >>$tmp.domains
+if which virsh >/dev/null 2>&1
+then
+ virsh list --all \
+ | sed >>$tmp.domains \
+ -e 1d \
+ -e '/-----/d' \
+ -e 's/^ *//' \
+ -e 's/^[0-9][0-9]*[ ]*//' \
+ -e 's/^-[ ]*//' \
+ -e 's/[ ].*//' \
+ -e '/^$/d'
+fi
+
+for target
+do
+ grep "^$target" <$tmp.domains >$tmp.domain
+ if [ ! -s $tmp.domain ]
+ then
+ echo "No domain matches \"$target\" ... the domains I have are ..."
+ cat $tmp.domains
+ continue
+ fi
+ count=`wc -l <$tmp.domain | sed -e 's/ //g'`
+ if [ $count != 1 ]
+ then
+ echo "Warning: More than one domain matches \"$target\" ... the matches I have are ..."
+ cat $tmp.domain
+ echo "... using the first one."
+ fi
+ domain=`sed -e 1q $tmp.domain`
+ # used to be vmNN-osname&version, but now just vmMM ...
+ # old sed now does nothing
+ #
+ host=`echo $domain | sed -e '/^vm/s/-.*//'`
+ echo "::: $domain :::"
+
+ if which virsh >/dev/null 2>&1
+ then
+ state=`virsh list --all | grep "$domain" | awk '{print $3}'`
+ case "$state"
+ in
+ shut)
+ if $work
+ then
+ sudo virsh start $domain
+ state=running
+ fi
+ ;;
+ running)
+ ;;
+ paused)
+ if $work
+ then
+ sudo virsh resume $domain
+ state=running
+ fi
+ ;;
+ '')
+ # probably not a VM, like "fuji"
+ ;;
+ *)
+ echo "No clue what do with virsh state \"$state\""
+ continue
+ ;;
+ esac
+ fi
+
+ if $work
+ then
+ log=$HOME/Logs/by-date/$today/$domain
+ touch $log
+ mkdir -p $HOME/Logs/by-vm/$domain
+ if [ ! -L $HOME/Logs/by-vm/$domain/$today ]
+ then
+ ( cd $HOME/Logs/by-vm/$domain; ln -s ../../by-date/$today/$domain $today )
+ fi
+
+ rm -f $tmp.up
+ wait=0
+ delta=5
+ max_wait=300
+ while [ $wait -lt $max_wait ]
+ do
+ # if ping -c 1 $host >/dev/null 2>&1
+ # then
+ if ssh $host true
+ then
+ $debug && echo host up
+ touch $tmp.up
+ break
+ fi
+ # else
+ $debug && echo host down
+ # fi
+ sleep $delta
+ wait=`expr $wait + $delta`
+ done
+ if [ ! -f $tmp.up ]
+ then
+ echo "Failed to start VM domain $domain after $max_wait secs ... giving up"
+ continue
+ fi
+
+ check=`ssh -t $host uname -sr 2>/dev/null`
+ $debug && echo "check=$check"
+ case "$check"
+ in
+ FreeBSD\ *)
+ osname=freebsd
+ ;;
+ *)
+ osname=unknown
+ ;;
+ esac
+ $debug && echo "osname=$osname"
+
+ # per-host settings
+ # MAKE=gmake for *BSD hosts
+ #
+ MAKE=make
+ case "$osname"
+ in
+ freebsd|netbsd)
+ MAKE=gmake
+ ;;
+ esac
+ $debug && echo "MAKE=$MAKE"
+
+ cat >$tmp.script <<End-of-File
+#!/bin/sh
+#
+# PCP Build Script from pcp-daily on `date`
+#
+
+[ -f \$HOME/.dailyrc ] && . \$HOME/.dailyrc
+if [ $debug = true ]
+then
+ echo PATH=\$PATH
+ echo MAKE=\$MAKE
+ which ${MAKE:-make}
+fi
+
+tmp=/var/tmp/\$\$
+trap "rm -f \$tmp.*; exit 0" 0 1 2 3 15
+rm -f \$HOME/daily.log
+touch \$HOME/daily.log
+
+case "$pcp_tree"
+in
+ pcpfans)
+ if [ ! -d src/pcpfans ]
+ then
+ git clone git://sourceware.org/git/${pcp_tree}.git src/pcpfans
+ echo "Info: clone $pcp_tree git tree" | tee -a \$HOME/daily.log
+ fi
+ ;;
+ *)
+ if [ ! -d src/$pcp_tree ]
+ then
+ git clone ssh://bozo/home/kenj/src/${pcp_tree} src/$pcp_tree
+ echo "Info: clone $pcp_tree git tree" | tee -a \$HOME/daily.log
+ fi
+ ;;
+esac
+
+cd src/$pcp_tree
+End-of-File
+ if [ -n "$efile" ]
+ then
+ cat $efile >>$tmp.script
+ fi
+ cat >>$tmp.script <<End-of-File
+git branch -a >\$tmp.branch
+if grep " $pcp_branch\$" <\$tmp.branch >/dev/null
+then
+ :
+else
+ if grep " remotes/origin/$pcp_branch\$" <\$tmp.branch >/dev/null
+ then
+ git branch --track $pcp_branch remotes/origin/$pcp_branch
+ echo "Info: pcp git branch $pcp_branch set up for remote tracking" | tee -a \$HOME/daily.log
+ else
+ echo "Error: pcp git branch $pcp_branch unknown!" | tee -a \$HOME/daily.log
+ exit 1
+ fi
+fi
+End-of-File
+
+ $cflag && cat >>$tmp.script <<End-of-File
+git status -s | grep 'M ' >\$tmp.status
+if [ -s \$tmp.status ]
+then
+ echo "Warning: modified pcp files ..." | tee -a \$HOME/daily.log
+ sed -e 's/.*M */ /' \$tmp.status | tee -a \$HOME/daily.log
+else
+ echo "Info: No modified pcp files" | tee -a \$HOME/daily.log
+fi
+End-of-File
+
+ $pflag && cat >>$tmp.script <<End-of-File
+# need to clean before pulling in case unwanted files no longer removed,
+# e.g. in PCP 3.x -> PCP 4.0 migration of source base
+# not needed any longer - 26 Mar 2013
+#${MAKE:-make} clean >>\$HOME/daily.log 2>&1
+# only VERSION.pcp is expected to be modified, sometimes!
+git checkout -f VERSION.pcp
+if git checkout $pcp_branch >>\$HOME/daily.log 2>&1
+then
+ echo "Info: pcp git checkout $pcp_branch" | tee -a \$HOME/daily.log
+else
+ echo "Error: pcp git checkout $pcp_branch failed!" | tee -a \$HOME/daily.log
+ exit 1
+fi
+if git pull >>\$HOME/daily.log 2>&1
+then
+ echo "Info: pcp git pull" | tee -a \$HOME/daily.log
+else
+ echo "Error: pcp git pull failed!" | tee -a \$HOME/daily.log
+ exit 1
+fi
+End-of-File
+
+ if $mflag
+ then
+ echo "${MAKE:-make} clean >>\$HOME/daily.log 2>&1" >>$tmp.script
+ cat >>$tmp.script <<'End-of-File'
+ok=false
+# if needed, bump build number for pcp-daily
+if [ ! -f VERSION.pcp.daily ]
+then
+ cp VERSION.pcp VERSION.pcp.daily
+else
+ diff VERSION.pcp VERSION.pcp.daily >$tmp.tmp
+ if egrep 'PACKAGE_MAJOR|PACKAGE_MINOR|PACKAGE_REVISION' <$tmp.tmp >/dev/null
+ then
+ # different PCP release, do an initial build
+ cp VERSION.pcp VERSION.pcp.daily
+ else
+ # same PCP release, bump away
+ awk -F= <VERSION.pcp.daily '
+BEGIN { OFS = "=" }
+$1 == "PACKAGE_BUILD" { print "PACKAGE_BUILD",$2+1; next }
+ { print }' \
+| sed -e 's/=$//' >$tmp.version
+ cp $tmp.version VERSION.pcp.daily
+ fi
+fi
+cp VERSION.pcp.daily VERSION.pcp
+# simulate a first-time build
+sudo rm -rf /usr/include/pcp
+sudo rm -f /usr/lib*/libpcp[_.]*
+# clean up any build turds
+rm -f qa/qa_outfiles
+End-of-File
+ echo "if MAKE=$MAKE ./Makepkgs --clean >>\$HOME/daily.log 2>&1" >>$tmp.script
+ cat >>$tmp.script <<'End-of-File'
+then
+ ok=true
+else
+ # for Debian/Ubuntu, it may just be the signing of the packages that
+ # failed
+ #
+ if tail -20 $HOME/daily.log | grep 'dpkg-buildpackage: warning: Failed to sign' >/dev/null
+ then
+ echo "Warning: Makepkgs failed to sign dpkg's" | tee -a $HOME/daily.log
+ else
+ echo "Error: Makepkgs failed!" | tee -a $HOME/daily.log
+ # restore build number
+ git checkout -f VERSION.pcp
+ exit 1
+ fi
+fi
+# restore build number
+git checkout -f VERSION.pcp
+# Look for errors/warnings in the build logs ...
+#
+for log in Logs/*
+do
+ echo "--- $log ---" >>$HOME/daily.log
+ cat $log >>$HOME/daily.log
+ echo "--- end $log ---" >>$HOME/daily.log
+done
+grep 'Permission denied' Logs/pcp >$tmp.err
+grep ' [Ee]rror: ' Logs/pcp >>$tmp.err
+grep ' [Ww]arning: ' Logs/pcp \
+| sed >>$tmp.err \
+ -e '/yyunput.* defined but not used/d' \
+ -e '/input.* defined but not used/d'
+if [ -s $tmp.err ]
+then
+ echo "Warning: `wc -l <$tmp.err | sed -e 's/ //g'` build warnings/errors" | tee -a $HOME/daily.log
+ cat $tmp.err >>$HOME/daily.log
+ echo "--- end build warnings/errors ---" >>$HOME/daily.log
+ ok=false
+fi
+$ok && echo "Info: Makepkgs" | tee -a $HOME/daily.log
+End-of-File
+ fi
+
+ $iflag && cat >>$tmp.script <<'End-of-File'
+# extract buildversion
+. ./VERSION.pcp
+if [ -z "$PACKAGE_MAJOR" -o -z "$PACKAGE_MINOR" -o -z "$PACKAGE_REVISION" ]
+then
+ ls -l VERSION.pcp | tee -a $HOME/daily.log
+ cat VERSION.pcp | tee -a $HOME/daily.log
+ echo "Error: VERSION.pcp is damaged" | tee -a $HOME/daily.log
+ exit 1
+fi
+buildversion=$PACKAGE_MAJOR.$PACKAGE_MINOR.$PACKAGE_REVISION
+# find lsm ... in pcp-$buildversion for most build types, but in
+# build/deb/pcp-$buildversion for debian
+lsm=''
+[ -f pcp-$buildversion/pcp.lsm ] && lsm=pcp-$buildversion/pcp.lsm
+[ -f build/deb/pcp-$buildversion/pcp.lsm ] && lsm=build/deb/pcp-$buildversion/pcp.lsm
+if [ -z "$lsm" ]
+then
+ ls -l pcp.lsm* pcp-$buildversion/pcp.lsm* | tee -a $HOME/daily.log
+ echo "Error: pcp.lsm not found" | tee -a $HOME/daily.log
+ exit 1
+fi
+src_version=`sed -n <$lsm -e 's/[ ]*$//' -e '/^Version:/{
+s/Version:[ ]*//
+p
+q
+}'`
+notfound=true
+case `echo build/deb/pcp_[0-9]*.deb`
+in
+ *\ *)
+ ls -l build/deb/pcp_[0-9]*.deb
+ echo "Error: more than one deb pkg found" | tee -a $HOME/daily.log
+ exit 1
+ ;;
+ 'build/deb/pcp_[0-9]*.deb')
+ # no deb packages
+ ;;
+ *)
+ # Debian packaging ...
+ if yes Y | sudo dpkg -i --force-depends build/deb/*.deb >>$HOME/daily.log 2>&1
+ then
+ echo "Info: dpkg install" | tee -a $HOME/daily.log
+ else
+ echo "Error: dpkg failed!" | tee -a $HOME/daily.log
+ exit 1
+ fi
+ notfound=false
+ ;;
+esac
+$notfound && case `echo pcp-$buildversion/build/rpm/pcp-[0-9]*.src.rpm`
+in
+ *\ *)
+ ls -l pcp-$buildversion/build/rpm/pcp-[0-9]*.src.rpm | tee -a $HOME/daily.log
+ echo "Error: more than one rpm pkg found" | tee -a $HOME/daily.log
+ exit 1
+ ;;
+ "pcp-$buildversion"'/build/rpm/pcp-[0-9]*.src.rpm')
+ # no rpm source package, assume some other sort of packaging
+ ;;
+ *)
+ # RPM packaging ...
+ # Notes may need to add these flags ...
+ # --nodeps needed because perl-Spreadsheet-Read is not available
+ # e.g. Fedora 15
+ # --oldpackage sometimes we do a downgrade on the QA machines
+ #
+ if sudo rpm -U `ls pcp-$buildversion/build/rpm/*.rpm | sed -e '/src.rpm/d'` >$tmp.out 2>&1
+ then
+ cat $tmp.out >>$HOME/daily.log
+ echo "Info: rpm install" | tee -a $HOME/daily.log
+ else
+ cat $tmp.out >>$HOME/daily.log
+ grep -v 'is already installed' $tmp.out >$tmp.tmp
+ if [ -s $tmp.tmp ]
+ then
+ echo "Error: rpm failed!" | tee -a $HOME/daily.log
+ exit 1
+ else
+ echo "Warning: rpm packages already installed" | tee -a $HOME/daily.log
+ fi
+ fi
+ notfound=false
+ ;;
+esac
+$notfound && if [ -f pcp-$buildversion/build/mac/pcp-[0-9]*[0-9].dmg ]
+then
+ # Mac OS X "pkg in a disk image" packaging
+ here=`pwd`
+ cd pcp-$buildversion/build/mac
+ if ./cmdline-install >>$HOME/daily.log 2>&1
+ then
+ echo "Info: installer install" | tee -a $HOME/daily.log
+ else
+ echo "Error: installer failed!" | tee -a $HOME/daily.log
+ exit 1
+ fi
+ cd $here
+elif [ -f pcp-$buildversion/build/sun/pcp-$src_version ]
+then
+ # System V style pkgadd/pkgrm packaging ...
+ here=`pwd`
+ cd pcp-$buildversion/build/sun
+ yes Y | sudo /usr/sbin/pkgrm pcp >>$HOME/daily.log 2>&1
+ if yes Y | sudo /usr/sbin/pkgadd -d `pwd` pcp all >>$HOME/daily.log 2>&1
+ then
+ echo "Info: pkgadd install" | tee -a $HOME/daily.log
+ else
+ echo "Error: pkgadd failed!" | tee -a $HOME/daily.log
+ exit 1
+ fi
+ cd $here
+ sudo /usr/sbin/svcadm enable -s svc:/application/pcp/pmcd >>$HOME/daily.log 2>&1
+ sudo /usr/sbin/svcadm enable -s svc:/application/pcp/pmlogger >>$HOME/daily.log 2>&1
+elif [ -f pcp-$buildversion/build/tar/pcp-[0-9]*[0-9].tar.gz ]
+then
+ # tarball packaging ... (this has to be last, because some of the
+ # other packaging regimes also create tarballs)
+ here=`pwd`
+ tarball=$here/pcp-$buildversion/build/tar/pcp-[0-9]*[0-9].tar.gz
+ cd pcp-$buildversion/build/tar
+ sudo ./preinstall >>$HOME/daily.log 2>&1
+ cd /
+ if sudo tar -zxpf $tarball >>$HOME/daily.log 2>&1
+ then
+ echo "Info: tar install" | tee -a $HOME/daily.log
+ else
+ echo "Error: tar install failed!" | tee -a $HOME/daily.log
+ exit 1
+ fi
+ cd $here
+ cd pcp-$buildversion/build/tar
+ sudo ./postinstall >>$HOME/daily.log 2>&1
+ cd $here
+else
+ echo "Don't know how to install packages" | tee -a $HOME/daily.log
+ exit 1
+fi
+if [ -f pcp-$buildversion/build/sun/pcp-$src_version ]
+then
+ : pmcd started above
+else
+ . /etc/pcp.env
+ if sudo $PCP_RC_DIR/pcp start >>$HOME/daily.log 2>&1
+ then
+ echo "Info: pmcd started" | tee -a $HOME/daily.log
+ else
+ echo "Error: pmcd start failed" | tee -a $HOME/daily.log
+ exit 1
+ fi
+fi
+running_version=`pmprobe -v pmcd.version | sed -e 's/"//g' -e 's/pmcd.version 1 //'`
+echo "Source version: $src_version" >>$HOME/daily.log
+echo "Running version: $running_version" >>$HOME/daily.log
+if [ "$src_version" != "$running_version" ]
+then
+ pcp >>$HOME/daily.log
+ echo "Error: version mismatch src=$src_version running=$running_version" | tee -a $HOME/daily.log
+ exit 1
+fi
+# sample PMDA may have an updated PMNS, so re-install just in case
+( cd $PCP_VAR_DIR/pmdas/sample; sudo ./Install </dev/null ) >>$HOME/daily.log
+End-of-File
+
+ cat >>$tmp.script <<End-of-File
+
+cd qa
+End-of-File
+
+ check_what="$what"
+ [ X"$what" = Xall ] && check_what=''
+ case "$domain"
+ in
+ *grundy*)
+ # Need to add
+ # -x remote default for grundy.sgi.com if running all tests
+ #
+ [ X"$what" = Xall ] && check_what='$check_what -x remote'
+ ;;
+ vm06)
+ # Only -g sanity at this stage for FreeBSD
+ #
+ [ X"$what" = Xall ] && check_what='-g sanity'
+ ;;
+ esac
+
+ $qflag && cat >>$tmp.script <<End-of-File
+rm -f *.out.bad
+./changeversion >/dev/null 2>&1
+if ./check -l $check_what >>\$HOME/daily.log 2>&1
+then
+ echo "Info: QA $what" | tee -a \$HOME/daily.log
+else
+ echo "Error: QA $what failed!" | tee -a \$HOME/daily.log
+ sed -e '/^ [0-9 ]*\$/d' <check.log \
+ | awk '
+NF == 0 { txt = ""; next }
+ { if (txt == "") txt = \$0
+ else txt = txt "\n" \$0
+ }
+END { print txt }' | tee -a \$HOME/daily.log
+fi
+End-of-File
+
+ $rflag && cat >>$tmp.script <<End-of-File
+if ./recheck >>\$HOME/daily.log 2>&1
+then
+ echo "Info: QA recheck" | tee -a \$HOME/daily.log
+else
+ echo "Error: QA recheck failed!" | tee -a \$HOME/daily.log
+fi
+End-of-File
+
+ $hflag && cat >>$tmp.script <<End-of-File
+rm -f \$HOME/daily.harvest
+touch \$HOME/daily.harvest
+nbad=0
+nfull=0
+for bad in *.out.bad
+do
+ [ "\$bad" = '*.out.bad' ] && continue
+ echo \$bad >>\$HOME/daily.harvest
+ nbad=\`expr \$nbad + 1\`
+ seq=\`echo \$bad | sed -e 's/\.out\.bad//'\`
+ [ -f \$seq.out ] && echo \$seq.out >>\$HOME/daily.harvest
+ if [ -f \$seq.full ]
+ then
+ echo \$seq.full >>\$HOME/daily.harvest
+ nfull=\`expr \$nfull + 1\`
+ fi
+done
+[ -s \$HOME/daily.harvest ] && cat \$HOME/daily.harvest >>\$HOME/daily.log
+echo "Info: harvest \$nbad *.bad files, \$nfull *.full files" | tee -a \$HOME/daily.log
+End-of-File
+
+ chmod 755 $tmp.script
+ if scp $tmp.script $host:daily.script >$tmp.out 2>&1
+ then
+ :
+ else
+ cat $tmp.out
+ echo "Error: scp failed!"
+ continue
+ fi
+ ssh -t $host sh -c ./daily.script
+ scp -q $host:daily.log $tmp.out
+ echo "=== `date` ===" >>$log
+ cat $tmp.out >>$log
+ echo "=== END ===" >>$log
+
+ if $hflag
+ then
+ # harvest failures by pulling from QA host
+ echo "Harvest:"
+ if [ -d $HOME/Logs/by-vm/$domain/pcpqa ]
+ then
+ # old dir name
+ mv $HOME/Logs/by-vm/$domain/pcpqa $HOME/Logs/by-vm/$domain/qa
+ fi
+ if [ ! -d $HOME/Logs/by-vm/$domain/qa ]
+ then
+ rm -f $HOME/Logs/by-vm/$domain/qa
+ mkdir -p $HOME/Logs/by-vm/$domain/qa
+ ( cd $HOME/Logs/by-vm/$domain/qa;
+ for file in common* group show-me localconfig
+ do
+ ln -s $HOME/src/pcp/qa/$file* .
+ done
+ )
+ fi
+ rm -f $HOME/Logs/by-vm/$domain/qa/[0-9]*
+ rm -f $tmp.harvest
+ scp $host:daily.harvest $tmp.harvest >$tmp.out 2>&1
+ if [ -s $tmp.harvest ]
+ then
+ for file in `cat $tmp.harvest`
+ do
+ echo -n " $file"
+ if scp $host:src/pcp/qa/$file $HOME/Logs/by-vm/$domain/qa >$tmp.err 2>&1
+ then
+ :
+ else
+ echo
+ cat $tmp.err
+ fi
+ done
+ echo
+ elif [ -s $tmp.out ]
+ then
+ echo "scp error ..."
+ cat $tmp.out
+ else
+ echo "No failures."
+ fi
+ fi
+ fi
+
+ if $sflag
+ then
+ doit=false
+ case $host
+ in
+ vm01|vm03)
+ # try to keep vm01 and vm03 running, unless -f
+ $fflag && doit=true
+ ;;
+ vm*)
+ doit=true
+ ;;
+ esac
+ if $doit
+ then
+ if [ $state = shut ]
+ then
+ if $work
+ then
+ echo "Warning: Already shutdown" | tee -a $HOME/daily.log
+ else
+ echo "Warning: Already shutdown"
+ fi
+ else
+ ssh -t -q $host sudo poweroff -f </dev/null >/dev/null 2>&1 &
+ sleep 20
+ sudo virsh shutdown $domain >/dev/null 2>&1
+ sleep 10
+ # seems a bit harsh, but we've given you two chances to
+ # shutdown
+ #
+ sudo virsh destroy $domain
+ if $work
+ then
+ echo "Info: Shutdown" | tee -a $HOME/daily.log
+ else
+ echo "Info: Shutdown"
+ fi
+ fi
+ else
+ if $work
+ then
+ echo "Warning: Shutdown skipped" | tee -a $HOME/daily.log
+ else
+ echo "Warning: Shutdown skipped"
+ fi
+ fi
+ fi
+
+ $work && echo "Logs in $log"
+
+done
diff --git a/qa/admin/pcp-qa-summary b/qa/admin/pcp-qa-summary
new file mode 100755
index 0000000..1fa6ee3
--- /dev/null
+++ b/qa/admin/pcp-qa-summary
@@ -0,0 +1,320 @@
+#!/bin/sh
+#
+# pcp-qa-summary [vm ...]
+#
+# Used in concert with pcp-daily -q
+#
+
+_usage()
+{
+ echo "Usage: $0 [options] [vm ...]"
+ echo "Options:"
+ echo " -d debug"
+ echo " -m N minimum number of tests run to be reported [default 60]"
+ echo ' -n report not run tests (reported as "-")'
+ echo " -r only most recent results date [default report all dates]"
+ exit 1
+}
+
+
+# must have tried to run at least this number to qualify
+# 60 = > -g sanity [minus a few not runs]
+#
+minrun=60
+
+debug=false
+recent=false
+nflag=false
+while getopts 'dm:nr?' p
+do
+ case "$p"
+ in
+ d) debug=true
+ ;;
+ m) minrun=$OPTARG
+ ;;
+ n) nflag=true
+ ;;
+ r) recent=true
+ ;;
+ ?) _usage
+ # NOTREACHED
+ esac
+done
+shift `expr $OPTIND - 1`
+
+sts=0
+if $debug
+then
+ tmp=`pwd`/tmp
+ trap "exit \$sts" 0 1 2 3 15
+else
+ tmp=/var/tmp/$$
+ trap "rm -f $tmp.*; exit \$sts" 0 1 2 3 15
+fi
+rm -f $tmp.*
+
+if [ $# -eq 0 ]
+then
+ set -- `[ -d $HOME/Logs/by-vm ] && cd $HOME/Logs/by-vm && echo *`
+fi
+
+if [ -f $HOME/whatami.out ]
+then
+ # Turn
+ # Host PCP CPU Operating System
+ # ----------- -------- ------ ------------------
+ # vm00 3.7.0 x86_64 Ubuntu 12.04 (precise)
+ # into
+ # vm00|PCP 3.7.0 x86_64 Ubuntu 12.04
+ #
+ sed <$HOME/whatami.out \
+ -e '1,2d' \
+ -e '/^[ ]*$/d' \
+ -e 's/ */|PCP#/' \
+ -e 's/ */#/' \
+ -e 's/ */#/' \
+ -e 's/ *(.*)//' \
+ -e 's/#/ /g' \
+ | LC_COLLATE=POSIX sort -t '|' --key=1,1 >$tmp.what
+fi
+
+_what()
+{
+ if [ -f $tmp.what ]
+ then
+ LC_COLLATE=POSIX sort -t '|' --key=1,1 \
+ | join \
+ -1 2 -2 1 -t '|' -a 1 -e "$vmdir" -o 1.1,2.1,2.2 \
+ - $tmp.what \
+ | sed -e 's/|PCP/ PCP/'
+ else
+ cat
+ fi
+}
+
+echo "==== QA Summary ===="
+echo
+echo "Date Run Pass Fail Nrun Host"
+for vm
+do
+ cd $HOME/Logs/by-vm
+ if [ -d "$vm" ]
+ then
+ cd "$vm"
+ vmdir="$vm"
+ else
+ vmdir=`echo ${vm}*`
+ if [ -d "$vmdir" ]
+ then
+ cd "$vmdir"
+ else
+ echo "$vm: arrrgggh no \$HOME/Logs/${vm}* directory"
+ continue
+ fi
+ fi
+ basevmname=`echo $vmdir | sed -e 's/\(vm[0-9][0-9]\)-.*/\1/' -e 's/\.sgi.com//'`
+ rm -f $tmp.seen $tmp.found
+ for date in `ls | grep -v qa | grep -v pcpqa | grep -v pcp | sort -r`
+ do
+ [ -f $date ] || continue
+ touch $tmp.seen
+ $debug && echo "Debug: == $vmdir on $date =="
+ # Looking for
+ # Not run: 008 009 022 096 114 117 130 148 164 212 223 233 284 290 307 311 329 330 331 332 333 348 361 370 377 390 420 441 442 476 477 478 480 506 512 545 570 584 640 652 654 712 713 714
+ # Failures: 062 169 244
+ # Failed 3 of 516 tests
+ # Passed all 67 tests
+ #
+ rm -f $tmp.dbg
+ if egrep '^((Not run:)|Failures:|(Failed [0-9][0-9]* of [0-9][0-9]* tests)|(Passed all [0-9][0-9]* tests)|Info:|===)' <$date >/dev/null
+ then
+ awk <$date >$tmp.out '
+/^Not run:/ { notrun = NF - 2
+ nrlist = $3
+ for (i = 4; i <= NF; i++) nrlist = nrlist " " $i
+ state = 1
+ print NR,": Not run: start: notrun=" notrun >"'$tmp.dbg'"
+ next
+ }
+/^Failed [0-9][0-9]* of [0-9][0-9]* tests/ {
+ failed = $2
+ run = $4
+ state = 3
+ }
+/^Passed all [0-9][0-9]* tests/ {
+ failed = 0
+ run = $3
+ state = 3
+ }
+/^Failures:/ { nfail = NF - 1
+ flist = $2
+ for (i = 3; i <= NF; i++) flist = flist " " $i
+ print NR,": Failures: start: nfail=" nfail >"'$tmp.dbg'"
+ state = 2
+ next
+ }
+/^Info:/ {
+ state = 0
+ notrun = 0
+ nfail = 0
+ next
+ }
+/^===/ {
+ state = 0
+ notrun = 0
+ nfail = 0
+ next
+ }
+state == 1 { # Not run: list broken over multiple lines
+ notrun += NF
+ for (i = 1; i <= NF; i++) nrlist = nrlist " " $i
+ print NR,": Not run: add",NF," notrun=" notrun >"'$tmp.dbg'"
+ next
+ }
+state == 2 { # Failures: list broken over multiple lines
+ nfail += NF
+ for (i = 1; i <= NF; i++) flist = flist " " $i
+ print NR,": Failures: add",NF," nfail=" nfail >"'$tmp.dbg'"
+ next
+ }
+state == 3 { if (run >= '$minrun') printf "%s %4d %4d %4d %4d|%s|%s+%s\n","'$date'",run,run-failed,failed,notrun,"'$basevmname'",flist,nrlist
+ state = 0
+ notrun = 0
+ nfail = 0
+ }
+END { print NR,": END state=" state >"'$tmp.dbg'"
+ }'
+ # Need to sort multiple runs one this date and pick the one
+ # with the maximum passes and minimum not runs
+ #
+ # 2013-03-13 1 1 0 0|vm19-opensuse-64
+ # 2013-03-13 67 67 0 2|vm19-opensuse-64
+ # 2013-03-13 512 509 3 48|vm19-opensuse-64
+ # 2013-03-13 512 509 3 16|vm19-opensuse-64
+ $debug && sed -e 's/^/Debug: /' <$tmp.dbg
+ sort <$tmp.out --key=3,3nr --key=5,5n \
+ | sed -e 1q >$tmp.tmp
+ if [ -s $tmp.tmp ]
+ then
+ if $debug
+ then
+ echo "Debug: summary lines ..."
+ sed -e 's/^/Debug: /' <$tmp.out
+ fi
+ sed -e 's/|[^|]*$//' <$tmp.tmp | _what >>$tmp.found
+ nfail=`awk <$tmp.tmp '{print $4}'`
+ if [ $nfail -gt 0 ]
+ then
+ sed -e 's/.*|//' -e 's/+.*//' <$tmp.tmp \
+ | tr ' ' '\012' \
+ | sed -e "s/\$/ X $basevmname/" >>$tmp.map
+ fi
+ if $nflag
+ then
+ nrun=`sed -e 's/|.*//' <$tmp.tmp | awk '{print $5}'`
+ if [ $nrun -gt 0 ]
+ then
+ sed -e 's/.*+//' <$tmp.tmp \
+ | tr ' ' '\012' \
+ | sed -e "s/\$/ - $basevmname/" >>$tmp.map
+ fi
+ fi
+ $recent && break
+ else
+ $debug && echo "Debug: tag lines, but no QA results found"
+ fi
+ else
+ $debug && echo "Debug: no QA result tag lines found"
+ fi
+ done
+ if [ -f $tmp.found ]
+ then
+ sort $tmp.found
+ cat $tmp.found >>$tmp.counts
+ else
+ if [ -f $tmp.seen ]
+ then
+ printf "%-30s|%s\n" "Daily runs, but no QA" "$basevmname" | _what
+ elif [ ! -f $tmp.seen ]
+ then
+ printf "%-30s|%s\n" "No daily runs" "$basevmname" | _what
+ fi
+ fi
+
+done
+
+if [ -f $tmp.counts ]
+then
+ awk <$tmp.counts '
+ { nrun += $2; nfail += $4 }
+END { printf "Summary: %d run, %d failed (%.2f%%)\n", nrun, nfail, 100*nfail/nrun }'
+fi
+
+if [ -f $tmp.map ]
+then
+ echo
+ if $nflag
+ then
+ echo "==== QA Failure (X) and Not Run (-) Map ===="
+ else
+ echo "==== QA Failure (X) Map ===="
+ fi
+ echo
+ ( ( sed -e 's/.* //' <$tmp.map | sort | uniq ) \
+ ; echo "---" \
+ ; sort -n $tmp.map \
+ ; echo "END" \
+ ) \
+ | awk '
+function heading() {
+ printf "%4.4s","Host"
+ for (i = 0; i < nh; i++) {
+ if (host[i] ~ /^vm/)
+ printf " %2.2s",substr(host[i],length(host[i])-1)
+ else if (host[i] == "bozo-laptop")
+ printf " %2.2s","bl"
+ else if (host[i] == "bozo-vm")
+ printf " %2.2s","bv"
+ else
+ printf " %2.2s",substr(host[i],1,2)
+ }
+ printf "\n"
+}
+BEGIN { nh = 0; state = 0 }
+$1 == "---" { heading()
+ printf "%4.4s","QA"
+ for (i = 0; i < nh; i++) printf " %2.2s"," "
+ printf " %4.4s QA groups\n","QA"
+ state = 1
+ last = $1
+ next
+ }
+state == 0 { host[nh] = $1; nh++; next }
+$1 != last { if (last != "---") {
+ printf "%4.4s",last
+ for (i = 0; i < nh; i++) printf " %2.2s",fail[i]
+ printf " %4.4s ",last
+ cmd = "grep \"^" last " \" $HOME/src/pcp/qa/group | sed -e \"s/^[0-9]* //\""
+ system(cmd)
+ }
+ for (i = 0; i < nh; i++) fail[i] = " "
+ last = $1
+ }
+$1 == last { for (i = 0; i < nh; i++) {
+ if (host[i] == $3) {
+ fail[i] = $2
+ break
+ }
+ }
+ }
+END { heading() }' \
+ | sed \
+ -e 's/ remote//' \
+ -e 's/ sanity//' \
+ -e 's/ ostest//' \
+ -e 's/ local//' \
+ -e 's/ oss//' \
+ -e 's/ #[0-9][0-9]*//g'
+fi
+
diff --git a/qa/admin/show-me-all b/qa/admin/show-me-all
new file mode 100755
index 0000000..08fbd70
--- /dev/null
+++ b/qa/admin/show-me-all
@@ -0,0 +1,59 @@
+#!/bin/sh
+#
+# Trawl pcp-daily log directories looking for _all_ the failures
+# for one or more tests
+#
+
+tmp=/var/tmp/$$
+sts=0
+trap "rm -f $tmp.*; exit \$sts" 0 1 2 3 15
+
+_usage()
+{
+ echo "Usage: $0 [options] seq ..."
+ echo "Options:"
+ echo " -f show me seq.full if it exists"
+ sts=1
+ exit
+}
+
+full=false
+verbose=false
+while getopts 'f?' p
+do
+ case "$p"
+ in
+ f) full=true
+ ;;
+
+ ?) _usage
+ # NOTREACHED
+ esac
+done
+shift `expr $OPTIND - 1`
+[ $# -ge 1 ] || _usage
+
+cd $HOME
+
+for seq
+do
+ find $HOME/Logs/by-vm -name "$seq.out.bad" \
+ | sort \
+ | while read bad
+ do
+ cd `dirname $bad`
+ for qabits in localconfig
+ do
+ if [ -L $qabits ]
+ then
+ :
+ else
+ rm -f $qabits
+ ln -s $HOME/src/pcp/qa/$qabits $qabits
+ fi
+ done
+ echo -n `echo "$bad" | sed -e "s;^$HOME/Logs/by-vm/;;" -e 's/[-/].*/-/'`
+ show-me $seq
+ $full && [ -f $seq.full ] && less $seq.full </dev/tty
+ done
+done