Skip to content

Commit

Permalink
update additional failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
car-roll committed Sep 13, 2023
1 parent 3980b8d commit e895d3a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/test/java/hudson/plugins/ec2/EucalyptusTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ public void configRoundTrip() throws Exception {
HtmlPage p = wc.goTo(cloud.getUrl() + "configure");
HtmlForm f = p.getFormByName("config");
r.submit(f);
r.assertEqualBeans(cloud, r.jenkins.getCloud("test"), "name,ec2EndpointUrl,s3EndpointUrl,useInstanceProfileForCredentials,roleArn,roleSessionName,credentialsId,sshKeysCredentialsId,instanceCap,templates");
r.assertEqualBeans(cloud, r.jenkins.getCloud("test"), "ec2EndpointUrl,s3EndpointUrl,useInstanceProfileForCredentials,roleArn,roleSessionName,credentialsId,sshKeysCredentialsId,instanceCap,templates");
}
}
17 changes: 7 additions & 10 deletions src/test/java/hudson/plugins/ec2/SlaveTemplateTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,13 @@
import hudson.model.Node;
import hudson.plugins.ec2.SlaveTemplate.ProvisionOptions;
import hudson.plugins.ec2.util.MinimumNumberOfInstancesTimeRangeConfig;
import org.htmlunit.html.HtmlForm;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.JenkinsRule;
import org.mockito.ArgumentCaptor;
import org.xml.sax.SAXException;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.EnumSet;
Expand Down Expand Up @@ -110,7 +107,7 @@ public void testConfigRoundtrip() throws Exception {
AmazonEC2Cloud ac = new AmazonEC2Cloud("us-east-1", false, "abc", "us-east-1", "ghi", "3", templates, null, null);
r.jenkins.clouds.add(ac);

r.submit(getConfigForm(ac));
r.submit(r.createWebClient().goTo(ac.getUrl() + "configure").getFormByName("config"));
SlaveTemplate received = ((EC2Cloud) r.jenkins.clouds.iterator().next()).getTemplate(description);
r.assertEqualBeans(orig, received, "ami,zone,description,remoteFS,type,javaPath,jvmopts,stopOnTerminate,securityGroups,subnetId,tags,iamInstanceProfile,useEphemeralDevices,useDedicatedTenancy,connectionStrategy,hostKeyVerificationStrategy,tenancy,ebsEncryptRootVolume");
// For already existing strategies, the default is this one
Expand All @@ -132,7 +129,7 @@ public void testConfigRoundtripWithCustomSSHHostKeyVerificationStrategy() throws
AmazonEC2Cloud ac = new AmazonEC2Cloud("us-east-1", false, "abc", "us-east-1", "ghi", "3", templates, null, null);
r.jenkins.clouds.add(ac);

r.submit(getConfigForm(ac));
r.submit(r.createWebClient().goTo(ac.getUrl() + "configure").getFormByName("config"));
SlaveTemplate received = ((EC2Cloud) r.jenkins.clouds.iterator().next()).getTemplate(description);
r.assertEqualBeans(orig, received, "ami,zone,description,remoteFS,type,javaPath,jvmopts,stopOnTerminate,securityGroups,subnetId,useEphemeralDevices,useDedicatedTenancy,connectionStrategy,hostKeyVerificationStrategy");
assertEquals(STRATEGY_TO_CHECK, received.getHostKeyVerificationStrategy());
Expand Down Expand Up @@ -161,7 +158,7 @@ public void testConfigWithSpotBidPrice() throws Exception {
AmazonEC2Cloud ac = new AmazonEC2Cloud("us-east-1", false, "abc", "us-east-1", "ghi", "3", templates, null, null);
r.jenkins.clouds.add(ac);

r.submit(getConfigForm(ac));
r.submit(r.createWebClient().goTo(ac.getUrl() + "configure").getFormByName("config"));
SlaveTemplate received = ((EC2Cloud) r.jenkins.clouds.iterator().next()).getTemplate(description);
r.assertEqualBeans(orig, received, "ami,zone,spotConfig,description,remoteFS,type,javaPath,jvmopts,stopOnTerminate,securityGroups,subnetId,tags,usePrivateDnsName");
}
Expand All @@ -185,7 +182,7 @@ public void testSpotConfigWithoutBidPrice() throws Exception {
AmazonEC2Cloud ac = new AmazonEC2Cloud("us-east-1", false, "abc", "us-east-1", "ghi", "3", templates, null, null);
r.jenkins.clouds.add(ac);

r.submit(getConfigForm(ac));
r.submit(r.createWebClient().goTo(ac.getUrl() + "configure").getFormByName("config"));
SlaveTemplate received = ((EC2Cloud) r.jenkins.clouds.iterator().next()).getTemplate(description);
r.assertEqualBeans(orig, received, "ami,zone,spotConfig,description,remoteFS,type,javaPath,jvmopts,stopOnTerminate,securityGroups,subnetId,tags,usePrivateDnsName");
}
Expand All @@ -202,7 +199,7 @@ public void testWindowsConfigRoundTrip() throws Exception {
AmazonEC2Cloud ac = new AmazonEC2Cloud("us-east-1", false, "abc", "us-east-1", "ghi", "3", templates, null, null);
r.jenkins.clouds.add(ac);

r.submit(getConfigForm(ac));
r.submit(r.createWebClient().goTo(ac.getUrl() + "configure").getFormByName("config"));
SlaveTemplate received = ((EC2Cloud) r.jenkins.clouds.iterator().next()).getTemplate(description);
assertEquals(orig.getAdminPassword(), received.getAdminPassword());
assertEquals(orig.amiType, received.amiType);
Expand All @@ -220,7 +217,7 @@ public void testUnixConfigRoundTrip() throws Exception {
AmazonEC2Cloud ac = new AmazonEC2Cloud("us-east-1", false, "abc", "us-east-1", "ghi", "3", templates, null, null);
r.jenkins.clouds.add(ac);

r.submit(getConfigForm(ac));
r.submit(r.createWebClient().goTo(ac.getUrl() + "configure").getFormByName("config"));
SlaveTemplate received = ((EC2Cloud) r.jenkins.clouds.iterator().next()).getTemplate(description);
r.assertEqualBeans(orig, received, "amiType");
}
Expand Down Expand Up @@ -425,7 +422,7 @@ public void testMacConfig() throws Exception {
AmazonEC2Cloud ac = new AmazonEC2Cloud("us-east-1", false, "abc", "us-east-1", "ghi", "3", templates, null, null);
r.jenkins.clouds.add(ac);

r.submit(getConfigForm(ac));
r.submit(r.createWebClient().goTo(ac.getUrl() + "configure").getFormByName("config"));
SlaveTemplate received = ((EC2Cloud) r.jenkins.clouds.iterator().next()).getTemplate(description);
r.assertEqualBeans(orig, received, "type,amiType");
}
Expand Down

0 comments on commit e895d3a

Please sign in to comment.