updated test in step with vmware tools

This commit is contained in:
Adrian Cole 2010-11-07 01:58:07 +01:00
parent d94ca19941
commit fff4ca4896
1 changed files with 11 additions and 10 deletions

View File

@ -73,11 +73,9 @@ public class VCloudGuestCustomizationLiveTest {
protected void setupCredentials() { protected void setupCredentials() {
identity = checkNotNull(System.getProperty("test." + provider + ".identity"), "test." + provider + ".identity"); identity = checkNotNull(System.getProperty("test." + provider + ".identity"), "test." + provider + ".identity");
credential = checkNotNull(System.getProperty("test." + provider + ".credential"), "test." + provider credential = System.getProperty("test." + provider + ".credential");
+ ".credential"); endpoint = System.getProperty("test." + provider + ".endpoint");
endpoint = checkNotNull(System.getProperty("test." + provider + ".endpoint"), "test." + provider + ".endpoint"); apiversion = System.getProperty("test." + provider + ".apiversion");
apiversion = checkNotNull(System.getProperty("test." + provider + ".apiversion"), "test." + provider
+ ".apiversion");
} }
protected Properties setupProperties() { protected Properties setupProperties() {
@ -85,9 +83,12 @@ public class VCloudGuestCustomizationLiveTest {
overrides.setProperty(Constants.PROPERTY_TRUST_ALL_CERTS, "true"); overrides.setProperty(Constants.PROPERTY_TRUST_ALL_CERTS, "true");
overrides.setProperty(Constants.PROPERTY_RELAX_HOSTNAME, "true"); overrides.setProperty(Constants.PROPERTY_RELAX_HOSTNAME, "true");
overrides.setProperty(provider + ".identity", identity); overrides.setProperty(provider + ".identity", identity);
overrides.setProperty(provider + ".credential", credential); if (credential != null)
overrides.setProperty(provider + ".endpoint", endpoint); overrides.setProperty(provider + ".credential", credential);
overrides.setProperty(provider + ".apiversion", apiversion); if (endpoint != null)
overrides.setProperty(provider + ".endpoint", endpoint);
if (apiversion != null)
overrides.setProperty(provider + ".apiversion", apiversion);
return overrides; return overrides;
} }
@ -97,7 +98,7 @@ public class VCloudGuestCustomizationLiveTest {
Properties overrides = setupProperties(); Properties overrides = setupProperties();
client = new ComputeServiceContextFactory().createContext(provider, client = new ComputeServiceContextFactory().createContext(provider,
ImmutableSet.<Module> of(new Log4JLoggingModule()), overrides).getComputeService(); ImmutableSet.<Module> of(new Log4JLoggingModule()), overrides).getComputeService();
socketTester = new RetryablePredicate<IPSocket>(new InetSocketAddressConnect(), 60, 1, TimeUnit.SECONDS); socketTester = new RetryablePredicate<IPSocket>(new InetSocketAddressConnect(), 60, 1, TimeUnit.SECONDS);
sshFactory = Guice.createInjector(getSshModule()).getInstance(Factory.class); sshFactory = Guice.createInjector(getSshModule()).getInstance(Factory.class);
} }
@ -128,7 +129,7 @@ public class VCloudGuestCustomizationLiveTest {
try { try {
ssh.connect(); ssh.connect();
assertEquals(ssh.exec(PARSE_VMTOOLSD).getOutput(), script); assertEquals(ssh.exec(PARSE_VMTOOLSD).getOutput(), script.replaceAll("\n", "\r\n"));
assertEquals(ssh.exec("cat /root/foo.txt").getOutput().trim(), "I love candy"); assertEquals(ssh.exec("cat /root/foo.txt").getOutput().trim(), "I love candy");
} finally { } finally {