Fix assertEqual arguments order(catalog, cert_setup, etc)

assertEqual method's arguments should be in
('expected', 'actual') order.

Change-Id: Id591629a10e6e82c4eb607a9994071f16dd80d8b
Partial-Bug: #1277104
Refactor: move federation functions to federation utils

Some of the functions created in keystone.auth.plugins.saml2 can be
re-used for other federation protocols that are supported in the future.
Propose moving them to keystone.contrib.federation.utils.

Change-Id: Ifb7adcda44a0eff2650198353393aff33b3eda7a
Merge "Fix assertEqual arguments order(catalog, cert_setup, etc)"
Merge "Refactor: move federation functions to federation utils"