'Test signature validation when host is bound with well-known port.
Host is bound with a port, but the port is well-know port like \'80\'
for HTTP and port 443 for HTTPS, sometimes, client library omit
the port but then make the request with the port.
see (How to create the string to sign): \'http://docs.aws.amazon.com/
general/latest/gr/signature-version-2.html\'.
Since "credentials[\'host\']" is not set by client library but is
taken from "req.host", so caused the differences.'

def test_signature_validate_with_missed_host_port(self):

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