1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
|
#! /bin/sh
# PCP QA Test No. 600
# Test __pmTimezone
#
# Bizarre Note (observations based on machines in the Melbourne
# timezone)
#
# Looks like this test starts to fail towards the end of the last
# week of December, but starts passing again on 1 Jan.
# Observed 2014/2015.
#
# The same thing appears to happen with failures starting 1 Jul,
# and passing resumes around 7 Jul.
# Observed 2019.
#
# This test looks like its tripping 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
# ...
#
# 3. glibc 2.2.93 and 2.3.x just gets it wrong
#
# Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
rm -f $seq.out
if [ $PCP_PLATFORM = linux ]
then
a=''
which rpm >/dev/null 2>&1
if [ $? -eq 0 -a ! -f /etc/debian_version ]
then
eval `rpm -q glibc | sed -e 's/glibc-/a=/' -e 's/\./ b=/' -e 's/\./ c=/' -e 's/-.*//'`
elif which dpkg >/dev/null 2>&1
then
lib=`find /lib /usr/lib -name libc.so 2>/dev/null | sed -e '/plexmediaserver/d' -e 1q`
echo "lib=$lib" >>$seq_full
if [ -n "$lib" ]
then
pkg=`dpkg -S $lib | sed -e 's/: .*//' -e 1q`
if [ -n "$pkg" ]
then
eval `dpkg -l $pkg \
| $PCP_AWK_PROG '$2 == "'$pkg'" { print $3 }' \
| sed -e 's/^/a=/' -e 's/\./ b=/' -e 's/[-.].*//'`
fi
fi
fi
if [ -z "$a" ]
then
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
#[ ! -f /etc/debian_version ] && rpm -q glibc
#ls -l /lib/libc-*.so
_notrun "Cannot find major version for libc"
fi
# Use glibc version
echo "glibc a=$a b=$b c=$c" >>$seq_full
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"
[ ! -f /etc/debian_version ] && 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"
[ ! -f /etc/debian_version ] && 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
elif [ "$c" -eq 93 ]
then
# 2.2.93
ln $seq.out.linux.2 $seq.out
else
# 2.2.c, c >= 4
# need this one for LBS 2.1
ln $seq.out.linux.1 $seq.out
fi
elif [ "$b" -eq 3 ]
then
if [ "$c" -lt 2 ]
then
# 2.3.c, c < 2
ln $seq.out.linux.2 $seq.out
else
# 2.3.c, c >= 3
# glibc-2.3.2-95.20 PP3 SP2
# glibc-2.3.3-98.3 SuSE SLES9 beta4
ln $seq.out.linux.1 $seq.out
fi
elif [ "$b" -lt 8 ]
then
# 2.b.?, b > 3 and b < 8
ln $seq.out.linux.1 $seq.out
elif [ "$b" -lt 10 ]
then
# 2.b.?, b == 8 or 9
ln $seq.out.linux.3 $seq.out
else
# 2.b.?, b >= 10
ln $seq.out.linux.4 $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*
elif [ $PCP_PLATFORM = darwin ]
then
ln $seq.out.darwin $seq.out
elif [ $PCP_PLATFORM = freebsd ]
then
# depends on major release number
#
os_version=`uname -rs | sed -e 's/FreeBSD //' -e 's/-.*//'`
case "$os_version"
in
15.*)
ln $seq.out.freebsd.2 $seq.out
;;
*)
ln $seq.out.darwin $seq.out
;;
esac
elif [ $PCP_PLATFORM = openbsd ]
then
ln $seq.out.openbsd $seq.out
elif [ $PCP_PLATFORM = solaris ]
then
ln $seq.out.solaris $seq.out
else
_notrun "No qualified output for PCP_PLATFORM=$PCP_PLATFORM"
fi
status=1 # failure is the default!
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
# real QA test starts here
src/tztest >>$seq_full
TZ=XYZ-11; export TZ
src/tztest -Dcontext 2>>$seq_full >$tmp.out
sed -n -e '/^pmSetDebug(/p' $tmp.out >>$seq_full
sed -e '/^pmSetDebug(/d' $tmp.out
status=0
exit
|