Skip to content

Check if IT simplification works now in jenkins-ci infra #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 57 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
d43e8fb
Check if IT simplification works now in jenkins-ci infra
fbelzunc Jun 29, 2021
2ff592e
Remove the profile since tests do not seem to be triggering
fbelzunc Jun 29, 2021
3d25f82
Update Jenkinsfile again
fbelzunc Jun 29, 2021
7a9a66d
And once more
fbelzunc Jun 29, 2021
081f713
Create noWindows profile
fbelzunc Jun 29, 2021
693b00e
Try to run test in serial mode so there are not bind issues
fbelzunc Jun 29, 2021
829c6b7
test without simplification
fbelzunc Jun 29, 2021
53c95f5
and test again
fbelzunc Jun 29, 2021
efa1834
and re test again
fbelzunc Jun 29, 2021
ca840c1
modify pom and re-test
fbelzunc Jun 29, 2021
dfb0d62
re-run
fbelzunc Jun 29, 2021
275026f
test again
fbelzunc Jun 29, 2021
189d4e1
bump again
fbelzunc Jun 29, 2021
c5b8bef
bump last time for today
fbelzunc Jun 29, 2021
e70b348
build again
fbelzunc Jun 29, 2021
a576e97
build again
fbelzunc Jun 29, 2021
8cbb0ac
build
fbelzunc Jun 29, 2021
780203b
more builds
fbelzunc Jun 29, 2021
0c1f165
bump build
fbelzunc Jun 29, 2021
f02bb85
again
fbelzunc Jun 29, 2021
a332737
build
fbelzunc Jun 29, 2021
884b51b
build
fbelzunc Jun 29, 2021
24f586c
build
fbelzunc Jun 29, 2021
9bc1baa
another one
fbelzunc Jun 29, 2021
347fb60
bump
fbelzunc Jun 29, 2021
f8989c9
bump again
fbelzunc Jun 29, 2021
26ee82f
bump
fbelzunc Jun 29, 2021
3e710c9
bump
fbelzunc Jun 29, 2021
710dc3a
bump
fbelzunc Jun 29, 2021
ad9237a
bump
fbelzunc Jun 29, 2021
c2cde0c
increase timeout
fbelzunc Jun 29, 2021
e1220eb
bump
fbelzunc Jun 29, 2021
9b31ab2
bump
fbelzunc Jun 29, 2021
40a968f
again
fbelzunc Jun 29, 2021
381a4d1
bump
fbelzunc Jun 29, 2021
16305dc
bump
fbelzunc Jun 29, 2021
49a71c8
bump
fbelzunc Jun 29, 2021
cace6cb
bump
fbelzunc Jun 29, 2021
b9a41b3
bump
fbelzunc Jun 29, 2021
14be6ee
bump the good one
fbelzunc Jun 29, 2021
6680398
bump
fbelzunc Jun 30, 2021
16400f1
bump again
fbelzunc Jun 30, 2021
b62c714
remove space to bump
fbelzunc Jun 30, 2021
4a14149
bump
fbelzunc Jun 30, 2021
2949808
bump
fbelzunc Jun 30, 2021
28071a4
bump again
fbelzunc Jun 30, 2021
212872d
bump again
fbelzunc Jun 30, 2021
9f0d80d
bump build
fbelzunc Jun 30, 2021
893256f
bump
fbelzunc Jun 30, 2021
34c9b85
bump a new build
fbelzunc Jun 30, 2021
effb516
bump build increasing timeout
fbelzunc Jun 30, 2021
e59bb23
bump build
fbelzunc Jun 30, 2021
e78533b
bump full build
fbelzunc Jun 30, 2021
b220d35
bump full tests
fbelzunc Jun 30, 2021
5686679
bump
fbelzunc Jul 1, 2021
d95b532
bump again
fbelzunc Jul 1, 2021
a3d864d
rerbump
fbelzunc Jul 1, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
buildPlugin()
buildPlugin(platforms: ['linux'])

node('docker') {
stage('checkout') {
Expand All @@ -8,7 +8,9 @@ node('docker') {
sh 'docker pull fbelzunc/ad-build-container-with-docker-fixtures'
}
stage('maven') {
sh 'docker run --add-host=samdom.example.com:127.0.0.1 -v /var/lib/docker --privileged --dns=127.0.0.1 --dns=8.8.8.8 -v $WORKSPACE:/project fbelzunc/ad-build-container-with-docker-fixtures clean install -P \'!noIT\''
sh '''
docker run --add-host=samdom.example.com:127.0.0.1 -v /var/lib/docker --privileged --dns=127.0.0.1 --dns=8.8.8.8 -v $WORKSPACE:/project fbelzunc/ad-build-container-with-docker-fixtures package -Djenkins.test.timeout=6000
'''
}
stage('surefire-report') {
junit 'target/surefire-reports/*.xml'
Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!--<forkCount>2C</forkCount>-->
<!--<reuseForks>false</reuseForks>-->
<forkCount>1</forkCount>
<reuseForks>false</reuseForks>
<argLine>-Xms2048m -Xmx2048m</argLine>
</configuration>
</plugin>
Expand All @@ -184,9 +184,9 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/TheFlintstonesTest.java</exclude>
<exclude>**/EntoEndUserCacheLookupEnabledTest.java</exclude>
<exclude>**/EntoEndUserCacheLookupDisabledTest.java</exclude>
<!-- <exclude>**/TheFlintstonesTest.java</exclude>-->
<!-- <exclude>**/EntoEndUserCacheLookupEnabledTest.java</exclude>-->
<!-- <exclude>**/EntoEndUserCacheLookupDisabledTest.java</exclude>-->
<exclude>**/WindowsAdsiModeUserCacheDisabledTest.java</exclude>
<exclude>**/WindowsAdsiModeUserCacheEnabledTest.java</exclude>
</excludes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.junit.Test;
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.LoggerRule;
import org.jvnet.hudson.test.recipes.WithTimeout;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -73,6 +74,7 @@ public void customSingleADSetup(ActiveDirectoryDomain activeDirectoryDomain, Str
}

@Test
@WithTimeout(6000)
public void testEndtoEndManagerDnCacheEnabled() throws Exception {
List<String> messages;
l.record(hudson.plugins.active_directory.ActiveDirectoryUnixAuthenticationProvider.class, Level.FINE).capture(20);
Expand Down Expand Up @@ -109,6 +111,7 @@ public void testEndtoEndManagerDnCacheEnabled() throws Exception {
}

@Test
@WithTimeout(6000)
public void testEndtoEndManagerDnCacheDisabled() throws Exception {
List<String> messages;
l.record(hudson.plugins.active_directory.ActiveDirectoryUnixAuthenticationProvider.class, Level.FINE).capture(20);
Expand Down Expand Up @@ -140,7 +143,6 @@ public void testEndtoEndManagerDnCacheDisabled() throws Exception {
// Try to login as Fred with correct password
wc.login("Fred", "ia4uV1EeKait");
assertThat(wc.goToXml("whoAmI/api/xml").asXml().replaceAll("\\s+", ""), containsString("<name>Fred</name>"));

}

@DockerFixture(id = "ad-dc", ports= {135, 138, 445, 39, 464, 389, 3268}, udpPorts = {53}, matchHostPorts = true, dockerfileFolder="docker/TheFlintstonesTest/TheFlintstones")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.junit.Test;
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.LoggerRule;
import org.jvnet.hudson.test.recipes.WithTimeout;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -78,9 +79,12 @@ public void customSingleADSetup(ActiveDirectoryDomain activeDirectoryDomain, Str

ActiveDirectorySecurityRealm activeDirectorySecurityRealm = new ActiveDirectorySecurityRealm(null, domains, site, bindName, bindPassword, null, groupLookupStrategy, removeIrrelevantGroups, customDomain, cache, startTls, internalUsersDatabase);
j.getInstance().setSecurityRealm(activeDirectorySecurityRealm);

while(!FileUtils.readFileToString(d.getLogfile()).contains("custom (exit status 0; expected)")) {
Thread.sleep(1000);
}


UserDetails userDetails = null;
int i = 0;
while (i < MAX_RETRIES && userDetails == null) {
Expand All @@ -94,6 +98,7 @@ public void customSingleADSetup(ActiveDirectoryDomain activeDirectoryDomain, Str
}

@Test
@WithTimeout(6000)
public void testEndtoEndManagerDnCacheEnabled() throws Exception {
List<String> messages;
l.record(hudson.plugins.active_directory.ActiveDirectoryUnixAuthenticationProvider.class, Level.FINE).capture(20);
Expand Down Expand Up @@ -130,6 +135,7 @@ public void testEndtoEndManagerDnCacheEnabled() throws Exception {
}

@Test
@WithTimeout(6000)
public void testEndtoEndManagerDnCacheDisabled() throws Exception {
List<String> messages;
l.record(hudson.plugins.active_directory.ActiveDirectoryUnixAuthenticationProvider.class, Level.FINE).capture(20);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
import hudson.util.RingBufferLogHandler;
import org.jvnet.hudson.test.LoggerRule;
import org.jvnet.hudson.test.recipes.LocalData;
import org.jvnet.hudson.test.recipes.WithTimeout;

/**
* Integration tests with Docker
Expand All @@ -95,8 +96,7 @@ public void dynamicSetUp() throws Exception {
TheFlintstones d = docker.get();
dockerIp = d.ipBound(3268);
dockerPort = d.port(3268);
ActiveDirectoryDomain activeDirectoryDomain = new ActiveDirectoryDomain(AD_DOMAIN, dockerIp + ":" + dockerPort , null, AD_MANAGER_DN, AD_MANAGER_DN_PASSWORD);
List<ActiveDirectoryDomain> domains = new ArrayList<>(1);
ActiveDirectoryDomain activeDirectoryDomain = new ActiveDirectoryDomain(AD_DOMAIN, dockerIp + ":" + dockerPort , null, AD_MANAGER_DN, AD_MANAGER_DN_PASSWORD); List<ActiveDirectoryDomain> domains = new ArrayList<>(1);
domains.add(activeDirectoryDomain);
ActiveDirectorySecurityRealm activeDirectorySecurityRealm = new ActiveDirectorySecurityRealm(null, domains, null, null, null, null, GroupLookupStrategy.RECURSIVE, false, true, null, false, null, null);
j.getInstance().setSecurityRealm(activeDirectorySecurityRealm);
Expand Down Expand Up @@ -142,13 +142,15 @@ public void manualSetUp() throws Exception {
}

@Test
@WithTimeout(6000)
public void simpleLoginSuccessful() throws Exception {
dynamicSetUp();
UserDetails userDetails = j.jenkins.getSecurityRealm().loadUserByUsername("Fred");
assertThat(userDetails.getUsername(), is("Fred"));
}

@Test
@WithTimeout(6000)
public void actualLogin() throws Exception {
dynamicSetUp();
JenkinsRule.WebClient wc = j.createWebClient().login("Fred", "ia4uV1EeKait");
Expand All @@ -162,6 +164,7 @@ public void actualLogin() throws Exception {

@Issue("SECURITY-2099")
@Test
@WithTimeout(6000)
public void shouldNotAllowEmptyPassword() throws Exception {
l.record(hudson.plugins.active_directory.ActiveDirectoryUnixAuthenticationProvider.class, Level.FINE).capture(20);
dynamicSetUp();
Expand All @@ -175,6 +178,7 @@ public void shouldNotAllowEmptyPassword() throws Exception {
}

@Test
@WithTimeout(6000)
public void simpleLoginFails() throws Exception {
dynamicSetUp();
try {
Expand All @@ -186,6 +190,7 @@ public void simpleLoginFails() throws Exception {

@Issue("JENKINS-36148")
@Test
@WithTimeout(6000)
public void checkDomainHealth() throws Exception {
dynamicSetUp();
ActiveDirectorySecurityRealm securityRealm = (ActiveDirectorySecurityRealm) Jenkins.getInstance().getSecurityRealm();
Expand All @@ -195,6 +200,7 @@ public void checkDomainHealth() throws Exception {

@Issue("JENKINS-36148")
@Test
@WithTimeout(6000)
public void validateCustomDomainController() throws ServletException, NamingException, IOException, Exception {
dynamicSetUp();
ActiveDirectoryDomain.DescriptorImpl adDescriptor = new ActiveDirectoryDomain.DescriptorImpl();
Expand All @@ -203,6 +209,7 @@ public void validateCustomDomainController() throws ServletException, NamingExce

@Issue("JENKINS-36148")
@Test
@WithTimeout(6000)
public void validateDomain() throws ServletException, NamingException, IOException, Exception {
dynamicSetUp();
ActiveDirectoryDomain.DescriptorImpl adDescriptor = new ActiveDirectoryDomain.DescriptorImpl();
Expand All @@ -212,6 +219,7 @@ public void validateDomain() throws ServletException, NamingException, IOExcepti

@Issue("JENKINS-45576")
@Test
@WithTimeout(6000)
public void loadGroupFromGroupname() throws Exception {
dynamicSetUp();
String groupname = "The Rubbles";
Expand All @@ -221,6 +229,7 @@ public void loadGroupFromGroupname() throws Exception {

@Issue("JENKINS-45576")
@Test
@WithTimeout(6000)
public void loadGroupFromAlias() throws Exception {
dynamicSetUp();
// required to monitor the log messages, removing this line the test will fail
Expand Down Expand Up @@ -266,6 +275,7 @@ public synchronized void publish(LogRecord record) {

@LocalData
@Test
@WithTimeout(6000)
public void testSimpleLoginSuccessfulAfterReadResolveTlsConfigurationSingleDomain() throws Exception {
manualSetUp();
UserDetails userDetails = j.jenkins.getSecurityRealm().loadUserByUsername("Fred");
Expand All @@ -274,6 +284,7 @@ public void testSimpleLoginSuccessfulAfterReadResolveTlsConfigurationSingleDomai

@LocalData
@Test
@WithTimeout(6000)
public void testSimpleLoginFailsAfterReadResolveTlsConfigurationSingleDomain() throws Exception {
manualSetUp();
try {
Expand All @@ -285,6 +296,7 @@ public void testSimpleLoginFailsAfterReadResolveTlsConfigurationSingleDomain() t

@LocalData
@Test
@WithTimeout(6000)
public void testSimpleLoginSuccessAfterReadResolveTlsConfigurationMultipleDomainsOneDomain() throws Exception {
manualSetUp();
UserDetails userDetails = j.jenkins.getSecurityRealm().loadUserByUsername("Fred");
Expand All @@ -293,6 +305,7 @@ public void testSimpleLoginSuccessAfterReadResolveTlsConfigurationMultipleDomain

@LocalData
@Test
@WithTimeout(6000)
public void testSimpleLoginFailsAfterReadResolveTlsConfigurationMultipleDomainsOneDomain() throws Exception {
manualSetUp();
try {
Expand All @@ -305,6 +318,7 @@ public void testSimpleLoginFailsAfterReadResolveTlsConfigurationMultipleDomainsO
// TlsConfiguration tests
@LocalData
@Test
@WithTimeout(6000)
public void testSimpleLoginSuccessfulTrustingAllCertificates() throws Exception {
manualSetUp();
UserDetails userDetails = j.jenkins.getSecurityRealm().loadUserByUsername("Fred");
Expand All @@ -313,6 +327,7 @@ public void testSimpleLoginSuccessfulTrustingAllCertificates() throws Exception

@LocalData
@Test
@WithTimeout(6000)
public void testSimpleLoginFailsTrustingJDKTrustStore() throws Exception {
try {
manualSetUp();
Expand All @@ -323,6 +338,7 @@ public void testSimpleLoginFailsTrustingJDKTrustStore() throws Exception {

@Issue("SECURITY-2117")
@Test
@WithTimeout(6000)
public void testNullBytesInPasswordMustFail() throws Exception {
l.record(hudson.plugins.active_directory.ActiveDirectoryUnixAuthenticationProvider.class, Level.FINE).capture(20);
dynamicSetUp();
Expand All @@ -337,6 +353,7 @@ public void testNullBytesInPasswordMustFail() throws Exception {

@Issue("SECURITY-2117")
@Test
@WithTimeout(6000)
public void testIncorrectPasswordMustFail() throws Exception {
l.record(hudson.plugins.active_directory.ActiveDirectoryUnixAuthenticationProvider.class, Level.FINE).capture(20);
dynamicSetUp();
Expand All @@ -349,7 +366,7 @@ public void testIncorrectPasswordMustFail() throws Exception {
assertTrue(messages.stream().anyMatch(s -> s.contains("Failed to retrieve user Fred")));
}

@DockerFixture(id = "ad-dc", ports= {135, 138, 445, 39, 464, 389, 3268}, udpPorts = {53}, matchHostPorts = true)
@DockerFixture(id = "ad-dc", ports= {135, 138, 445, 39, 53, 464, 389, 3268}, udpPorts = {53}, matchHostPorts = true)
public static class TheFlintstones extends DockerContainer {

}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.