#!/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=/root/ovirt/selenium/selenium-server-1.0/selenium-server.jar FIREFOX_PROFILE_DIR=/root/ovirt/selenium-firefox-profile/ PID_FILE=/var/run/selenium.pid RETVAL=0 . /etc/init.d/functions start() { echo -n "Starting Selenium" export DISPLAY=:5 $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 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