Merge BadRequest tests of "create a keypair" API

In test_attach_interfaces, there are BadRequest tests of "create a keypair".
Most parts of them are duplicated.
This patch merges them for the readability and clarifying their purposes.

Change-Id: I784f5d05969aa9a0c85b63f064190ab4e92ed7f7
Merge "Merge BadRequest tests of "create a keypair" API"