diff --git a/node/src/integration-test/kotlin/net/corda/node/services/network/NetworkMapTest.kt b/node/src/integration-test/kotlin/net/corda/node/services/network/NetworkMapTest.kt index faa30be62b..8ca2736f7a 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/network/NetworkMapTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/network/NetworkMapTest.kt @@ -2,9 +2,8 @@ package net.corda.node.services.network import net.corda.core.node.NodeInfo import net.corda.core.utilities.seconds +import net.corda.testing.* import net.corda.testing.node.internal.CompatibilityZoneParams -import net.corda.testing.ALICE_NAME -import net.corda.testing.BOB_NAME import net.corda.testing.driver.NodeHandle import net.corda.testing.driver.PortAllocation import net.corda.testing.node.internal.internalDriver @@ -12,10 +11,16 @@ import net.corda.testing.node.network.NetworkMapServer import org.assertj.core.api.Assertions.assertThat import org.junit.After import org.junit.Before +import org.junit.ClassRule import org.junit.Test import java.net.URL -class NetworkMapTest { +class NetworkMapTest : IntegrationTest() { + companion object { + @ClassRule @JvmField + val databaseSchemas = IntegrationTestSchemas(ALICE_NAME.toDatabaseSchemaName(), BOB_NAME.toDatabaseSchemaName(), + DUMMY_NOTARY_NAME.toDatabaseSchemaName()) + } private val cacheTimeout = 1.seconds private val portAllocation = PortAllocation.Incremental(10000) diff --git a/node/src/integration-test/kotlin/net/corda/node/utilities/registration/NodeRegistrationTest.kt b/node/src/integration-test/kotlin/net/corda/node/utilities/registration/NodeRegistrationTest.kt index 2acd637b5d..34779ac2c3 100644 --- a/node/src/integration-test/kotlin/net/corda/node/utilities/registration/NodeRegistrationTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/utilities/registration/NodeRegistrationTest.kt @@ -14,16 +14,21 @@ import net.corda.nodeapi.internal.crypto.X509Utilities import net.corda.nodeapi.internal.crypto.X509Utilities.CORDA_CLIENT_CA import net.corda.nodeapi.internal.crypto.X509Utilities.CORDA_INTERMEDIATE_CA import net.corda.nodeapi.internal.crypto.X509Utilities.CORDA_ROOT_CA +import net.corda.testing.ALICE_NAME +import net.corda.testing.IntegrationTest +import net.corda.testing.IntegrationTestSchemas import net.corda.testing.node.internal.CompatibilityZoneParams import net.corda.testing.driver.PortAllocation import net.corda.testing.node.internal.internalDriver import net.corda.testing.node.network.NetworkMapServer +import net.corda.testing.toDatabaseSchemaName import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.assertThatThrownBy import org.bouncycastle.pkcs.PKCS10CertificationRequest import org.bouncycastle.pkcs.jcajce.JcaPKCS10CertificationRequest import org.junit.After import org.junit.Before +import org.junit.ClassRule import org.junit.Test import java.io.ByteArrayOutputStream import java.io.InputStream @@ -37,7 +42,12 @@ import javax.ws.rs.* import javax.ws.rs.core.MediaType import javax.ws.rs.core.Response -class NodeRegistrationTest { +class NodeRegistrationTest : IntegrationTest() { + companion object { + @ClassRule @JvmField + val databaseSchemas = IntegrationTestSchemas("Alice") + } + private val portAllocation = PortAllocation.Incremental(13000) private val rootCertAndKeyPair = createSelfKeyAndSelfSignedCertificate() private val registrationHandler = RegistrationHandler(rootCertAndKeyPair) diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt index fb92e5b085..8903449bd6 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt @@ -426,9 +426,7 @@ class DriverDSLImpl( providedName = nodeNames[0], rpcUsers = spec.rpcUsers, verifierType = spec.verifierType, - customOverrides = notaryConfig(clusterAddress) + mapOf( - "database.serverNameTablePrefix" to nodeNames[0].toString().replace(Regex("[^0-9A-Za-z]+"), "") - ) + customOverrides = notaryConfig(clusterAddress) //TODO discrepancy with OS - check if 'serverNameTablePrefix' can be removed in OS ) // All other nodes will join the cluster @@ -438,9 +436,7 @@ class DriverDSLImpl( providedName = it, rpcUsers = spec.rpcUsers, verifierType = spec.verifierType, - customOverrides = notaryConfig(nodeAddress, clusterAddress) + mapOf( - "database.serverNameTablePrefix" to it.toString().replace(Regex("[^0-9A-Za-z]+"), "") - ) + customOverrides = notaryConfig(nodeAddress, clusterAddress) //TODO discrepancy with OS - check if 'serverNameTablePrefix' can be removed in OS ) } diff --git a/testing/test-utils/src/main/resources/database-scripts/azure-sql/master-user-setup.sql b/testing/test-utils/src/main/resources/database-scripts/azure-sql/master-user-setup.sql index fe86225fdd..5d87ad78f9 100644 --- a/testing/test-utils/src/main/resources/database-scripts/azure-sql/master-user-setup.sql +++ b/testing/test-utils/src/main/resources/database-scripts/azure-sql/master-user-setup.sql @@ -1,4 +1,5 @@ --once off script to run against master database (not a user database) +CREATE LOGIN Alice WITH PASSWORD = 'yourStrong(!)Password'; CREATE LOGIN AliceCorp WITH PASSWORD = 'yourStrong(!)Password'; CREATE LOGIN AliceCorp_10000 WITH PASSWORD = 'yourStrong(!)Password'; CREATE LOGIN AliceCorp_10003 WITH PASSWORD = 'yourStrong(!)Password'; @@ -10,6 +11,8 @@ CREATE LOGIN BankA_10003 WITH PASSWORD = 'yourStrong(!)Password'; CREATE LOGIN BankA_10006 WITH PASSWORD = 'yourStrong(!)Password'; CREATE LOGIN BankA_10012 WITH PASSWORD = 'yourStrong(!)Password'; CREATE LOGIN BankB WITH PASSWORD = 'yourStrong(!)Password'; +CREATE LOGIN BankOfCorda WITH PASSWORD = 'yourStrong(!)Password'; +CREATE LOGIN BigCorporation WITH PASSWORD = 'yourStrong(!)Password'; CREATE LOGIN BobPlc WITH PASSWORD = 'yourStrong(!)Password'; CREATE LOGIN BobPlc_10000 WITH PASSWORD = 'yourStrong(!)Password'; CREATE LOGIN BobPlc_10003 WITH PASSWORD = 'yourStrong(!)Password';