@@ -787,7 +787,7 @@ func TestAdminPolicyPrincipal(t *testing.T) {
787
787
}
788
788
789
789
func TestAdminPolicyPrincipalFails (t * testing.T ) {
790
- id , err := localMsp .GetDefaultSigningIdentity ()
790
+ id , err := localMspV13 .GetDefaultSigningIdentity ()
791
791
assert .NoError (t , err )
792
792
793
793
principalBytes , err := proto .Marshal (& msp.MSPRole {Role : msp .MSPRole_ADMIN , MspIdentifier : "SampleOrg" })
@@ -798,7 +798,7 @@ func TestAdminPolicyPrincipalFails(t *testing.T) {
798
798
Principal : principalBytes }
799
799
800
800
// remove the admin so validation will fail
801
- localMsp .(* bccspmsp ).admins = make ([]Identity , 0 )
801
+ localMspV13 .(* bccspmsp ).admins = make ([]Identity , 0 )
802
802
803
803
err = id .SatisfiesPrincipal (principal )
804
804
assert .Error (t , err )
@@ -924,6 +924,8 @@ func TestIdentityPolicyPrincipalFails(t *testing.T) {
924
924
925
925
var conf * msp.MSPConfig
926
926
var localMsp MSP
927
+ var localMspV11 MSP
928
+ var localMspV13 MSP
927
929
928
930
// Required because deleting the cert or msp options from localMsp causes parallel tests to fail
929
931
var localMspBad MSP
@@ -955,6 +957,30 @@ func TestMain(m *testing.M) {
955
957
os .Exit (- 1 )
956
958
}
957
959
960
+ localMspV13 , err = newBccspMsp (MSPv1_3 )
961
+ if err != nil {
962
+ fmt .Printf ("Constructor for V1.3 msp should have succeeded, got err %s instead" , err )
963
+ os .Exit (- 1 )
964
+ }
965
+
966
+ localMspV11 , err = newBccspMsp (MSPv1_1 )
967
+ if err != nil {
968
+ fmt .Printf ("Constructor for V1.1 msp should have succeeded, got err %s instead" , err )
969
+ os .Exit (- 1 )
970
+ }
971
+
972
+ err = localMspV11 .Setup (conf )
973
+ if err != nil {
974
+ fmt .Printf ("Setup for V1.1 msp should have succeeded, got err %s instead" , err )
975
+ os .Exit (- 1 )
976
+ }
977
+
978
+ err = localMspV13 .Setup (conf )
979
+ if err != nil {
980
+ fmt .Printf ("Setup for V1.3 msp should have succeeded, got err %s instead" , err )
981
+ os .Exit (- 1 )
982
+ }
983
+
958
984
err = localMsp .Setup (conf )
959
985
if err != nil {
960
986
fmt .Printf ("Setup for msp should have succeeded, got err %s instead" , err )
0 commit comments