Adding the functionality to test cancelling repodiscovery.

This adds a way to cancel repo autodiscovery. Currently, it can't confirm that the cancellation was successful. Once BZ 952381 is resolved it will be possible to check the cancellation via the API.