"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "ra/ra_test.go" between
boulder-release-2021-07-12.tar.gz and boulder-release-2021-07-19.tar.gz

About: Boulder is an ACME-based Certificate Authority (CA) used by Let’s Encrypt (written in Go).

ra_test.go  (boulder-release-2021-07-12):ra_test.go  (boulder-release-2021-07-19)
skipping to change at line 1903 skipping to change at line 1903
test.AssertNotError(t, err, "Could not deactivate authorization") test.AssertNotError(t, err, "Could not deactivate authorization")
deact, err := sa.GetAuthorization2(ctx, &sapb.AuthorizationID2{Id: authzI D}) deact, err := sa.GetAuthorization2(ctx, &sapb.AuthorizationID2{Id: authzI D})
test.AssertNotError(t, err, "Could not get deactivated authorization with ID "+authz.ID) test.AssertNotError(t, err, "Could not get deactivated authorization with ID "+authz.ID)
test.AssertEquals(t, deact.Status, string(core.StatusDeactivated)) test.AssertEquals(t, deact.Status, string(core.StatusDeactivated))
} }
func TestDeactivateRegistration(t *testing.T) { func TestDeactivateRegistration(t *testing.T) {
_, _, ra, _, cleanUp := initAuthorities(t) _, _, ra, _, cleanUp := initAuthorities(t)
defer cleanUp() defer cleanUp()
err := ra.DeactivateRegistration(context.Background(), core.Registration{ // Deactivate failure because incomplete registration provided
ID: 1}) _, err := ra.DeactivateRegistration(context.Background(), &corepb.Registr
test.AssertError(t, err, "DeactivateRegistration failed with a non-valid ation{})
registration") test.AssertDeepEquals(t, err, fmt.Errorf("incomplete gRPC request message
err = ra.DeactivateRegistration(context.Background(), core.Registration{I "))
D: 1, Status: core.StatusDeactivated})
// Deactivate failure because registration status already deactivated
_, err = ra.DeactivateRegistration(context.Background(),
&corepb.Registration{Id: 1, Status: string(core.StatusDeactivated
)})
test.AssertError(t, err, "DeactivateRegistration failed with a non-valid registration") test.AssertError(t, err, "DeactivateRegistration failed with a non-valid registration")
err = ra.DeactivateRegistration(context.Background(), core.Registration{I
D: 1, Status: core.StatusValid}) // Deactivate success with valid registration
_, err = ra.DeactivateRegistration(context.Background(),
&corepb.Registration{Id: 1, Status: string(core.StatusValid)})
test.AssertNotError(t, err, "DeactivateRegistration failed") test.AssertNotError(t, err, "DeactivateRegistration failed")
// Check db to make sure account is deactivated
dbReg, err := ra.SA.GetRegistration(context.Background(), 1) dbReg, err := ra.SA.GetRegistration(context.Background(), 1)
test.AssertNotError(t, err, "GetRegistration failed") test.AssertNotError(t, err, "GetRegistration failed")
test.AssertEquals(t, dbReg.Status, core.StatusDeactivated) test.AssertEquals(t, dbReg.Status, core.StatusDeactivated)
} }
// noopCAA implements caaChecker, always returning nil // noopCAA implements caaChecker, always returning nil
type noopCAA struct{} type noopCAA struct{}
func (cr noopCAA) IsCAAValid( func (cr noopCAA) IsCAAValid(
ctx context.Context, ctx context.Context,
 End of changes. 3 change blocks. 
8 lines changed or deleted 16 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)