Fixed python-barbicanclient functional tests.

When using KMIP backend, some barbican client functional
tests failed in payload length validation. Fixed the test case
payload data, for client/v1/functional/test_secrets and
cli/v1/smoke/test_secret

Change-Id: Ic0abe8b6094d838fb4ec33cf22a5ca4c0450de31
Closes-Bug: #1570166
This commit is contained in:
Max Abidi 2016-06-13 00:20:17 -07:00
parent e2ce2af4d8
commit b128a4d2e1
2 changed files with 5 additions and 3 deletions

View File

@ -65,7 +65,7 @@ class SecretTestCase(CmdLineTestCase):
@testcase.attr('positive')
def test_secret_store_with_secret_type(self, secret_type, algorithm,
bit_length, secret):
payload = base64.b64encode(secret)
payload = secret
secret_argv = ['--secret-type', secret_type]
if algorithm:
secret_argv.extend(['--algorithm', algorithm])

View File

@ -339,7 +339,8 @@ class SecretsTestCase(base.TestCase):
secret.secret_type = secret_type
secret.algorithm = algorithm
secret.bit_length = bit_length
secret.payload = base64.b64encode(payload)
# payload should not be encoded.
secret.payload = payload
secret_ref = self.cleanup.add_entity(secret)
self.assertIsNotNone(secret_ref)
@ -756,7 +757,8 @@ class SecretsTestCase(base.TestCase):
secret.secret_type = secret_type
secret.algorithm = algorithm
secret.bit_length = bit_length
secret.payload = base64.b64encode(payload)
# payload should not be encoded.
secret.payload = payload
secret_ref = self.cleanup.add_entity(secret)
self.assertIsNotNone(secret_ref)