Skip to content

Commit 01adda9

Browse files
author
Srinivasan Muralidharan
committed
[FAB-5912] set auth. so UT can generate TLS stuff
Initialize chaincode framework's authenticator in the failing UT. Change-Id: I33e3f310745531da7d3a8da45bf33475bc5280cb Signed-off-by: Srinivasan Muralidharan <muralisr@us.ibm.com>
1 parent 22f39c7 commit 01adda9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

core/chaincode/chaincode_support_test.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,8 +639,12 @@ func getHistory(t *testing.T, chainID, ccname string, ccSide *mockpeer.MockCCCom
639639
return nil
640640
}
641641

642-
func getArgsAndEnv(t *testing.T) {
642+
func getArgsAndEnv(t *testing.T, auth accesscontrol.Authenticator) {
643643
newCCSupport := &ChaincodeSupport{peerTLS: true, chaincodeLogLevel: "debug", shimLogLevel: "info"}
644+
645+
//set the authenticator for generating TLS stuff
646+
newCCSupport.auth = auth
647+
644648
ccContext := ccprovider.NewCCContext("dummyChannelId", "mycc", "v0", "dummyTxid", false, nil, nil)
645649
args, envs, err := newCCSupport.getArgsAndEnv(ccContext, pb.ChaincodeSpec_NODE)
646650
if err != nil {
@@ -711,7 +715,8 @@ func TestCCFramework(t *testing.T) {
711715
//call's history result
712716
getHistory(t, chainID, ccname, ccSide)
713717

714-
getArgsAndEnv(t)
718+
//just use the previous authhandler for generating TLS key/pair
719+
getArgsAndEnv(t, theChaincodeSupport.auth)
715720

716721
ccSide.Quit()
717722
}

0 commit comments

Comments
 (0)