Issue 616: moved tests to use OpenJDK and better java args

This commit is contained in:
Adrian Cole 2011-07-04 00:26:33 -07:00
parent ceaffbf103
commit 88c1f50a33
4 changed files with 20 additions and 22 deletions

View File

@ -81,10 +81,9 @@ public class RunScriptData {
exec("{md} " + jbossHome), exec("mv /usr/local/jboss-*/* " + jbossHome),//
changeStandaloneConfigToListenOnAllIPAddresses(),
exec("chmod -R oug+r+w " + jbossHome)),//
//TODO http://community.jboss.org/wiki/AS7StartupTimeShowdown
ImmutableList
.<Statement> of(interpret(new StringBuilder().append("java ").append(' ')
.append("-Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000").append(' ')
.append("-server -Xms128m -Xmx128m -XX:MaxPermSize=128m -Djava.net.preferIPv4Stack=true -XX:+UseFastAccessorMethods -XX:+TieredCompilation -Xverify:none -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000").append(' ')
.append("-Djboss.modules.system.pkgs=org.jboss.byteman").append(' ')
.append("-Dorg.jboss.boot.log.file=$JBOSS_HOME/standalone/log/boot.log").append(' ')
.append("-Dlogging.configuration=file:$JBOSS_HOME/standalone/configuration/logging.properties").append(' ')
@ -97,7 +96,7 @@ public class RunScriptData {
.toString())));
return toReturn;
}
public static Statement normalizeHostAndDNSConfig() {
return newStatementList(//
addHostnameToEtcHostsIfMissing(),//
@ -124,27 +123,26 @@ public class RunScriptData {
public static String aptInstall = "apt-get install -f -y -qq --force-yes";
public static String installAfterUpdatingIfNotPresent(String cmd) {
String aptInstallCmd = aptInstall + " " + cmd;
return String.format("which %s || (%s || (apt-get update && %s))", cmd, aptInstallCmd, aptInstallCmd);
}
public static final Statement APT_RUN_SCRIPT = newStatementList(//
normalizeHostAndDNSConfig(),//
exec(installAfterUpdatingIfNotPresent("curl")),//
installSunJDKFromWhirrIfNotPresent(),//
exec("apt-get update -qq"),
exec("which curl || " + aptInstall + " curl"),//
exec(aptInstall + " openjdk-6-jdk"),//
exec("rm -rf /var/cache/apt /usr/lib/vmware-tools"),//
exec("echo \"export PATH=\\\"\\$JAVA_HOME/bin/:\\$PATH\\\"\" >> /root/.bashrc"));
public static String yumInstall = "yum --nogpgcheck -y install";
public static final Statement YUM_RUN_SCRIPT = newStatementList(//
normalizeHostAndDNSConfig(),//
exec("which curl || yum --nogpgcheck -y install curl"),//
installSunJDKFromWhirrIfNotPresent(),//
exec("which curl || " + yumInstall + " curl"),//
exec(yumInstall + " java-1.6.0-openjdk-devel"),//
exec("echo \"export PATH=\\\"\\$JAVA_HOME/bin/:\\$PATH\\\"\" >> /root/.bashrc"));
public static final Statement ZYPPER_RUN_SCRIPT = newStatementList(//
normalizeHostAndDNSConfig(),//
exec("which curl || zypper install curl"),//
exec("(which java && java -fullversion 2>&1|egrep -q 1.6 ) || zypper install java-1.6.0-openjdk"),//
exec("zypper install java-1.6.0-openjdk"),//
exec("echo \"export PATH=\\\"\\$JAVA_HOME/bin/:\\$PATH\\\"\" >> /root/.bashrc"));
}

View File

@ -99,9 +99,9 @@ awk -v user=^${SUDO_USER:=${USER}}: -v password='crypt(randompassword)' 'BEGIN {
test -f /etc/shadow.${SUDO_USER:=${USER}} && mv /etc/shadow.${SUDO_USER:=${USER}} /etc/shadow
grep `hostname` /etc/hosts >/dev/null || awk -v hostname=`hostname` 'END { print $1" "hostname }' /proc/net/arp >> /etc/hosts
nslookup yahoo.com >/dev/null || echo nameserver 208.67.222.222 >> /etc/resolv.conf
which curl || (apt-get install -f -y -qq --force-yes curl || (apt-get update && apt-get install -f -y -qq --force-yes curl))
(which java && java -fullversion 2>&1|egrep -q 1.6 ) ||
curl -q -s -S -L --connect-timeout 10 --max-time 600 --retry 20 -X GET http://whirr.s3.amazonaws.com/0.3.0-incubating/sun/java/install |(bash)
apt-get update -qq
which curl || apt-get install -f -y -qq --force-yes curl
apt-get install -f -y -qq --force-yes openjdk-6-jdk
rm -rf /var/cache/apt /usr/lib/vmware-tools
echo "export PATH=\"\$JAVA_HOME/bin/:\$PATH\"" >> /root/.bashrc

View File

@ -81,9 +81,9 @@ END_OF_FILE
test -f /etc/shadow.${SUDO_USER:=${USER}} && mv /etc/shadow.${SUDO_USER:=${USER}} /etc/shadow
grep `hostname` /etc/hosts >/dev/null || awk -v hostname=`hostname` 'END { print $1" "hostname }' /proc/net/arp >> /etc/hosts
nslookup yahoo.com >/dev/null || echo nameserver 208.67.222.222 >> /etc/resolv.conf
which curl || (apt-get install -f -y -qq --force-yes curl || (apt-get update && apt-get install -f -y -qq --force-yes curl))
(which java && java -fullversion 2>&1|egrep -q 1.6 ) ||
curl -q -s -S -L --connect-timeout 10 --max-time 600 --retry 20 -X GET http://whirr.s3.amazonaws.com/0.3.0-incubating/sun/java/install |(bash)
apt-get update -qq
which curl || apt-get install -f -y -qq --force-yes curl
apt-get install -f -y -qq --force-yes openjdk-6-jdk
rm -rf /var/cache/apt /usr/lib/vmware-tools
echo "export PATH=\"\$JAVA_HOME/bin/:\$PATH\"" >> /root/.bashrc
iptables -I INPUT 1 -p tcp --dport 8080 -j ACCEPT
@ -114,7 +114,7 @@ END_OF_SCRIPT
# add desired commands from the user
cat >> $INSTANCE_HOME/jboss.sh <<'END_OF_SCRIPT'
cd $INSTANCE_HOME
java -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Dorg.jboss.boot.log.file=$JBOSS_HOME/standalone/log/boot.log -Dlogging.configuration=file:$JBOSS_HOME/standalone/configuration/logging.properties -jar $JBOSS_HOME/jboss-modules.jar -mp $JBOSS_HOME/modules -logmodule org.jboss.logmanager -jaxpmodule javax.xml.jaxp-provider org.jboss.as.standalone -Djboss.home.dir=$JBOSS_HOME
java -server -Xms128m -Xmx128m -XX:MaxPermSize=128m -Djava.net.preferIPv4Stack=true -XX:+UseFastAccessorMethods -XX:+TieredCompilation -Xverify:none -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Dorg.jboss.boot.log.file=$JBOSS_HOME/standalone/log/boot.log -Dlogging.configuration=file:$JBOSS_HOME/standalone/configuration/logging.properties -jar $JBOSS_HOME/jboss-modules.jar -mp $JBOSS_HOME/modules -logmodule org.jboss.logmanager -jaxpmodule javax.xml.jaxp-provider org.jboss.as.standalone -Djboss.home.dir=$JBOSS_HOME
END_OF_SCRIPT
# add runscript footer

View File

@ -78,9 +78,9 @@ END_OF_SCRIPT
cd $INSTANCE_HOME
grep `hostname` /etc/hosts >/dev/null || awk -v hostname=`hostname` 'END { print $1" "hostname }' /proc/net/arp >> /etc/hosts
nslookup yahoo.com >/dev/null || echo nameserver 208.67.222.222 >> /etc/resolv.conf
which curl || (apt-get install -f -y -qq --force-yes curl || (apt-get update && apt-get install -f -y -qq --force-yes curl))
(which java && java -fullversion 2>&1|egrep -q 1.6 ) ||
curl -q -s -S -L --connect-timeout 10 --max-time 600 --retry 20 -X GET http://whirr.s3.amazonaws.com/0.3.0-incubating/sun/java/install |(bash)
apt-get update -qq
which curl || apt-get install -f -y -qq --force-yes curl
apt-get install -f -y -qq --force-yes openjdk-6-jdk
rm -rf /var/cache/apt /usr/lib/vmware-tools
echo "export PATH=\"\$JAVA_HOME/bin/:\$PATH\"" >> /root/.bashrc