#! /bin/sh # PCP QA Test No. 600 # $Revision: 1.12 $ # Test __pmTimezone # # This test looks like its tripping two genuine bugs in Linux: # 1. for glibc-2.2.4 or earlier, Linux seems to invert the sense of the # daylight savings ranges (- is valid output, + is broken linux version): # # diff -c 600.out 600.out.bad: # ... # ABC-10:00:00XYZ-11:00:00,M12.5.0/3:00:00,M7.5.0/2:00:00 -> ABC-10XYZ-11,M12.5.0/3,M7.5.0/2 # -In March daylight saving is on, and the time is 01 March 2000 23:00 XYZ # +In March daylight saving is off, and the time is 01 March 2000 22:00 ABC # In September daylight saving is off, and the time is 01 September 2000 22:00 ABC # ... # # 2. linux appears to ignore invalid olsen style timezones # ... # -:Someplace/Somewhere -> ABC-10 # +ABC-10 -> ABC-10 # In March daylight saving is off, and the time is 01 March 2000 22:00 ABC # In September daylight saving is off, and the time is 01 September 2000 22:00 ABC # + # +:Someplace/Somewhere -> Someplace/Somewhere # +In March daylight saving is off, and the time is 01 March 2000 12:00 Someplace/Somewhere # +In September daylight saving is off, and the time is 01 September 2000 12:00 Someplace/Somewhere # ... # # # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved. # # creator owner=max seq=`basename $0` . ./localconfig if [ $PCP_EOE_VER -le 2100 \ -o \( $PCP_EOE_VER -ge 6500 -a $PCP_EOE_VER -le 6508 \) ] then echo "needs libpcp.so with TZ changes" >$seq.notrun echo "$seq: [not run] `cat $seq.notrun`" exit 0 fi rm -f $seq.out if [ $PCP_PLATFORM = "linux" ] then if which rpm >/dev/null 2>&1 then eval `rpm -q glibc | sed -e 's/glibc-/a=/' -e 's/\./ b=/' -e 's/\./ c=/' -e 's/-.*//'` else eval `echo /lib/libc-*.so | sed -e 's/\.so.*//' -e 's/.*-//' -e 's/^/a=/' -e 's/\./ b=/' -e 's/\./ c=/'` fi if [ -z "$a" -o "$a" = "*" ] then echo "Arrggh ... cannot get major version for libc" rpm -q glibc ls -l /lib/libc-*.so exit 1 fi if [ "$a" -lt 2 ] then # a.?.?, a < 2 ln $seq.out.linux.0 $seq.out elif [ "$a" -eq 2 ] then if [ -z "$b" -o "$b" = "*" ] then echo "Arrggh ... cannot get minor version for libc" rpm -q glibc ls -l /lib/libc-*.so exit 1 fi if [ "$b" -lt 2 ] then # 2.b.?, b < 2 ln $seq.out.linux.0 $seq.out elif [ "$b" -eq 2 ] then if [ -z "$c" -o "$c" = "*" ] then echo "Arrggh ... cannot get really minor version for libc" rpm -q glibc ls -l /lib/libc-*.so exit 1 fi if [ "$c" -lt 4 ] then # 2.2.c, c < 4 ln $seq.out.linux.0 $seq.out else # 2.2.c, c >= 4 # need this one for LBS 2.1 ln $seq.out.linux.1 $seq.out fi else # 2.b.?, b > 2 ln $seq.out.linux.1 $seq.out fi else # a.?.?, a > 2 ln $seq.out.linux.1 $seq.out fi #DEBUG# echo "glibc version $a.$b.$c" #DEBUG# ls -l $seq* else ln $seq.out.irix $seq.out fi echo "QA output created by $seq" # get standard environment, filters and checks . ./common.product . ./common.filter . ./common.check tmp=/tmp/$$ here=`pwd` sudo=$here/sudo status=1 # failure is the default! trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 # real QA test starts here TZ=XYZ-11; export TZ src-oss/tztest | sed \ -e's|XYZ-11:03:04ABC-10:01:02,M12.5.0/3:04:05,M7.1.0/2:06:07|ABC-10:01:02XYZ-11:03:04,M12.5.0/3:04:05,M7.1.0/2:06:07|' \ -e's|XYZ-11ABC-10,M12.5.0/3:01:02,M7.1.0/2:03:04|ABC-10XYZ-11,M12.5.0/3:01:02,M7.1.0/2:03:04|' status=0 exit