Closed Javex closed 9 years ago
We should be refactoring all tests, split them up and organize them more nicely.
On that note: We should split unwrapping tests each with their corresponding operation. That is, each message, e.g. PKCSReq gets its own set of unwrapping functions. Addtionally, we have common unwrapping tests just we have with wrapping now. This way, unwrapping is tests for each function just as we test wrapping.
Another note on the splitting: There are two possible ways to split the unwrap:
scep_pkcsreq
tests unwrapping that message (so what a server would do)scep_pkcsreq
is unwrapped where scep_certrep
is built. scep_pkcsreq
then unwrapps what was built by scep_certrep
as a response to that.In either case we have to notice that CertRep has a lot of work to do: It is able to build a multitude of response to each request, i.e. PKCSReq, GetCert, etc. And might need tests for all those cases separately. And unwrapping is the same: Unwrapping a response needs to test each CertRep
case.
I strongly favor the first case as it makes testing a lot easier: You can built the message using the functions you are already testing (and have your make_message
there for you to perform this part already).
Some unwrapping properties are common to all or a subset of the available message types (e.g. transaction ID). In this case, we want to test that it works on all of them. Thus we need to refactor the tests in such a way that those properties can be tested on all of them without copying our test code over.