Issue 29: broke some tests

git-svn-id: http://jclouds.googlecode.com/svn/trunk@2541 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
adrian.f.cole 2009-12-30 06:03:57 +00:00
parent 18201f319f
commit 0f71237ba8
12 changed files with 44 additions and 23 deletions

View File

@ -222,7 +222,7 @@ public class AMIAsyncClientTest extends RestClientTest<AMIAsyncClient> {
public void testRegisterImageBackedByEBS() throws SecurityException, NoSuchMethodException,
IOException {
Method method = AMIAsyncClient.class.getMethod("registerImageBackedByEbsInRegion",
Method method = AMIAsyncClient.class.getMethod("registerUnixImageBackedByEbsInRegion",
Region.class, String.class, String.class, Array.newInstance(
RegisterImageBackedByEbsOptions.class, 0).getClass());
GeneratedHttpRequest<AMIAsyncClient> httpMethod = processor.createRequest(method,
@ -243,7 +243,7 @@ public class AMIAsyncClientTest extends RestClientTest<AMIAsyncClient> {
public void testRegisterImageBackedByEBSOptions() throws SecurityException,
NoSuchMethodException, IOException {
Method method = AMIAsyncClient.class.getMethod("registerImageBackedByEbsInRegion",
Method method = AMIAsyncClient.class.getMethod("registerUnixImageBackedByEbsInRegion",
Region.class, String.class, String.class, Array.newInstance(
RegisterImageBackedByEbsOptions.class, 0).getClass());
GeneratedHttpRequest<AMIAsyncClient> httpMethod = processor.createRequest(method,

View File

@ -39,6 +39,7 @@ import org.jclouds.aws.ec2.EC2;
import org.jclouds.aws.ec2.domain.AvailabilityZone;
import org.jclouds.aws.ec2.domain.Region;
import org.jclouds.aws.ec2.filters.FormSigner;
import org.jclouds.aws.ec2.functions.ReturnVoidOnVolumeAvailable;
import org.jclouds.aws.ec2.options.CreateSnapshotOptions;
import org.jclouds.aws.ec2.options.DescribeSnapshotsOptions;
import org.jclouds.aws.ec2.options.DetachVolumeOptions;
@ -202,9 +203,9 @@ public class ElasticBlockStoreAsyncClientTest extends RestClientTest<ElasticBloc
assertPayloadEquals(httpMethod,
"Version=2009-11-30&Action=DetachVolume&Force=false&VolumeId=id");
assertResponseParserClassEquals(method, httpMethod, ParseSax.class);
assertSaxResponseParserClassEquals(method, AttachmentHandler.class);
assertExceptionParserClassEquals(method, null);
assertResponseParserClassEquals(method, httpMethod, ReturnVoidIf2xx.class);
assertSaxResponseParserClassEquals(method, null);
assertExceptionParserClassEquals(method, ReturnVoidOnVolumeAvailable.class);
checkFilters(httpMethod);
}
@ -225,9 +226,9 @@ public class ElasticBlockStoreAsyncClientTest extends RestClientTest<ElasticBloc
httpMethod,
"Version=2009-11-30&Action=DetachVolume&Force=true&VolumeId=id&InstanceId=instanceId&Device=%2Fdevice");
assertResponseParserClassEquals(method, httpMethod, ParseSax.class);
assertSaxResponseParserClassEquals(method, AttachmentHandler.class);
assertExceptionParserClassEquals(method, null);
assertResponseParserClassEquals(method, httpMethod, ReturnVoidIf2xx.class);
assertSaxResponseParserClassEquals(method, null);
assertExceptionParserClassEquals(method, ReturnVoidOnVolumeAvailable.class);
checkFilters(httpMethod);
}

View File

@ -153,7 +153,9 @@ public class CreateRunScript implements Statement {
statements.add(appendToFile(line, runScript, family));
}
statements.add(new AddTitleToFile(instanceName, runScript));
statements.add(appendToFile(Utils.writeZeroPath(family), runScript, family));
statements
.add(appendToFile(Utils.writeZeroPath(family).replace(ShellToken.LF.to(family), ""),
runScript, family));
statements.add(new AddExportToFile("instanceName", instanceName, runScript));
for (String export : exports) {
statements.add(new AddExportToFile(export, Utils.replaceTokens("{varl}"

View File

@ -76,7 +76,7 @@ public class InitBuilderTest {
"yes| mkfs -t ext3 {varl}EBS_DEVICE{varr} 2>&-",
"mount {varl}EBS_DEVICE{varr} {varl}EBS_MOUNT_POINT{varr}",
"echo making a local working copy of the boot disk",
"rsync -ax --exclude=/mnt/* --exclude=/proc/* --exclude=/tmp/* --exclude=/dev/log / {varl}IMAGE_DIR{varr}",
"rsync -ax --exclude /ubuntu/.bash_history --exclude /home/*/.bash_history --exclude /etc/ssh/ssh_host_* --exclude /etc/ssh/moduli --exclude /etc/udev/rules.d/*persistent-net.rules --exclude /var/lib/ec2/* --exclude=/mnt/* --exclude=/proc/* --exclude=/tmp/* --exclude=/dev/log / {varl}IMAGE_DIR{varr}",
"echo preparing the local working copy",
"touch {varl}IMAGE_DIR{varr}/etc/init.d/ec2-init-user-data",
"echo copying the local working copy to the ebs mount",

View File

@ -9,7 +9,7 @@ function abort {
}
function default {
export INSTANCE_NAME="mkebsboot"
export INSTANCE_HOME="/mnt/tmp"
export INSTANCE_HOME="/tmp"
export LOG_DIR="/tmp/logs"
return 0
}
@ -54,7 +54,7 @@ function forget {
}
return 0
}
export PATH=/usr/ucb/bin:/bin:/usr/bin:/usr/sbin
export PATH=/usr/ucb/bin:/bin:/sbin:/usr/bin:/usr/sbin
case $1 in
init)
default || exit 1
@ -66,22 +66,33 @@ init)
echo 'shopt -s xpg_echo'>>$INSTANCE_HOME/mkebsboot.sh
echo 'shopt -s expand_aliases'>>$INSTANCE_HOME/mkebsboot.sh
echo "PROMPT_COMMAND='echo -ne \"\033]0;mkebsboot\007\"'">>$INSTANCE_HOME/mkebsboot.sh
echo 'export PATH=/usr/ucb/bin:/bin:/sbin:/usr/bin:/usr/sbin'>>$INSTANCE_HOME/mkebsboot.sh
echo "export INSTANCE_NAME='mkebsboot'">>$INSTANCE_HOME/mkebsboot.sh
echo "export IMAGE_DIR='$IMAGE_DIR'">>$INSTANCE_HOME/mkebsboot.sh
echo "export EBS_DEVICE='$EBS_DEVICE'">>$INSTANCE_HOME/mkebsboot.sh
echo "export EBS_MOUNT_POINT='$EBS_MOUNT_POINT'">>$INSTANCE_HOME/mkebsboot.sh
echo "export INSTANCE_NAME='$INSTANCE_NAME'">>$INSTANCE_HOME/mkebsboot.sh
echo "export INSTANCE_HOME='$INSTANCE_HOME'">>$INSTANCE_HOME/mkebsboot.sh
echo "export LOG_DIR='$LOG_DIR'">>$INSTANCE_HOME/mkebsboot.sh
echo 'cd $INSTANCE_HOME'>>$INSTANCE_HOME/mkebsboot.sh
echo 'echo creating a filesystem and mounting the ebs volume'>>$INSTANCE_HOME/mkebsboot.sh
echo 'mkdir -p $EBS_MOUNT_POINT'>>$INSTANCE_HOME/mkebsboot.sh
echo 'mkfs.ext3 $EBS_DEVICE'>>$INSTANCE_HOME/mkebsboot.sh
echo 'mkdir -p $IMAGE_DIR $EBS_MOUNT_POINT'>>$INSTANCE_HOME/mkebsboot.sh
echo 'rm -rf $IMAGE_DIR/*'>>$INSTANCE_HOME/mkebsboot.sh
echo 'yes| mkfs -t ext3 $EBS_DEVICE 2>&-'>>$INSTANCE_HOME/mkebsboot.sh
echo 'mount $EBS_DEVICE $EBS_MOUNT_POINT'>>$INSTANCE_HOME/mkebsboot.sh
echo 'echo making a local working copy of the boot disk'>>$INSTANCE_HOME/mkebsboot.sh
echo 'rsync --stats -av --exclude /root/.bash_history --exclude /home/*/.bash_history --exclude /etc/ssh/ssh_host_* --exclude /etc/ssh/moduli --exclude /etc/udev/rules.d/*persistent-net.rules --exclude /var/lib/ec2/* --exclude=/mnt/* --exclude=/proc/* --exclude=/tmp/* / $IMAGE_DIR'>>$INSTANCE_HOME/mkebsboot.sh
echo 'rsync -ax --exclude /ubuntu/.bash_history --exclude /home/*/.bash_history --exclude /etc/ssh/ssh_host_* --exclude /etc/ssh/moduli --exclude /etc/udev/rules.d/*persistent-net.rules --exclude /var/lib/ec2/* --exclude=/mnt/* --exclude=/proc/* --exclude=/tmp/* --exclude=/dev/log / $IMAGE_DIR'>>$INSTANCE_HOME/mkebsboot.sh
echo 'echo preparing the local working copy'>>$INSTANCE_HOME/mkebsboot.sh
echo 'touch $IMAGE_DIR/etc/init.d/ec2-init-user-data'>>$INSTANCE_HOME/mkebsboot.sh
echo 'echo copying the local working copy to the ebs mount'>>$INSTANCE_HOME/mkebsboot.sh
echo 'tar -cSf - -C ./ . | tar xvf - -C $EBS_MOUNT_POINT'>>$INSTANCE_HOME/mkebsboot.sh
echo 'unmount $EBS_MOUNT_POINT'>>$INSTANCE_HOME/mkebsboot.sh
echo 'cd $IMAGE_DIR'>>$INSTANCE_HOME/mkebsboot.sh
echo 'tar -cSf - * | tar xf - -C $EBS_MOUNT_POINT'>>$INSTANCE_HOME/mkebsboot.sh
echo 'echo size of ebs'>>$INSTANCE_HOME/mkebsboot.sh
echo 'du -sk $EBS_MOUNT_POINT'>>$INSTANCE_HOME/mkebsboot.sh
echo 'echo size of source'>>$INSTANCE_HOME/mkebsboot.sh
echo 'du -sk $IMAGE_DIR'>>$INSTANCE_HOME/mkebsboot.sh
echo 'rm -rf $IMAGE_DIR/*'>>$INSTANCE_HOME/mkebsboot.sh
echo 'umount $EBS_MOUNT_POINT'>>$INSTANCE_HOME/mkebsboot.sh
echo 'echo ----COMPLETE----'>>$INSTANCE_HOME/mkebsboot.sh
echo 'exit 0'>>$INSTANCE_HOME/mkebsboot.sh
chmod u+x $INSTANCE_HOME/mkebsboot.sh

View File

@ -22,7 +22,7 @@ function findPid {
return 1
}
}
export PATH=/usr/ucb/bin:/bin:/usr/bin:/usr/sbin
export PATH=/usr/ucb/bin:/bin:/sbin:/usr/bin:/usr/sbin
findPid $@ || exit 1
echo $FOUND_PID
exit 0

View File

@ -73,8 +73,12 @@ goto CASE_%1
del %INSTANCE_HOME%\mkebsboot.cmd 2>NUL
echo @echo off>>%INSTANCE_HOME%\mkebsboot.cmd
echo title mkebsboot>>%INSTANCE_HOME%\mkebsboot.cmd
echo set PATH=c:\windows\;C:\windows\system32;c:\windows\system32\wbem>>%INSTANCE_HOME%\mkebsboot.cmd
echo set INSTANCE_NAME=mkebsboot>>%INSTANCE_HOME%\mkebsboot.cmd
echo set TMP_DIR=%TMP_DIR%>>%INSTANCE_HOME%\mkebsboot.cmd
echo set INSTANCE_NAME=%INSTANCE_NAME%>>%INSTANCE_HOME%\mkebsboot.cmd
echo set INSTANCE_HOME=%INSTANCE_HOME%>>%INSTANCE_HOME%\mkebsboot.cmd
echo set LOG_DIR=%LOG_DIR%>>%INSTANCE_HOME%\mkebsboot.cmd
echo cd /d %%INSTANCE_HOME%%>>%INSTANCE_HOME%\mkebsboot.cmd
echo find />>%INSTANCE_HOME%\mkebsboot.cmd
echo exit /b 0 >>%INSTANCE_HOME%\mkebsboot.cmd

View File

@ -1,5 +1,5 @@
#!/bin/bash
set -u
set +u
shopt -s xpg_echo
shopt -s expand_aliases
unset PATH JAVA_HOME LD_LIBRARY_PATH
@ -52,7 +52,7 @@ function forget {
}
return 0
}
export PATH=/usr/ucb/bin:/bin:/usr/bin:/usr/sbin
export PATH=/usr/ucb/bin:/bin:/sbin:/usr/bin:/usr/sbin
case $1 in
init)
default || exit 1
@ -60,10 +60,11 @@ init)
mkdir -p $INSTANCE_HOME
rm $INSTANCE_HOME/mkebsboot.sh 2>&-
echo '#!/bin/bash'>>$INSTANCE_HOME/mkebsboot.sh
echo 'set -u'>>$INSTANCE_HOME/mkebsboot.sh
echo 'set +u'>>$INSTANCE_HOME/mkebsboot.sh
echo 'shopt -s xpg_echo'>>$INSTANCE_HOME/mkebsboot.sh
echo 'shopt -s expand_aliases'>>$INSTANCE_HOME/mkebsboot.sh
echo "PROMPT_COMMAND='echo -ne \"\033]0;mkebsboot\007\"'">>$INSTANCE_HOME/mkebsboot.sh
echo 'export PATH=/usr/ucb/bin:/bin:/sbin:/usr/bin:/usr/sbin'>>$INSTANCE_HOME/mkebsboot.sh
echo "export INSTANCE_NAME='mkebsboot'">>$INSTANCE_HOME/mkebsboot.sh
echo "export TMP_DIR='$TMP_DIR'">>$INSTANCE_HOME/mkebsboot.sh
echo "export INSTANCE_NAME='$INSTANCE_NAME'">>$INSTANCE_HOME/mkebsboot.sh

View File

@ -2,6 +2,7 @@ md %TEMP%\%USERNAME%\scripttest
del %TEMP%\%USERNAME%\scripttest\yahooprod.cmd 2>NUL
echo @echo off>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd
echo title yahooprod>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd
echo set PATH=c:\windows\;C:\windows\system32;c:\windows\system32\wbem>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd
echo set INSTANCE_NAME=yahooprod>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd
echo set JAVA_HOME=%JAVA_HOME%>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd
echo cd /d %TEMP%\%USERNAME%\scripttest>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd

View File

@ -5,6 +5,7 @@ echo 'set +u'>>/tmp/$USER/scripttest/yahooprod.sh
echo 'shopt -s xpg_echo'>>/tmp/$USER/scripttest/yahooprod.sh
echo 'shopt -s expand_aliases'>>/tmp/$USER/scripttest/yahooprod.sh
echo "PROMPT_COMMAND='echo -ne \"\033]0;yahooprod\007\"'">>/tmp/$USER/scripttest/yahooprod.sh
echo 'export PATH=/usr/ucb/bin:/bin:/sbin:/usr/bin:/usr/sbin'>>/tmp/$USER/scripttest/yahooprod.sh
echo "export INSTANCE_NAME='yahooprod'">>/tmp/$USER/scripttest/yahooprod.sh
echo "export JAVA_HOME='$JAVA_HOME'">>/tmp/$USER/scripttest/yahooprod.sh
echo 'cd /tmp/$USER/scripttest'>>/tmp/$USER/scripttest/yahooprod.sh

View File

@ -11,7 +11,7 @@ function default {
export RUNTIME="Moo"
return 0
}
export PATH=/usr/ucb/bin:/bin:/usr/bin:/usr/sbin
export PATH=/usr/ucb/bin:/bin:/sbin:/usr/bin:/usr/sbin
case $1 in
start)
default || exit 1

View File

@ -22,7 +22,7 @@ function findPid {
return 1
}
}
export PATH=/usr/ucb/bin:/bin:/usr/bin:/usr/sbin
export PATH=/usr/ucb/bin:/bin:/sbin:/usr/bin:/usr/sbin
findPid $@ || exit 1
[ -n "$FOUND_PID" ] && {
echo stopping $FOUND_PID