#!/bin/sh function SysStats() { # Collect some stats prior to running the test echo "***** System stats *****" vmstat echo "---" free -m echo "---" cat /proc/meminfo echo "---" cat /proc/slabinfo echo "***** System stats *****" } function VerboseCupsLog() { # This funnction was added Nov 2010 in hopes of assisting in resoltion of bugzilla 452305 # See comment #31 https://bugzilla.redhat.com/show_bug.cgi?id=452305 # Provide more verbose debug logging in /var/log/cups/error_log echo "-------------------------------------------------------------------------" echo "Setting up verbose debug logging in /var/log/cups/error_log for BZ452305." echo "-------------------------------------------------------------------------" rstrnt-backup /etc/cups/cupsd.conf sed -i -e 's,^LogLevel.*,LogLevel debug2,' /etc/cups/cupsd.conf sed -i -e '/^MaxLogSize/d' /etc/cups/cupsd.conf echo MaxLogSize 0 >> /etc/cups/cupsd.conf sed -i -e '/^Browsing/d' /etc/cups/cupsd.conf sed -i -e '/^DefaultShared/d' /etc/cups/cupsd.conf echo "Browsing No" >> /etc/cups/cupsd.conf echo "DefaultShared No" >> /etc/cups/cupsd.conf # sed will create temporary file in /etc/cups and rename it to cupds.conf # so file ends up with wrong label restorecon /etc/cups/cupsd.conf # start service before using cupsctl /sbin/service cups restart echo "cupsctl: " cupsctl } # ---------- Build UseX ------------- tar zxvf usex-1.9-34.tar.gz pushd usex-1.9-34 && make || exit 1 # ---------- Start Test ------------- RHELVER="" cat /etc/redhat-release | grep "^Fedora" if [ $? -ne 0 ]; then RHELVER=$(cat /etc/redhat-release |sed 's/.*\(release [0-9]\).*/\1/') fi if [ -z "$RHELVER" ]; then kernel_rhelver=$(uname -r | grep -o el[0-9]) echo "Taking release from kernel version: $kernel_rhelver" if [ "$kernel_rhelver" == "el6" ]; then RHELVER="release 6" fi if [ "$kernel_rhelver" == "el7" ]; then RHELVER="release 7" fi fi echo "RHELVER is $RHELVER" VerboseCupsLog INFILE=../rhtsusex.tcf MYARCH=`uname -m` if [ "$MYARCH" = "x86_64" -o "$MYARCH" = "s390x" ]; then ln -s /usr/lib64/libc.a /usr/lib/libc.a fi #if ppc64 has less than or equal to 1 GB of memory don't run the vm tests ONE_GB=1048576 if [ "$MYARCH" = "ppc64" ]; then mem=`cat /proc/meminfo |grep MemTotal|sed -e 's/[^0-9]*\([0-9]*\).*/\1/'` test "$mem" -le "$ONE_GB" && INFILE=../rhtsusex_lowmem.tcf logger -s "Running the rhtsusex_lowmem.tcf file" fi SysStats | tee sys_stats.log logger -t USEXINFO -f sys_stats.log if [ "x$RHELVER" == "xrelease 6" ]; then logger -s "Running $RHELVER configuration" ./usex --rhts hang-trace --exclude=ar,strace,clear -i $INFILE -l usex.log --nodisplay -R report.out elif [ "x$RHELVER" == "xrelease 7" ]; then logger -s "Running $RHELVER configuration" ./usex --rhts hang-trace --exclude=ar,as,strace,clear -i $INFILE -l usex.log --nodisplay -R report.out else logger -s "Running default configuration" ./usex --rhts hang-trace --exclude=clear -i $INFILE -l usex.log --nodisplay -R report.out fi # Default result to FAIL export result="FAIL" # Then post-process the results to find the regressions export fail=`cat report.out | grep "USEX TEST RESULT: FAIL" | wc -l` if [ "$fail" -gt "0" ]; then export result="FAIL" rstrnt-report-log -l report.out tar -czvf /tmp/cupslog.tar /var/log/cups rstrnt-report-log -l /tmp/cupslog.tar rstrnt-report-log -l /etc/cups/cupsd.conf else export result="PASS" fi rstrnt-report-result $RSTRNT_TASKNAME $result $fail rstrnt-report-log -l usex.log