Create temporary directory if needed in CCR test
In the multi-cluster-with-non-compliant-license tests, we try to write out a java.policy to a temporary directory. However, if this temporary directory does not already exist then writing the java.policy file will fail. This commit ensures that the temporary directory exists before we attempt to write the java.policy file.
This commit is contained in:
parent
5a38c930fc
commit
c67b0ba33e
|
@ -22,7 +22,11 @@ leaderClusterTestRunner {
|
|||
|
||||
task writeJavaPolicy {
|
||||
doLast {
|
||||
final File javaPolicy = file("${buildDir}/tmp/java.policy")
|
||||
final File tmp = file("${buildDir}/tmp")
|
||||
if (tmp.exists() == false && tmp.mkdirs() == false) {
|
||||
throw new GradleException("failed to create temporary directory [${tmp}]")
|
||||
}
|
||||
final File javaPolicy = file("${tmp}/java.policy")
|
||||
javaPolicy.write(
|
||||
[
|
||||
"grant {",
|
||||
|
|
Loading…
Reference in New Issue