mirror of
https://github.com/corda/corda.git
synced 2024-12-21 22:07:55 +00:00
Merge pull request #6710 from corda/INFRA-683-os-45-linear-builds
INFRA-683: OS 45 linear builds
This commit is contained in:
commit
1ac88c28d5
144
.ci/dev/regression/Jenkinsfile
vendored
144
.ci/dev/regression/Jenkinsfile
vendored
@ -1,29 +1,21 @@
|
|||||||
#!groovy
|
#!groovy
|
||||||
/**
|
/**
|
||||||
* Jenkins pipeline to build Corda OS release branches and tags
|
* Jenkins pipeline to build Corda OS release branches and tags.
|
||||||
|
* PLEASE NOTE: we DO want to run a build for each commit!!!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* Kill already started job.
|
|
||||||
* Assume new commit takes precendence and results from previous
|
|
||||||
* unfinished builds are not required.
|
|
||||||
* This feature doesn't play well with disableConcurrentBuilds() option
|
|
||||||
*/
|
|
||||||
@Library('corda-shared-build-pipeline-steps')
|
|
||||||
import static com.r3.build.BuildControl.killAllExistingBuildsForJob
|
|
||||||
|
|
||||||
killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger())
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sense environment
|
* Sense environment
|
||||||
*/
|
*/
|
||||||
boolean isReleaseTag = (env.TAG_NAME =~ /^release-.*(?<!_JDK11)$/)
|
boolean isReleaseTag = (env.TAG_NAME =~ /^release-.*(?<!_JDK11)$/)
|
||||||
boolean isInternalRelease = (env.TAG_NAME =~ /^internal-release-.*$/)
|
boolean isInternalRelease = (env.TAG_NAME =~ /^internal-release-.*$/)
|
||||||
|
boolean isReleaseCandidate = (env.TAG_NAME =~ /^(release-.*(RC|HC).*(?<!_JDK11))$/)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** calculate the stage for NexusIQ evaluation
|
** calculate the stage for NexusIQ evaluation
|
||||||
** * build for snapshots
|
** * build for snapshots
|
||||||
** * stage-release: for release candidates and for health checks
|
** * stage-release: for release candidates and for health checks
|
||||||
** * operate: for final release
|
** * release: for GA release
|
||||||
*/
|
*/
|
||||||
def nexusDefaultIqStage = "build"
|
def nexusDefaultIqStage = "build"
|
||||||
if (isReleaseTag) {
|
if (isReleaseTag) {
|
||||||
@ -47,11 +39,22 @@ def nexusIqStageChoices = [nexusDefaultIqStage].plus(
|
|||||||
'operate'
|
'operate'
|
||||||
].minus([nexusDefaultIqStage]))
|
].minus([nexusDefaultIqStage]))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Common Gradle arguments for all Gradle executions
|
||||||
|
*/
|
||||||
|
String COMMON_GRADLE_PARAMS = [
|
||||||
|
'--no-daemon',
|
||||||
|
'--stacktrace',
|
||||||
|
'--info',
|
||||||
|
'-Pcompilation.warningsAsErrors=false',
|
||||||
|
'-Ptests.failFast=true',
|
||||||
|
].join(' ')
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent { label 'k8s' }
|
agent { label 'standard' }
|
||||||
options {
|
options {
|
||||||
timestamps()
|
timestamps()
|
||||||
timeout(time: 3, unit: 'HOURS')
|
timeout(time: 6, unit: 'HOURS')
|
||||||
buildDiscarder(logRotator(daysToKeepStr: '14', artifactDaysToKeepStr: '14'))
|
buildDiscarder(logRotator(daysToKeepStr: '14', artifactDaysToKeepStr: '14'))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,21 +62,31 @@ pipeline {
|
|||||||
choice choices: nexusIqStageChoices, description: 'NexusIQ stage for code evaluation', name: 'nexusIqStage'
|
choice choices: nexusIqStageChoices, description: 'NexusIQ stage for code evaluation', name: 'nexusIqStage'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* List environment variables in alphabetical order
|
||||||
|
*/
|
||||||
environment {
|
environment {
|
||||||
DOCKER_TAG_TO_USE = "${env.GIT_COMMIT.subSequence(0, 8)}"
|
ARTIFACTORY_BUILD_NAME = "Corda :: Publish :: Publish Release to Artifactory :: ${env.BRANCH_NAME}"
|
||||||
DOCKER_URL = "https://index.docker.io/v1/"
|
|
||||||
EXECUTOR_NUMBER = "${env.EXECUTOR_NUMBER}"
|
|
||||||
BUILD_ID = "${env.BUILD_ID}-${env.JOB_NAME}"
|
|
||||||
ARTIFACTORY_CREDENTIALS = credentials('artifactory-credentials')
|
ARTIFACTORY_CREDENTIALS = credentials('artifactory-credentials')
|
||||||
ARTIFACTORY_BUILD_NAME = "Corda / Publish / Publish Release to Artifactory".replaceAll("/", "::")
|
|
||||||
CORDA_ARTIFACTORY_USERNAME = "${env.ARTIFACTORY_CREDENTIALS_USR}"
|
|
||||||
CORDA_ARTIFACTORY_PASSWORD = "${env.ARTIFACTORY_CREDENTIALS_PSW}"
|
CORDA_ARTIFACTORY_PASSWORD = "${env.ARTIFACTORY_CREDENTIALS_PSW}"
|
||||||
|
CORDA_ARTIFACTORY_USERNAME = "${env.ARTIFACTORY_CREDENTIALS_USR}"
|
||||||
|
DOCKER_URL = "https://index.docker.io/v1/"
|
||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
|
stage('Compile') {
|
||||||
|
steps {
|
||||||
|
sh script: [
|
||||||
|
'./gradlew',
|
||||||
|
COMMON_GRADLE_PARAMS,
|
||||||
|
'clean',
|
||||||
|
'jar'
|
||||||
|
].join(' ')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
stage('Sonatype Check') {
|
stage('Sonatype Check') {
|
||||||
steps {
|
steps {
|
||||||
sh "./gradlew --no-daemon clean jar"
|
|
||||||
script {
|
script {
|
||||||
sh "./gradlew --no-daemon properties | grep -E '^(version|group):' >version-properties"
|
sh "./gradlew --no-daemon properties | grep -E '^(version|group):' >version-properties"
|
||||||
/* every build related to Corda X.Y (GA, RC, HC, patch or snapshot) uses the same NexusIQ application */
|
/* every build related to Corda X.Y (GA, RC, HC, patch or snapshot) uses the same NexusIQ application */
|
||||||
@ -91,56 +104,53 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Deploy Nodes') {
|
stage('Unit Test') {
|
||||||
steps {
|
steps {
|
||||||
sh "./gradlew --no-daemon jar deployNodes"
|
sh script: [
|
||||||
|
'./gradlew',
|
||||||
|
COMMON_GRADLE_PARAMS,
|
||||||
|
'test'
|
||||||
|
].join(' ')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Generate Build Image') {
|
stage('Integration Test') {
|
||||||
steps {
|
steps {
|
||||||
withCredentials([string(credentialsId: 'container_reg_passwd', variable: 'DOCKER_PUSH_PWD')]) {
|
sh script: [
|
||||||
sh "./gradlew " +
|
'./gradlew',
|
||||||
"-Dkubenetize=true " +
|
COMMON_GRADLE_PARAMS,
|
||||||
"-Ddocker.push.password=\"\${DOCKER_PUSH_PWD}\" " +
|
'integrationTest'
|
||||||
"-Ddocker.work.dir=\"/tmp/\${EXECUTOR_NUMBER}\" " +
|
].join(' ')
|
||||||
"-Ddocker.container.env.parameter.CORDA_ARTIFACTORY_USERNAME=\"\${ARTIFACTORY_CREDENTIALS_USR}\" " +
|
|
||||||
"-Ddocker.container.env.parameter.CORDA_ARTIFACTORY_PASSWORD=\"\${ARTIFACTORY_CREDENTIALS_PSW}\" " +
|
|
||||||
"-Ddocker.build.tag=\"\${DOCKER_TAG_TO_USE}\"" +
|
|
||||||
" clean preAllocateForParallelRegressionTest preAllocateForAllParallelSlowIntegrationTest pushBuildImage --stacktrace"
|
|
||||||
}
|
|
||||||
sh "kubectl auth can-i get pods"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Testing phase') {
|
stage('Smoke Test') {
|
||||||
parallel {
|
|
||||||
stage('Regression Test') {
|
|
||||||
steps {
|
steps {
|
||||||
sh "./gradlew " +
|
sh script: [
|
||||||
"-DbuildId=\"\${BUILD_ID}\" " +
|
'./gradlew',
|
||||||
"-Dkubenetize=true " +
|
COMMON_GRADLE_PARAMS,
|
||||||
"-Ddocker.run.tag=\"\${DOCKER_TAG_TO_USE}\" " +
|
'smokeTest'
|
||||||
"-Dartifactory.username=\"\${ARTIFACTORY_CREDENTIALS_USR}\" " +
|
].join(' ')
|
||||||
"-Dartifactory.password=\"\${ARTIFACTORY_CREDENTIALS_PSW}\" " +
|
|
||||||
"-Dgit.branch=\"\${GIT_BRANCH}\" " +
|
|
||||||
"-Dgit.target.branch=\"\${GIT_BRANCH}\" " +
|
|
||||||
" parallelRegressionTest --stacktrace"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Slow Integration Test') {
|
stage('Slow Integration Test') {
|
||||||
steps {
|
steps {
|
||||||
sh "./gradlew " +
|
sh script: [
|
||||||
"-DbuildId=\"\${BUILD_ID}\" " +
|
'./gradlew',
|
||||||
"-Dkubenetize=true " +
|
COMMON_GRADLE_PARAMS,
|
||||||
"-Ddocker.run.tag=\"\${DOCKER_TAG_TO_USE}\" " +
|
'slowIntegrationTest'
|
||||||
"-Dartifactory.username=\"\${ARTIFACTORY_CREDENTIALS_USR}\" " +
|
].join(' ')
|
||||||
"-Dartifactory.password=\"\${ARTIFACTORY_CREDENTIALS_PSW}\" " +
|
|
||||||
"-Dgit.branch=\"\${GIT_BRANCH}\" " +
|
|
||||||
"-Dgit.target.branch=\"\${GIT_BRANCH}\" " +
|
|
||||||
" allParallelSlowIntegrationTest --stacktrace"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stage('Deploy Node') {
|
||||||
|
steps {
|
||||||
|
sh script: [
|
||||||
|
'./gradlew',
|
||||||
|
COMMON_GRADLE_PARAMS,
|
||||||
|
'deployNode'
|
||||||
|
].join(' ')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,14 +186,19 @@ pipeline {
|
|||||||
|
|
||||||
stage('Publish Release to Docker Hub') {
|
stage('Publish Release to Docker Hub') {
|
||||||
when {
|
when {
|
||||||
expression { !isInternalRelease && isReleaseTag }
|
expression { isReleaseTag && !isInternalRelease && !isReleaseCandidate}
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
withCredentials([
|
withCredentials([
|
||||||
usernamePassword(credentialsId: 'corda-publisher-docker-hub-credentials',
|
usernamePassword(credentialsId: 'corda-publisher-docker-hub-credentials',
|
||||||
usernameVariable: 'DOCKER_USERNAME',
|
usernameVariable: 'DOCKER_USERNAME',
|
||||||
passwordVariable: 'DOCKER_PASSWORD')]) {
|
passwordVariable: 'DOCKER_PASSWORD')
|
||||||
sh "./gradlew pushOfficialImages"
|
]) {
|
||||||
|
sh script: [
|
||||||
|
'./gradlew',
|
||||||
|
COMMON_GRADLE_PARAMS,
|
||||||
|
'pushOfficialImages'
|
||||||
|
].join(' ')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -191,8 +206,9 @@ pipeline {
|
|||||||
|
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
archiveArtifacts artifacts: '**/pod-logs/**/*.log', fingerprint: false
|
archiveArtifacts artifacts: '**/*.log', fingerprint: false
|
||||||
junit testResults: '**/build/test-results-xml/**/*.xml', keepLongStdio: true
|
archiveArtifacts artifacts: '**/build/reports/tests/**', fingerprint: false
|
||||||
|
junit testResults: '**/build/test-results/**/*.xml', keepLongStdio: true
|
||||||
|
|
||||||
script {
|
script {
|
||||||
try {
|
try {
|
||||||
@ -232,7 +248,7 @@ pipeline {
|
|||||||
// Comparing the dates of the previous and current builds achieves this,
|
// Comparing the dates of the previous and current builds achieves this,
|
||||||
// i.e. we will only send an email for the first build on a given day.
|
// i.e. we will only send an email for the first build on a given day.
|
||||||
def prevBuildDate = new Date(
|
def prevBuildDate = new Date(
|
||||||
currentBuild?.previousBuild.timeInMillis ?: 0).clearTime()
|
currentBuild.previousBuild?.timeInMillis ?: 0).clearTime()
|
||||||
def currentBuildDate = new Date(
|
def currentBuildDate = new Date(
|
||||||
currentBuild.timeInMillis).clearTime()
|
currentBuild.timeInMillis).clearTime()
|
||||||
|
|
||||||
@ -243,6 +259,8 @@ pipeline {
|
|||||||
statusSymbol = '\u2705'
|
statusSymbol = '\u2705'
|
||||||
break;
|
break;
|
||||||
case 'UNSTABLE':
|
case 'UNSTABLE':
|
||||||
|
statusSymbol = '\u26A0'
|
||||||
|
break;
|
||||||
case 'FAILURE':
|
case 'FAILURE':
|
||||||
statusSymbol = '\u274c'
|
statusSymbol = '\u274c'
|
||||||
break;
|
break;
|
||||||
|
@ -333,7 +333,7 @@ allprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(Test) {
|
tasks.withType(Test) {
|
||||||
forkEvery = 10
|
forkEvery = 20
|
||||||
ignoreFailures = project.hasProperty('tests.ignoreFailures') ? project.property('tests.ignoreFailures').toBoolean() : false
|
ignoreFailures = project.hasProperty('tests.ignoreFailures') ? project.property('tests.ignoreFailures').toBoolean() : false
|
||||||
failFast = project.hasProperty('tests.failFast') ? project.property('tests.failFast').toBoolean() : false
|
failFast = project.hasProperty('tests.failFast') ? project.property('tests.failFast').toBoolean() : false
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ package net.corda.coretests.indentity
|
|||||||
|
|
||||||
import com.google.common.jimfs.Configuration.unix
|
import com.google.common.jimfs.Configuration.unix
|
||||||
import com.google.common.jimfs.Jimfs
|
import com.google.common.jimfs.Jimfs
|
||||||
|
import net.corda.core.crypto.Crypto
|
||||||
import net.corda.core.crypto.entropyToKeyPair
|
import net.corda.core.crypto.entropyToKeyPair
|
||||||
import net.corda.core.identity.CordaX500Name
|
import net.corda.core.identity.CordaX500Name
|
||||||
import net.corda.core.identity.Party
|
import net.corda.core.identity.Party
|
||||||
@ -14,6 +15,7 @@ import net.corda.testing.core.SerializationEnvironmentRule
|
|||||||
import net.corda.testing.core.getTestPartyAndCertificate
|
import net.corda.testing.core.getTestPartyAndCertificate
|
||||||
import net.corda.coretesting.internal.DEV_ROOT_CA
|
import net.corda.coretesting.internal.DEV_ROOT_CA
|
||||||
import org.assertj.core.api.Assertions.assertThat
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
|
import org.junit.Before
|
||||||
import org.junit.Rule
|
import org.junit.Rule
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import java.math.BigInteger
|
import java.math.BigInteger
|
||||||
@ -24,6 +26,13 @@ class PartyAndCertificateTest {
|
|||||||
@JvmField
|
@JvmField
|
||||||
val testSerialization = SerializationEnvironmentRule()
|
val testSerialization = SerializationEnvironmentRule()
|
||||||
|
|
||||||
|
@Before
|
||||||
|
fun setUp() {
|
||||||
|
// Register providers before creating Jimfs filesystem. JimFs creates an SSHD instance which
|
||||||
|
// register BouncyCastle and EdDSA provider separately, which wrecks havoc.
|
||||||
|
Crypto.registerProviders()
|
||||||
|
}
|
||||||
|
|
||||||
@Test(timeout=300_000)
|
@Test(timeout=300_000)
|
||||||
fun `reject a path with no roles`() {
|
fun `reject a path with no roles`() {
|
||||||
val path = X509Utilities.buildCertPath(DEV_ROOT_CA.certificate)
|
val path = X509Utilities.buildCertPath(DEV_ROOT_CA.certificate)
|
||||||
|
@ -62,6 +62,8 @@ import org.junit.Test
|
|||||||
import rx.schedulers.TestScheduler
|
import rx.schedulers.TestScheduler
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.net.URL
|
import java.net.URL
|
||||||
|
import java.nio.file.FileSystem
|
||||||
|
import java.nio.file.Path
|
||||||
import java.security.KeyPair
|
import java.security.KeyPair
|
||||||
import java.time.Instant
|
import java.time.Instant
|
||||||
import java.time.temporal.ChronoUnit
|
import java.time.temporal.ChronoUnit
|
||||||
@ -79,11 +81,12 @@ class NetworkMapUpdaterTest {
|
|||||||
|
|
||||||
private val cacheExpiryMs = 1000
|
private val cacheExpiryMs = 1000
|
||||||
private val privateNetUUID = UUID.randomUUID()
|
private val privateNetUUID = UUID.randomUUID()
|
||||||
private val fs = Jimfs.newFileSystem(unix())
|
private lateinit var fs: FileSystem
|
||||||
private val baseDir = fs.getPath("/node")
|
private lateinit var baseDir: Path
|
||||||
private val nodeInfoDir = baseDir / NODE_INFO_DIRECTORY
|
private val nodeInfoDir
|
||||||
|
get() = baseDir / NODE_INFO_DIRECTORY
|
||||||
private val scheduler = TestScheduler()
|
private val scheduler = TestScheduler()
|
||||||
private val fileWatcher = NodeInfoWatcher(baseDir, scheduler)
|
private lateinit var fileWatcher: NodeInfoWatcher
|
||||||
private val nodeReadyFuture = openFuture<Void?>()
|
private val nodeReadyFuture = openFuture<Void?>()
|
||||||
private val networkMapCache = createMockNetworkMapCache()
|
private val networkMapCache = createMockNetworkMapCache()
|
||||||
private lateinit var ourKeyPair: KeyPair
|
private lateinit var ourKeyPair: KeyPair
|
||||||
@ -95,6 +98,14 @@ class NetworkMapUpdaterTest {
|
|||||||
|
|
||||||
@Before
|
@Before
|
||||||
fun setUp() {
|
fun setUp() {
|
||||||
|
// Register providers before creating Jimfs filesystem. JimFs creates an SSHD instance which
|
||||||
|
// register BouncyCastle and EdDSA provider separately, which wrecks havoc.
|
||||||
|
Crypto.registerProviders()
|
||||||
|
|
||||||
|
fs = Jimfs.newFileSystem(unix())
|
||||||
|
baseDir = fs.getPath("/node")
|
||||||
|
fileWatcher = NodeInfoWatcher(baseDir, scheduler)
|
||||||
|
|
||||||
ourKeyPair = Crypto.generateKeyPair(X509Utilities.DEFAULT_TLS_SIGNATURE_SCHEME)
|
ourKeyPair = Crypto.generateKeyPair(X509Utilities.DEFAULT_TLS_SIGNATURE_SCHEME)
|
||||||
ourNodeInfo = createNodeInfoAndSigned("Our info", ourKeyPair).signed
|
ourNodeInfo = createNodeInfoAndSigned("Our info", ourKeyPair).signed
|
||||||
server = NetworkMapServer(cacheExpiryMs.millis)
|
server = NetworkMapServer(cacheExpiryMs.millis)
|
||||||
|
@ -2,6 +2,7 @@ package net.corda.node.services.network
|
|||||||
|
|
||||||
import com.google.common.jimfs.Configuration
|
import com.google.common.jimfs.Configuration
|
||||||
import com.google.common.jimfs.Jimfs
|
import com.google.common.jimfs.Jimfs
|
||||||
|
import net.corda.core.crypto.Crypto
|
||||||
import net.corda.core.internal.*
|
import net.corda.core.internal.*
|
||||||
import net.corda.core.serialization.deserialize
|
import net.corda.core.serialization.deserialize
|
||||||
import net.corda.core.utilities.days
|
import net.corda.core.utilities.days
|
||||||
@ -29,7 +30,7 @@ class NetworkParametersReaderTest {
|
|||||||
@JvmField
|
@JvmField
|
||||||
val testSerialization = SerializationEnvironmentRule(true)
|
val testSerialization = SerializationEnvironmentRule(true)
|
||||||
|
|
||||||
private val fs: FileSystem = Jimfs.newFileSystem(Configuration.unix())
|
private lateinit var fs: FileSystem
|
||||||
private val cacheTimeout = 100000.seconds
|
private val cacheTimeout = 100000.seconds
|
||||||
|
|
||||||
private lateinit var server: NetworkMapServer
|
private lateinit var server: NetworkMapServer
|
||||||
@ -37,6 +38,11 @@ class NetworkParametersReaderTest {
|
|||||||
|
|
||||||
@Before
|
@Before
|
||||||
fun setUp() {
|
fun setUp() {
|
||||||
|
// Register providers before creating Jimfs filesystem. JimFs creates an SSHD instance which
|
||||||
|
// register BouncyCastle and EdDSA provider separately, which wrecks havoc.
|
||||||
|
Crypto.registerProviders()
|
||||||
|
|
||||||
|
fs = Jimfs.newFileSystem(Configuration.unix())
|
||||||
server = NetworkMapServer(cacheTimeout)
|
server = NetworkMapServer(cacheTimeout)
|
||||||
val address = server.start()
|
val address = server.start()
|
||||||
networkMapClient = NetworkMapClient(URL("http://$address"), VersionInfo(1, "TEST", "TEST", "TEST"))
|
networkMapClient = NetworkMapClient(URL("http://$address"), VersionInfo(1, "TEST", "TEST", "TEST"))
|
||||||
|
@ -2,6 +2,7 @@ package net.corda.node.services.network
|
|||||||
|
|
||||||
import com.google.common.jimfs.Configuration
|
import com.google.common.jimfs.Configuration
|
||||||
import com.google.common.jimfs.Jimfs
|
import com.google.common.jimfs.Jimfs
|
||||||
|
import net.corda.core.crypto.Crypto
|
||||||
import net.corda.core.internal.NODE_INFO_DIRECTORY
|
import net.corda.core.internal.NODE_INFO_DIRECTORY
|
||||||
import net.corda.core.internal.createDirectories
|
import net.corda.core.internal.createDirectories
|
||||||
import net.corda.core.internal.div
|
import net.corda.core.internal.div
|
||||||
@ -47,6 +48,10 @@ class NodeInfoWatcherTest {
|
|||||||
|
|
||||||
@Before
|
@Before
|
||||||
fun start() {
|
fun start() {
|
||||||
|
// Register providers before creating Jimfs filesystem. JimFs creates an SSHD instance which
|
||||||
|
// register BouncyCastle and EdDSA provider separately, which wrecks havoc.
|
||||||
|
Crypto.registerProviders()
|
||||||
|
|
||||||
nodeInfoAndSigned = createNodeInfoAndSigned(ALICE_NAME)
|
nodeInfoAndSigned = createNodeInfoAndSigned(ALICE_NAME)
|
||||||
val identityService = makeTestIdentityService()
|
val identityService = makeTestIdentityService()
|
||||||
keyManagementService = MockKeyManagementService(identityService)
|
keyManagementService = MockKeyManagementService(identityService)
|
||||||
|
@ -7,6 +7,7 @@ import com.google.common.jimfs.Jimfs
|
|||||||
import com.nhaarman.mockito_kotlin.doReturn
|
import com.nhaarman.mockito_kotlin.doReturn
|
||||||
import com.nhaarman.mockito_kotlin.whenever
|
import com.nhaarman.mockito_kotlin.whenever
|
||||||
import net.corda.core.contracts.ContractAttachment
|
import net.corda.core.contracts.ContractAttachment
|
||||||
|
import net.corda.core.crypto.Crypto
|
||||||
import net.corda.core.crypto.SecureHash
|
import net.corda.core.crypto.SecureHash
|
||||||
import net.corda.core.crypto.sha256
|
import net.corda.core.crypto.sha256
|
||||||
import net.corda.core.flows.FlowLogic
|
import net.corda.core.flows.FlowLogic
|
||||||
@ -67,6 +68,10 @@ class NodeAttachmentServiceTest {
|
|||||||
|
|
||||||
@Before
|
@Before
|
||||||
fun setUp() {
|
fun setUp() {
|
||||||
|
// Register providers before creating Jimfs filesystem. JimFs creates an SSHD instance which
|
||||||
|
// register BouncyCastle and EdDSA provider separately, which wrecks havoc.
|
||||||
|
Crypto.registerProviders()
|
||||||
|
|
||||||
LogHelper.setLevel(PersistentUniquenessProvider::class)
|
LogHelper.setLevel(PersistentUniquenessProvider::class)
|
||||||
|
|
||||||
val dataSourceProperties = makeTestDataSourceProperties()
|
val dataSourceProperties = makeTestDataSourceProperties()
|
||||||
@ -90,6 +95,7 @@ class NodeAttachmentServiceTest {
|
|||||||
@After
|
@After
|
||||||
fun tearDown() {
|
fun tearDown() {
|
||||||
database.close()
|
database.close()
|
||||||
|
fs.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(timeout=300_000)
|
@Test(timeout=300_000)
|
||||||
|
@ -38,6 +38,7 @@ import org.junit.After
|
|||||||
import org.junit.Before
|
import org.junit.Before
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import java.nio.file.Files
|
import java.nio.file.Files
|
||||||
|
import java.nio.file.FileSystem
|
||||||
import java.security.PublicKey
|
import java.security.PublicKey
|
||||||
import java.security.cert.CertPathValidatorException
|
import java.security.cert.CertPathValidatorException
|
||||||
import java.security.cert.X509Certificate
|
import java.security.cert.X509Certificate
|
||||||
@ -47,7 +48,7 @@ import kotlin.test.assertFalse
|
|||||||
import kotlin.test.assertTrue
|
import kotlin.test.assertTrue
|
||||||
|
|
||||||
class NetworkRegistrationHelperTest {
|
class NetworkRegistrationHelperTest {
|
||||||
private val fs = Jimfs.newFileSystem(unix())
|
private lateinit var fs: FileSystem
|
||||||
private val nodeLegalName = ALICE_NAME
|
private val nodeLegalName = ALICE_NAME
|
||||||
|
|
||||||
private lateinit var config: NodeConfiguration
|
private lateinit var config: NodeConfiguration
|
||||||
@ -56,6 +57,11 @@ class NetworkRegistrationHelperTest {
|
|||||||
|
|
||||||
@Before
|
@Before
|
||||||
fun init() {
|
fun init() {
|
||||||
|
// Register providers before creating Jimfs filesystem. JimFs creates an SSHD instance which
|
||||||
|
// register BouncyCastle and EdDSA provider separately, which wrecks havoc.
|
||||||
|
Crypto.registerProviders()
|
||||||
|
|
||||||
|
fs = Jimfs.newFileSystem(unix())
|
||||||
val baseDirectory = fs.getPath("/baseDir").createDirectories()
|
val baseDirectory = fs.getPath("/baseDir").createDirectories()
|
||||||
|
|
||||||
abstract class AbstractNodeConfiguration : NodeConfiguration
|
abstract class AbstractNodeConfiguration : NodeConfiguration
|
||||||
|
Loading…
Reference in New Issue
Block a user