mirror of https://github.com/apache/jclouds.git
updated integration tests to use jdk7 (if present) and final version of jbossas7
This commit is contained in:
parent
ba1b7da181
commit
c322281bfc
|
@ -610,7 +610,10 @@ public abstract class BaseComputeServiceLiveTest {
|
|||
|
||||
long configureSeconds = (currentTimeMillis() - startSeconds) / 1000;
|
||||
|
||||
getAnonymousLogger().info(format("<< configured node(%s) in %ss", nodeId, configureSeconds));
|
||||
getAnonymousLogger().info(
|
||||
format("<< configured node(%s) with %s in %ss", nodeId,
|
||||
client.runScriptOnNode(nodeId, "java -fullversion", runAsRoot(false).wrapInInitScript(false)).getOutput().trim(),
|
||||
configureSeconds));
|
||||
|
||||
trackAvailabilityOfJBossProcessOnNode(new Supplier<ExecResponse>() {
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
package org.jclouds.compute;
|
||||
|
||||
import static java.lang.String.format;
|
||||
import static org.jclouds.compute.util.ComputeServiceUtils.execHttpResponse;
|
||||
import static org.jclouds.compute.util.ComputeServiceUtils.extractTargzIntoDirectory;
|
||||
import static org.jclouds.scriptbuilder.domain.Statements.appendFile;
|
||||
import static org.jclouds.scriptbuilder.domain.Statements.exec;
|
||||
|
@ -38,8 +37,8 @@ import org.jclouds.scriptbuilder.statements.login.AdminAccess;
|
|||
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableList.Builder;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -74,7 +73,7 @@ public class RunScriptData {
|
|||
installJavaAndCurl(os),//
|
||||
authorizePortsInIpTables(22, 8080),//
|
||||
extractTargzIntoDirectory(URI.create(System.getProperty("test.jboss-url",//
|
||||
"http://d37gkgjhl3prlk.cloudfront.net/jboss-7.0.0.CR1.tar.gz")), "/usr/local"),//
|
||||
"http://download.jboss.org/jbossas/7.0/jboss-as-7.0.0.Final/jboss-as-web-7.0.0.Final.tar.gz")), "/usr/local"),//
|
||||
exec("{md} " + jbossHome), exec("mv /usr/local/jboss-*/* " + jbossHome),//
|
||||
changeStandaloneConfigToListenOnAllIPAddresses(),
|
||||
exec("chmod -R oug+r+w " + jbossHome),
|
||||
|
@ -119,11 +118,6 @@ public class RunScriptData {
|
|||
return exec("nslookup yahoo.com >/dev/null || echo nameserver 208.67.222.222 >> /etc/resolv.conf");
|
||||
}
|
||||
|
||||
public static Statement installSunJDKFromWhirrIfNotPresent() {
|
||||
return newStatementList(exec("(which java && java -fullversion 2>&1|egrep -q 1.6 ) ||"),//
|
||||
execHttpResponse(URI.create("http://whirr.s3.amazonaws.com/0.3.0-incubating/sun/java/install")));
|
||||
}
|
||||
|
||||
// TODO make this a cli option
|
||||
private static Statement changeStandaloneConfigToListenOnAllIPAddresses() {
|
||||
return exec(format(
|
||||
|
@ -138,7 +132,7 @@ public class RunScriptData {
|
|||
normalizeHostAndDNSConfig(),//
|
||||
exec("apt-get update -qq"),
|
||||
exec("which curl || " + aptInstall + " curl"),//
|
||||
exec(aptInstall + " openjdk-6-jdk"),//
|
||||
exec(aptInstall + " openjdk-7-jdk" + "||" + aptInstall + " openjdk-6-jdk"),//
|
||||
exec("echo \"export PATH=\\\"\\$JAVA_HOME/bin/:\\$PATH\\\"\" >> $HOME/.bashrc"));
|
||||
|
||||
public static String yumInstall = "yum --nogpgcheck -y install";
|
||||
|
@ -146,12 +140,12 @@ public class RunScriptData {
|
|||
public static final Statement YUM_RUN_SCRIPT = newStatementList(//
|
||||
normalizeHostAndDNSConfig(),//
|
||||
exec("which curl || " + yumInstall + " curl"),//
|
||||
exec(yumInstall + " java-1.6.0-openjdk-devel"),//
|
||||
exec(yumInstall + " java-1.7.0-openjdk-devel" + "||" + yumInstall + " java-1.6.0-openjdk-devel"),//
|
||||
exec("echo \"export PATH=\\\"\\$JAVA_HOME/bin/:\\$PATH\\\"\" >> /etc/bashrc"));
|
||||
|
||||
public static final Statement ZYPPER_RUN_SCRIPT = newStatementList(//
|
||||
normalizeHostAndDNSConfig(),//
|
||||
exec("which curl || zypper install curl"),//
|
||||
exec("zypper install java-1.6.0-openjdk"),//
|
||||
exec("zypper install java-1.7.0-openjdk" + "||" + "zypper install java-1.6.0-openjdk"),//
|
||||
exec("echo \"export PATH=\\\"\\$JAVA_HOME/bin/:\\$PATH\\\"\" >> /etc/bashrc"));
|
||||
}
|
||||
|
|
|
@ -144,7 +144,7 @@ public class StubComputeServiceIntegrationTest extends BaseComputeServiceLiveTes
|
|||
expect(factory.create(new IPSocket("144.175.1.1", 22), new Credentials("root", "password1"))).andReturn(
|
||||
client1);
|
||||
expect(factory.create(new IPSocket("144.175.1.1", 22), new Credentials("web", "privateKey"))).andReturn(
|
||||
client1New).times(5);
|
||||
client1New).times(6);
|
||||
runScriptAndService(client1, client1New);
|
||||
|
||||
expect(factory.create(new IPSocket("144.175.1.2", 22), new Credentials("root", "password2"))).andReturn(
|
||||
|
@ -260,6 +260,10 @@ public class StubComputeServiceIntegrationTest extends BaseComputeServiceLiveTes
|
|||
// note we have to reconnect here, as we updated the login user.
|
||||
client.disconnect();
|
||||
|
||||
clientNew.connect();
|
||||
expect(clientNew.exec("java -fullversion\n")).andReturn(EXEC_GOOD);
|
||||
clientNew.disconnect();
|
||||
|
||||
clientNew.connect();
|
||||
scriptName = "jboss";
|
||||
clientNew.put("/tmp/init-" + scriptName, Strings2
|
||||
|
|
|
@ -101,7 +101,7 @@ grep `hostname` /etc/hosts >/dev/null || awk -v hostname=`hostname` 'END { print
|
|||
nslookup yahoo.com >/dev/null || echo nameserver 208.67.222.222 >> /etc/resolv.conf
|
||||
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
|
||||
apt-get install -f -y -qq --force-yes openjdk-7-jdk||apt-get install -f -y -qq --force-yes openjdk-6-jdk
|
||||
echo "export PATH=\"\$JAVA_HOME/bin/:\$PATH\"" >> $HOME/.bashrc
|
||||
|
||||
END_OF_SCRIPT
|
||||
|
|
|
@ -101,12 +101,12 @@ grep `hostname` /etc/hosts >/dev/null || awk -v hostname=`hostname` 'END { print
|
|||
nslookup yahoo.com >/dev/null || echo nameserver 208.67.222.222 >> /etc/resolv.conf
|
||||
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
|
||||
apt-get install -f -y -qq --force-yes openjdk-7-jdk||apt-get install -f -y -qq --force-yes openjdk-6-jdk
|
||||
echo "export PATH=\"\$JAVA_HOME/bin/:\$PATH\"" >> $HOME/.bashrc
|
||||
iptables -I INPUT 1 -p tcp --dport 22 -j ACCEPT
|
||||
iptables -I INPUT 1 -p tcp --dport 8080 -j ACCEPT
|
||||
iptables-save
|
||||
curl -q -s -S -L --connect-timeout 10 --max-time 600 --retry 20 -X GET http://d37gkgjhl3prlk.cloudfront.net/jboss-7.0.0.CR1.tar.gz |(mkdir -p /usr/local &&cd /usr/local &&tar -xpzf -)
|
||||
curl -q -s -S -L --connect-timeout 10 --max-time 600 --retry 20 -X GET http://download.jboss.org/jbossas/7.0/jboss-as-7.0.0.Final/jboss-as-web-7.0.0.Final.tar.gz |(mkdir -p /usr/local &&cd /usr/local &&tar -xpzf -)
|
||||
mkdir -p /usr/local/jboss
|
||||
mv /usr/local/jboss-*/* /usr/local/jboss
|
||||
(cd /usr/local/jboss/standalone/configuration && sed 's~inet-address value=.*/~any-address/~g' standalone.xml > standalone.xml.new && mv standalone.xml.new standalone.xml)
|
||||
|
|
|
@ -80,7 +80,7 @@ grep `hostname` /etc/hosts >/dev/null || awk -v hostname=`hostname` 'END { print
|
|||
nslookup yahoo.com >/dev/null || echo nameserver 208.67.222.222 >> /etc/resolv.conf
|
||||
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
|
||||
apt-get install -f -y -qq --force-yes openjdk-7-jdk||apt-get install -f -y -qq --force-yes openjdk-6-jdk
|
||||
echo "export PATH=\"\$JAVA_HOME/bin/:\$PATH\"" >> $HOME/.bashrc
|
||||
|
||||
END_OF_SCRIPT
|
||||
|
|
Loading…
Reference in New Issue