annotate test/start-Xvfb.sh @ 8503:f26a0c8071bd

8027298: broken link in jdk8b113 macosx binaries Reviewed-by: dcubed, ihse
author erikj
date Tue, 29 Oct 2013 15:44:30 +0100
parents af9346401220
children 2acdea04aa37
rev   line source
ohair@1821 1 #!/bin/sh -f
ohair@1821 2 #
ohair@2362 3 # Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
ohair@1821 4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ohair@1821 5 #
ohair@1821 6 # This code is free software; you can redistribute it and/or modify it
ohair@1821 7 # under the terms of the GNU General Public License version 2 only, as
ohair@2362 8 # published by the Free Software Foundation. Oracle designates this
ohair@1821 9 # particular file as subject to the "Classpath" exception as provided
ohair@2362 10 # by Oracle in the LICENSE file that accompanied this code.
ohair@1821 11 #
ohair@1821 12 # This code is distributed in the hope that it will be useful, but WITHOUT
ohair@1821 13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ohair@1821 14 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ohair@1821 15 # version 2 for more details (a copy is included in the LICENSE file that
ohair@1821 16 # accompanied this code).
ohair@1821 17 #
ohair@1821 18 # You should have received a copy of the GNU General Public License version
ohair@1821 19 # 2 along with this work; if not, write to the Free Software Foundation,
ohair@1821 20 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ohair@1821 21 #
ohair@2362 22 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@2362 23 # or visit www.oracle.com if you need additional information or have any
ohair@2362 24 # questions.
ohair@1821 25 #
ohair@1821 26
ohair@1821 27 #
ohair@1821 28 # Original Author: Tim Bell
ohair@1821 29 #
ohair@1821 30 usage() {
ohair@1821 31 echo "Starts up an Xvfb dummy X server with fvwm2 window manager"
ohair@1821 32 echo " usage:"
ohair@1821 33 echo " ${0} display_number_file"
ohair@1821 34 echo " display_number_file gets display number when it's ready"
ohair@1821 35 exit
ohair@1821 36 }
ohair@1821 37 #
ohair@1821 38 currentDir=`pwd`
ohair@1821 39 rm -f $1
ohair@1821 40 DD=":$$"
ohair@1821 41 DISPLAY=${DD}
ohair@1821 42 export DISPLAY
ohair@1821 43 cd /tmp
ohair@1821 44 #
ohair@1821 45 if [ ! -x "/usr/bin/X11/Xvfb" ]; then
ohair@1821 46 # We have Solaris-flavored X windows, and the /usr/openwin Xvfb is
ohair@1821 47 # a simple wrapper script around the Xsun server. Massage the
ohair@1821 48 # arguments: server number must be first; others are slightly
ohair@1821 49 # different.
ohair@1821 50 #
ohair@1821 51 # Also the default Visual Class (DirectColor) triggers an awt bug
ohair@1821 52 # (probably 4131533/6505852) and some tests will loop endlessly
ohair@1821 53 # when they hit the display. The workaround is:
ohair@1821 54 # 1) Ask for PseudoColor instead.
ohair@1821 55 # 2) Omit 32-bit depth.
ohair@1821 56 /usr/bin/nohup /usr/openwin/bin/Xvfb ${DISPLAY} -dev vfb screen 0 1280x1024x24 pixdepths 8 16 24 defclass PseudoColor > ${currentDir}/nohup.$$ 2>&1 &
ohair@1821 57 else
ohair@1821 58 # Linux...
ohair@1821 59 /usr/bin/nohup /usr/bin/X11/Xvfb -fbdir ${currentDir} -pixdepths 8 16 24 32 ${DISPLAY} > ${currentDir}/nohup.$$ 2>&1 &
ohair@1821 60 fi
ohair@1821 61 WM="/usr/bin/X11/fvwm2"
ohair@1821 62 if [ ! -x ${WM} ] ; then
ohair@1821 63 WM="/opt/sfw/bin/fvwm2"
ohair@1821 64 fi
ohair@1821 65 #
ohair@1821 66 # Wait for Xvfb to initialize:
ohair@1821 67 sleep 5
ohair@1821 68 #
ohair@1821 69 if [ -x "${WM}" ]; then
ohair@1821 70 # 2 JCK tests require a window manager
ohair@1821 71 # mwm fails (key name errors) and twm fails (hangs),
ohair@1821 72 # but fvwm2 works well.
ohair@1821 73 /usr/bin/nohup ${WM} -display ${DISPLAY} -replace -f /dev/null > ${currentDir}/nohup.$$ 2>&1 &
ohair@1821 74 else
ohair@1821 75 echo "Error: ${WM} not found"
ohair@1821 76 exit 1
ohair@1821 77 fi
ohair@1821 78 #
ohair@1821 79 # Wait some more to see if the xhost command gets through:
ohair@1821 80 sleep 10
ohair@1821 81 # Allow access to all - this is a brute force approach,
ohair@1821 82 # but I do not see how it could be a security problem...
ohair@1821 83 DISPLAY="${DD}" xhost +
ohair@1821 84 #
ohair@1821 85 echo "Virtual frame buffer started on ${DISPLAY}"
ohair@1821 86 echo "$$" > $1
ohair@1821 87 wait