Skip to content

Commit

Permalink
[JENKINS-57824] Change privateKey and use timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
MRamonLeon committed Jun 4, 2019
1 parent 072a8fc commit ee64fa0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 30 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<changelist>-SNAPSHOT</changelist>
<jenkins.version>2.138.4</jenkins.version>
<java.level>8</java.level>
<jcasc.version>1.20-SNAPSHOT</jcasc.version>
<jcasc.version>1.20-20190604.105601-2</jcasc.version>
</properties>

<repositories>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
import com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials;
import io.jenkins.plugins.casc.misc.ExportImportRoundTripAbstractTest;
import jenkins.model.Jenkins;
import org.hamcrest.Matchers;
import org.jvnet.hudson.test.RestartableJenkinsRule;

import java.util.Collections;
import java.util.List;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;

public class ExportImportRoundTripCasCSSHCredentialsTest extends ExportImportRoundTripAbstractTest {
@Override
Expand All @@ -33,12 +31,7 @@ public void assertConfiguredAsExpected(RestartableJenkinsRule restartableJenkins
assertEquals("the description of userid2", cred2.getDescription());
assertEquals(1, cred2.getPrivateKeySource().getPrivateKeys().size());
String directKey = cred2.getPrivateKeySource().getPrivateKeys().get(0);
assertThat(directKey, Matchers.containsString("Piikjvd/2HYfEYEG"));
}

@Override
public String configResource() {
return "ssh-credentials.yml";
assertEquals("sp0ds9d+skkfjf", directKey);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
jenkins:
systemMessage: Jenkins with SSH Credentials for JCasC test

credentials:
system:
domainCredentials:
- credentials:
- usernamePassword:
scope: SYSTEM
id: "userid"
username: "username-of-userid"
password: "password-of-userid"
- basicSSHUserPrivateKey:
scope: SYSTEM
id: "userid2"
username: "username-of-userid2"
passphrase: "passphrase-of-userid2"
description: "the description of userid2"
privateKeySource:
directEntry:
privateKey: "sp0ds9d+skkfjf"

This file was deleted.

0 comments on commit ee64fa0

Please sign in to comment.