github.com/hyperledger/fabric-ca@v2.0.0-alpha.0.20201120210307-7b4f34729db1+incompatible/scripts/fvt/db_smoke_test.sh (about) 1 #!/bin/bash 2 # 3 # Copyright IBM Corp. All Rights Reserved. 4 # 5 # SPDX-License-Identifier: Apache-2.0 6 # 7 8 SCRIPTDIR="$GOPATH/src/github.com/hyperledger/fabric-ca/scripts/fvt" 9 MYSQLSMOKECONFIG=$FABRIC_CA_DATA/smoke/caconfig.yml 10 11 mkdir -p "$(dirname ${MYSQLSMOKECONFIG})" 12 # Create base configuration using mysql 13 cat >$MYSQLSMOKECONFIG <<EOF 14 debug: true 15 16 db: 17 type: mysql 18 datasource: root:mysql@tcp(localhost:$MYSQL_PORT)/fabric_ca?tls=custom 19 tls: 20 enabled: true 21 certfiles: 22 - $TLS_ROOTCERT 23 client: 24 certfile: $TLS_CLIENTCERT 25 keyfile: $TLS_CLIENTKEY 26 tls: 27 enabled: true 28 certfile: $TLS_SERVERCERT 29 keyfile: $TLS_SERVERKEY 30 31 registry: 32 # Maximum number of times a password/secret can be reused for enrollment 33 # (default: -1, which means there is no limit) 34 maxenrollments: -1 35 36 # Contains identity information which is used when LDAP is disabled 37 identities: 38 - name: a 39 pass: b 40 type: client 41 affiliation: "" 42 maxenrollments: -1 43 attrs: 44 hf.Registrar.Roles: "client,user,peer,validator,auditor" 45 hf.Registrar.DelegateRoles: "client,user,validator,auditor" 46 hf.Revoker: true 47 hf.IntermediateCA: true 48 49 affiliations: 50 org1: 51 - department1 52 - department2 53 org2: 54 - department1 55 EOF 56 57 fabric-ca-server start -b a:b -c $MYSQLSMOKECONFIG -d & 58 if test $? -eq 1; then 59 ErrorMsg "Failed to start server, with the latest configuration file version" 60 fi 61 $SCRIPTDIR/fabric-ca_setup.sh -K