mirror of
https://github.com/corda/corda.git
synced 2024-12-28 16:58:55 +00:00
Add db integration test setup for new tests (#197)
* Added db test setup for NetworkMapTest and NodeRegistrationTest. * Removed database.serverNameTablePrefix property setup for notaries in DriveDSL (after rebase from OS) * Add missing schemas for Azure master database setup.
This commit is contained in:
parent
2f246afc28
commit
9600622db7
@ -2,9 +2,8 @@ package net.corda.node.services.network
|
|||||||
|
|
||||||
import net.corda.core.node.NodeInfo
|
import net.corda.core.node.NodeInfo
|
||||||
import net.corda.core.utilities.seconds
|
import net.corda.core.utilities.seconds
|
||||||
|
import net.corda.testing.*
|
||||||
import net.corda.testing.node.internal.CompatibilityZoneParams
|
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.NodeHandle
|
||||||
import net.corda.testing.driver.PortAllocation
|
import net.corda.testing.driver.PortAllocation
|
||||||
import net.corda.testing.node.internal.internalDriver
|
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.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.After
|
import org.junit.After
|
||||||
import org.junit.Before
|
import org.junit.Before
|
||||||
|
import org.junit.ClassRule
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import java.net.URL
|
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 cacheTimeout = 1.seconds
|
||||||
private val portAllocation = PortAllocation.Incremental(10000)
|
private val portAllocation = PortAllocation.Incremental(10000)
|
||||||
|
|
||||||
|
@ -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_CLIENT_CA
|
||||||
import net.corda.nodeapi.internal.crypto.X509Utilities.CORDA_INTERMEDIATE_CA
|
import net.corda.nodeapi.internal.crypto.X509Utilities.CORDA_INTERMEDIATE_CA
|
||||||
import net.corda.nodeapi.internal.crypto.X509Utilities.CORDA_ROOT_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.node.internal.CompatibilityZoneParams
|
||||||
import net.corda.testing.driver.PortAllocation
|
import net.corda.testing.driver.PortAllocation
|
||||||
import net.corda.testing.node.internal.internalDriver
|
import net.corda.testing.node.internal.internalDriver
|
||||||
import net.corda.testing.node.network.NetworkMapServer
|
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.assertThat
|
||||||
import org.assertj.core.api.Assertions.assertThatThrownBy
|
import org.assertj.core.api.Assertions.assertThatThrownBy
|
||||||
import org.bouncycastle.pkcs.PKCS10CertificationRequest
|
import org.bouncycastle.pkcs.PKCS10CertificationRequest
|
||||||
import org.bouncycastle.pkcs.jcajce.JcaPKCS10CertificationRequest
|
import org.bouncycastle.pkcs.jcajce.JcaPKCS10CertificationRequest
|
||||||
import org.junit.After
|
import org.junit.After
|
||||||
import org.junit.Before
|
import org.junit.Before
|
||||||
|
import org.junit.ClassRule
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import java.io.ByteArrayOutputStream
|
import java.io.ByteArrayOutputStream
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
@ -37,7 +42,12 @@ import javax.ws.rs.*
|
|||||||
import javax.ws.rs.core.MediaType
|
import javax.ws.rs.core.MediaType
|
||||||
import javax.ws.rs.core.Response
|
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 portAllocation = PortAllocation.Incremental(13000)
|
||||||
private val rootCertAndKeyPair = createSelfKeyAndSelfSignedCertificate()
|
private val rootCertAndKeyPair = createSelfKeyAndSelfSignedCertificate()
|
||||||
private val registrationHandler = RegistrationHandler(rootCertAndKeyPair)
|
private val registrationHandler = RegistrationHandler(rootCertAndKeyPair)
|
||||||
|
@ -426,9 +426,7 @@ class DriverDSLImpl(
|
|||||||
providedName = nodeNames[0],
|
providedName = nodeNames[0],
|
||||||
rpcUsers = spec.rpcUsers,
|
rpcUsers = spec.rpcUsers,
|
||||||
verifierType = spec.verifierType,
|
verifierType = spec.verifierType,
|
||||||
customOverrides = notaryConfig(clusterAddress) + mapOf(
|
customOverrides = notaryConfig(clusterAddress) //TODO discrepancy with OS - check if 'serverNameTablePrefix' can be removed in OS
|
||||||
"database.serverNameTablePrefix" to nodeNames[0].toString().replace(Regex("[^0-9A-Za-z]+"), "")
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// All other nodes will join the cluster
|
// All other nodes will join the cluster
|
||||||
@ -438,9 +436,7 @@ class DriverDSLImpl(
|
|||||||
providedName = it,
|
providedName = it,
|
||||||
rpcUsers = spec.rpcUsers,
|
rpcUsers = spec.rpcUsers,
|
||||||
verifierType = spec.verifierType,
|
verifierType = spec.verifierType,
|
||||||
customOverrides = notaryConfig(nodeAddress, clusterAddress) + mapOf(
|
customOverrides = notaryConfig(nodeAddress, clusterAddress) //TODO discrepancy with OS - check if 'serverNameTablePrefix' can be removed in OS
|
||||||
"database.serverNameTablePrefix" to it.toString().replace(Regex("[^0-9A-Za-z]+"), "")
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
--once off script to run against master database (not a user database)
|
--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 WITH PASSWORD = 'yourStrong(!)Password';
|
||||||
CREATE LOGIN AliceCorp_10000 WITH PASSWORD = 'yourStrong(!)Password';
|
CREATE LOGIN AliceCorp_10000 WITH PASSWORD = 'yourStrong(!)Password';
|
||||||
CREATE LOGIN AliceCorp_10003 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_10006 WITH PASSWORD = 'yourStrong(!)Password';
|
||||||
CREATE LOGIN BankA_10012 WITH PASSWORD = 'yourStrong(!)Password';
|
CREATE LOGIN BankA_10012 WITH PASSWORD = 'yourStrong(!)Password';
|
||||||
CREATE LOGIN BankB 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 WITH PASSWORD = 'yourStrong(!)Password';
|
||||||
CREATE LOGIN BobPlc_10000 WITH PASSWORD = 'yourStrong(!)Password';
|
CREATE LOGIN BobPlc_10000 WITH PASSWORD = 'yourStrong(!)Password';
|
||||||
CREATE LOGIN BobPlc_10003 WITH PASSWORD = 'yourStrong(!)Password';
|
CREATE LOGIN BobPlc_10003 WITH PASSWORD = 'yourStrong(!)Password';
|
||||||
|
Loading…
Reference in New Issue
Block a user