[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Ovirt-devel] oVirt / Selenium Update



Alan Pevec wrote:
Mohammed Morsi wrote:
check. Also attached is the selenium server init script with a few additional tweaks. Both this script and autobuild now require a few selenium related components on the host system, under /root/ovirt

ok for now, but selenium Fedora RPM is now our TODO
So don't check-in that selenium init script in ovirt repo, assume it's on autobuild machine.

ACK for ovirt-selenium3.patch

Patch committed. Attached is the updated selenium init script, including the DISPLAY check / failure if not found.

 -Mo
#!/bin/bash
#
#
#  selenium   startup script for selenium
#
#  make sure in the specified firefox profile, the prefs.js file contains:
#    user_pref("network.http.phishy-userpass-length", 255);
#    user_pref("browser.sessionstore.enabled", false);
#
# chkconfig: - 97 03
# description: Selenium Remote Control server use to launch Selenium tests

#[ -r /etc/sysconfig/selenium ] && . /etc/sysconfig/selenium

JAVA_PROG=java
SELENIUM_JAR=/var/selenium/selenium-server.jar
FIREFOX_PROFILE_DIR=/var/selenium/selenium-firefox-profile/

PID_FILE=/var/run/selenium.pid

RETVAL=0

. /etc/init.d/functions

start() {
   echo -n "Starting Selenium"

   xvncstatus=`ps ax -o args | grep Xvnc | grep -v grep`
   if [ "$xvncstatus" == "" ]; then
      echo "No valid display found"
      exit 1
   fi
   xvncstatus=${xvncstatus#*:}
   display=${xvncstatus%% *}
   export DISPLAY=:$display

   $JAVA_PROG -jar $SELENIUM_JAR -firefoxProfileTemplate $FIREFOX_PROFILE_DIR&
   RETVAL=$?
   echo $! > $PID_FILE
   if [ $RETVAL -eq 0 ]; then
       echo_success
       echo
   else
       echo_failure
       echo
   fi
}

stop() {
  echo -n "Stopping Selenium"
  PID=`cat $PID_FILE`
  kill $PID
  RETVAL=$?
  rm -f $PID_FILE
}

case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    restart)
        stop
        start
       ;;
    *)
      echo "Usage: selenium {start|stop|restart}"
      exit 1
  ;;
esac

exit $RETVAL

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]