summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Abidi <max_abidi@yahoo.com>2016-06-13 00:20:17 -0700
committerMax Abidi <max_abidi@yahoo.com>2016-06-13 00:28:25 -0700
commitb128a4d2e1382002bace3768613f0c2a92a7de19 (patch)
treed5305bede334da670f1d999c3b38a2bc23c5b05a
parente2ce2af4d8f8e60f6387fa48bebe473dba3864f2 (diff)
downloadpython-barbicanclient-b128a4d2e1382002bace3768613f0c2a92a7de19.tar.gz
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
-rw-r--r--functionaltests/cli/v1/smoke/test_secret.py2
-rw-r--r--functionaltests/client/v1/functional/test_secrets.py6
2 files changed, 5 insertions, 3 deletions
diff --git a/functionaltests/cli/v1/smoke/test_secret.py b/functionaltests/cli/v1/smoke/test_secret.py
index 7db17a6..a9da6b6 100644
--- a/functionaltests/cli/v1/smoke/test_secret.py
+++ b/functionaltests/cli/v1/smoke/test_secret.py
@@ -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])
diff --git a/functionaltests/client/v1/functional/test_secrets.py b/functionaltests/client/v1/functional/test_secrets.py
index 650b61c..d2a2c87 100644
--- a/functionaltests/client/v1/functional/test_secrets.py
+++ b/functionaltests/client/v1/functional/test_secrets.py
@@ -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)