Skip to content

Commit

Permalink
Merge pull request #169 from abayer/jenkins-46391
Browse files Browse the repository at this point in the history
[JENKINS-46391] Test verifying CPS-specific ~/foo/ behavior
  • Loading branch information
abayer committed Sep 5, 2017
2 parents 1c6e51a + 8251690 commit b8da291
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -224,6 +224,14 @@ 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);
}

@Issue("JENKINS-46088")
@Test
public void matcherTypeAssignment() throws Exception {
Expand Down Expand Up @@ -268,6 +276,5 @@ public void rhsOfDeclarationSandboxedInCPS() throws Exception {
WorkflowRun b = job.scheduleBuild2(0).get();
jenkins.assertBuildStatus(Result.FAILURE, b);
jenkins.assertLogContains("org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use staticMethod jenkins.model.Jenkins getInstance", b);

}
}

0 comments on commit b8da291

Please sign in to comment.