'Test signature validation when host is bound with port.
Host is bound with a port, generally, the port here is not the
standard port for the protocol, like \'80\' for HTTP and port 443
for HTTPS, the port is not omitted by the client library.'

def test_signature_validate_with_host_port(self):

    access = self.blob['access']
    secret = self.blob['secret']
    signer = ec2_utils.Ec2Signer(secret)
    params = {'SignatureMethod': 'HmacSHA256', 'SignatureVersion': '2', 'AWSAccessKeyId': access}
    request = {'host': 'foo:8181', 'verb': 'GET', 'path': '/bar', 'params': params}
    signature = signer.generate(request)
    sig_ref = {'access': access, 'signature': signature, 'host': 'foo:8181', 'verb': 'GET', 'path': '/bar', 'params': params}
    self.assertTrue(self.controller.check_signature(self.creds_ref, sig_ref))
