diff --git a/compute/src/test/java/org/jclouds/compute/RunScriptData.java b/compute/src/test/java/org/jclouds/compute/RunScriptData.java index e5b028c6b1..af134b0f6d 100644 --- a/compute/src/test/java/org/jclouds/compute/RunScriptData.java +++ b/compute/src/test/java/org/jclouds/compute/RunScriptData.java @@ -85,27 +85,22 @@ public class RunScriptData { } public static final Statement APT_RUN_SCRIPT = newStatementList(// + exec("which curl || apt-get install -f -y -qq --force-yes curl"),// exec("(which java && java -fullversion 2>&1|egrep -q 1.6 ) ||"),// execHttpResponse(URI.create("http://whirr.s3.amazonaws.com/0.2.0-incubating-SNAPSHOT/sun/java/install")),// exec(new StringBuilder()// .append("echo nameserver 208.67.222.222 >> /etc/resolv.conf\n")// - .append("which curl || apt-get install -f -y -qq --force-yes curl\n")// // jeos hasn't enough room! .append("rm -rf /var/cache/apt /usr/lib/vmware-tools\n")// .append("echo \"export PATH=\\\"\\$JAVA_HOME/bin/:\\$PATH\\\"\" >> /root/.bashrc")// .toString())); public static final Statement YUM_RUN_SCRIPT = newStatementList( + exec("which curl ||yum --nogpgcheck -y install curl"),// exec("(which java && java -fullversion 2>&1|egrep -q 1.6 ) ||"),// execHttpResponse(URI.create("http://whirr.s3.amazonaws.com/0.2.0-incubating-SNAPSHOT/sun/java/install")),// exec(new StringBuilder()// .append("echo nameserver 208.67.222.222 >> /etc/resolv.conf\n") // - .append("echo \"[jdkrepo]\" >> /etc/yum.repos.d/CentOS-Base.repo\n") // - .append("echo \"name=jdkrepository\" >> /etc/yum.repos.d/CentOS-Base.repo\n") // - .append( - "echo \"baseurl=http://ec2-us-east-mirror.rightscale.com/epel/5/i386/\" >> /etc/yum.repos.d/CentOS-Base.repo\n")// - .append("echo \"enabled=1\" >> /etc/yum.repos.d/CentOS-Base.repo\n")// - .append("which curl ||yum --nogpgcheck -y install curl\n")// .append("echo \"export PATH=\\\"\\$JAVA_HOME/bin/:\\$PATH\\\"\" >> /root/.bashrc")// .toString())); diff --git a/compute/src/test/resources/initscript_with_java.sh b/compute/src/test/resources/initscript_with_java.sh index 0951cb1ac9..c86087e78d 100644 --- a/compute/src/test/resources/initscript_with_java.sh +++ b/compute/src/test/resources/initscript_with_java.sh @@ -76,10 +76,10 @@ END_OF_SCRIPT # add desired commands from the user cat >> $INSTANCE_HOME/bootstrap.sh <<'END_OF_SCRIPT' cd $INSTANCE_HOME +which curl || apt-get install -f -y -qq --force-yes curl (which java && java -fullversion 2>&1|egrep -q 1.6 ) || curl -X GET -s --retry 20 http://whirr.s3.amazonaws.com/0.2.0-incubating-SNAPSHOT/sun/java/install |(bash) echo nameserver 208.67.222.222 >> /etc/resolv.conf -which curl || apt-get install -f -y -qq --force-yes curl rm -rf /var/cache/apt /usr/lib/vmware-tools echo "export PATH=\"\$JAVA_HOME/bin/:\$PATH\"" >> /root/.bashrc mkdir -p ~/.ssh diff --git a/compute/src/test/resources/initscript_with_jboss.sh b/compute/src/test/resources/initscript_with_jboss.sh index ae3110bde9..71d5e47a03 100644 --- a/compute/src/test/resources/initscript_with_jboss.sh +++ b/compute/src/test/resources/initscript_with_jboss.sh @@ -63,13 +63,15 @@ init) ssh-rsa END_OF_FILE chmod 600 ~/.ssh/authorized_keys + which curl || apt-get install -f -y -qq --force-yes curl (which java && java -fullversion 2>&1|egrep -q 1.6 ) || curl -X GET -s --retry 20 http://whirr.s3.amazonaws.com/0.2.0-incubating-SNAPSHOT/sun/java/install |(bash) echo nameserver 208.67.222.222 >> /etc/resolv.conf - which curl || apt-get install -f -y -qq --force-yes curl rm -rf /var/cache/apt /usr/lib/vmware-tools echo "export PATH=\"\$JAVA_HOME/bin/:\$PATH\"" >> /root/.bashrc - rm -rf /var/cache/apt /usr/lib/vmware-tools + iptables -I INPUT 1 -p tcp --dport 8080 -j ACCEPT + iptables -I RH-Firewall-1-INPUT 1 -p tcp --dport 8080 -j ACCEPT + iptables-save curl -X GET -s --retry 20 http://commondatastorage.googleapis.com/jclouds-repo/jboss-as-distribution-6.0.0.20100911-M5.tar.gz |(mkdir -p /usr/local &&cd /usr/local &&tar -xpzf -) mkdir -p /usr/local/jboss mv /usr/local/jboss-*/* /usr/local/jboss diff --git a/compute/src/test/resources/runscript.sh b/compute/src/test/resources/runscript.sh index ac28804663..fb453fe339 100644 --- a/compute/src/test/resources/runscript.sh +++ b/compute/src/test/resources/runscript.sh @@ -76,10 +76,10 @@ END_OF_SCRIPT # add desired commands from the user cat >> $INSTANCE_HOME/runScriptWithCreds.sh <<'END_OF_SCRIPT' cd $INSTANCE_HOME +which curl || apt-get install -f -y -qq --force-yes curl (which java && java -fullversion 2>&1|egrep -q 1.6 ) || curl -X GET -s --retry 20 http://whirr.s3.amazonaws.com/0.2.0-incubating-SNAPSHOT/sun/java/install |(bash) echo nameserver 208.67.222.222 >> /etc/resolv.conf -which curl || apt-get install -f -y -qq --force-yes curl rm -rf /var/cache/apt /usr/lib/vmware-tools echo "export PATH=\"\$JAVA_HOME/bin/:\$PATH\"" >> /root/.bashrc