You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This change-set brings test coverage
of the core/policy package to up 85%
Change-Id: I0145eb8bfcfd45b1c54fefb94c99888d7e4a3934
Signed-off-by: Angelo De Caro <[email protected]>
returnfmt.Errorf("Failed deserializing proposal creator during channelless check policy with policy [%s}: [%s]", policyName, err)
136
+
returnfmt.Errorf("Failed deserializing proposal creator during channelless check policy with policy [%s]: [%s]", policyName, err)
137
137
}
138
138
139
139
// Load MSPPrincipal for policy
140
140
principal, err:=p.principalGetter.Get(policyName)
141
141
iferr!=nil {
142
-
returnfmt.Errorf("Failed getting local MSP principal during channelless check policy with policy [%s}: [%s]", policyName, err)
142
+
returnfmt.Errorf("Failed getting local MSP principal during channelless check policy with policy [%s]: [%s]", policyName, err)
143
143
}
144
144
145
145
// Verify that proposal's creator satisfies the principal
146
146
err=id.SatisfiesPrincipal(principal)
147
147
iferr!=nil {
148
-
returnfmt.Errorf("Failed verifying that proposal's creator satisfies local MSP principal during channelless check policy with policy [%s}: [%s]", policyName, err)
148
+
returnfmt.Errorf("Failed verifying that proposal's creator satisfies local MSP principal during channelless check policy with policy [%s]: [%s]", policyName, err)
// Proposal from Alice for channel A should fail against channel B, where Alice is not involved
68
158
err=pc.CheckPolicy("B", "readers", sProp)
69
159
assert.Error(t, err)
160
+
assert.Contains(t, err.Error(), "Failed evaluating policy on signed data during check policy on channel [B] with policy [readers]: [Invalid Identity]")
70
161
71
162
// Proposal from Alice for channel A should fail against channel C, where Alice is involved but signature is not valid
72
163
err=pc.CheckPolicy("C", "readers", sProp)
73
164
assert.Error(t, err)
165
+
assert.Contains(t, err.Error(), "Failed evaluating policy on signed data during check policy on channel [C] with policy [readers]: [Invalid Signature]")
74
166
75
167
// Alice is a member of the local MSP, policy check must succeed
0 commit comments