Skip to content

Commit

Permalink
[FAB-5912] set auth. so UT can generate TLS stuff
Browse files Browse the repository at this point in the history
Initialize chaincode framework's authenticator in the failing
UT.

Change-Id: I33e3f310745531da7d3a8da45bf33475bc5280cb
Signed-off-by: Srinivasan Muralidharan <muralisr@us.ibm.com>
  • Loading branch information
Srinivasan Muralidharan committed Aug 24, 2017
1 parent 22f39c7 commit 01adda9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions core/chaincode/chaincode_support_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -639,8 +639,12 @@ func getHistory(t *testing.T, chainID, ccname string, ccSide *mockpeer.MockCCCom
return nil
}

func getArgsAndEnv(t *testing.T) {
func getArgsAndEnv(t *testing.T, auth accesscontrol.Authenticator) {
newCCSupport := &ChaincodeSupport{peerTLS: true, chaincodeLogLevel: "debug", shimLogLevel: "info"}

//set the authenticator for generating TLS stuff
newCCSupport.auth = auth

ccContext := ccprovider.NewCCContext("dummyChannelId", "mycc", "v0", "dummyTxid", false, nil, nil)
args, envs, err := newCCSupport.getArgsAndEnv(ccContext, pb.ChaincodeSpec_NODE)
if err != nil {
Expand Down Expand Up @@ -711,7 +715,8 @@ func TestCCFramework(t *testing.T) {
//call's history result
getHistory(t, chainID, ccname, ccSide)

getArgsAndEnv(t)
//just use the previous authhandler for generating TLS key/pair
getArgsAndEnv(t, theChaincodeSupport.auth)

ccSide.Quit()
}

0 comments on commit 01adda9

Please sign in to comment.