Skip to content

Commit

Permalink
[JENKINS-46391] Test verifying CPS-specific ~/foo/ behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
abayer committed Aug 23, 2017
1 parent bcaf9ae commit 11a0698
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -93,7 +93,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>script-security</artifactId>
<version>1.31</version>
<version>1.34-20170823.172346-3</version> <!-- Switch to release once https://github.com/jenkinsci/script-security-plugin/pull/146 is merged/released -->
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
Expand Down
Expand Up @@ -224,4 +224,11 @@ public void traitsSandbox() throws Exception {
jenkins.assertLogContains("org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use staticMethod jenkins.model.Jenkins getInstance", b);
}

@Issue("JENKINS-46391")
@Test
public void tildePattern() throws Exception {
WorkflowJob job = jenkins.jenkins.createProject(WorkflowJob.class, "p");
job.setDefinition(new CpsFlowDefinition("def f = ~/f.*/; f.matcher('foo').matches()", true));
jenkins.buildAndAssertSuccess(job);
}
}

0 comments on commit 11a0698

Please sign in to comment.