(TOX)$ tox GLOB sdist-make: ccsdk/plugins/pgaas/setup.py py27 inst-nodeps: ccsdk/plugins/pgaas/.tox/.tmp/package/1/pgaas-1.1.0.zip py27 installed: DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support,atomicwrites==1.3.0,attrs==19.3.0,backports.shutil-get-terminal-size==1.0.0,bottle==0.12.7,certifi==2019.9.11,chardet==3.0.4,click==4.0,click-didyoumean==0.0.3,cloudify==4.2,cloudify-dsl-parser==4.2,cloudify-plugins-common==4.2,cloudify-rest-client==4.2,cloudify-script-plugin==1.5.1,colorama==0.3.3,configparser==4.0.2,contextlib2==0.6.0.post1,coverage==4.5.4,decorator==4.4.1,ecdsa==0.14.1,Fabric==1.13.1,funcsigs==1.0.2,idna==2.8,importlib-metadata==0.23,Jinja2==2.7.2,MarkupSafe==1.1.1,more-itertools==5.0.0,networkx==1.9.1,packaging==19.2,paramiko==1.18.3,pathlib2==2.3.5,pgaas==1.1.0,pika==0.9.14,pluggy==0.13.0,prettytable==0.7.2,proxy-tools==0.1.0,psycopg2==2.8.4,py==1.8.0,pycrypto==2.6.1,pyparsing==2.4.5,pytest==4.6.6,pytest-cov==2.8.1,PyYAML==3.10,requests==2.22.0,requests-toolbelt==0.9.1,retrying==1.3.3,scandir==1.10.0,six==1.13.0,urllib3==1.25.7,virtualenv==16.7.7,wagon==0.6.1,wcwidth==0.1.7,zipp==0.6.0 py27 run-test-pre: PYTHONHASHSEED='450921980' py27 run-test: commands[0] | pytest --junitxml xunit-results.xml --cov --cov-report=xml =============================================================================================================================== test session starts =============================================================================================================================== platform linux2 -- Python 2.7.15+, pytest-4.6.6, py-1.8.0, pluggy-0.13.0 cachedir: .tox/py27/.pytest_cache rootdir: ccsdk/plugins/pgaas plugins: cov-2.8.1 collected 7 items tests/test_plugin.py ....... [100%] ================================================================================================================================ warnings summary ================================================================================================================================= .tox/py27/local/lib/python2.7/site-packages/_pytest/mark/structures.py:335 ccsdk/plugins/pgaas/.tox/py27/local/lib/python2.7/site-packages/_pytest/mark/structures.py:335: PytestUnknownMarkWarning: Unknown pytest.mark.dependency - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html PytestUnknownMarkWarning, -- Docs: https://docs.pytest.org/en/latest/warnings.html ----------------------------------------------------------------------------------------------- generated xml file: ccsdk/plugins/pgaas/xunit-results.xml ----------------------------------------------------------------------------------------------- ---------- coverage: platform linux2, python 2.7.15-final-0 ---------- Coverage XML written to file coverage.xml ====================================================================================================================== 7 passed, 1 warnings in 6.89 seconds ======================================================================================================================= py36 inst-nodeps: ccsdk/plugins/pgaas/.tox/.tmp/package/1/pgaas-1.1.0.zip py36 installed: atomicwrites==1.3.0,attrs==19.3.0,bottle==0.12.7,certifi==2019.9.11,chardet==3.0.4,cloudify-common==5.0.5.dev1,coverage==4.5.4,decorator==4.4.1,idna==2.8,importlib-metadata==0.23,Jinja2==2.10,MarkupSafe==1.1.1,more-itertools==7.2.0,networkx==1.9.1,packaging==19.2,pgaas==1.1.0,pika==0.11.2,pluggy==0.13.0,ply==3.11,proxy-tools==0.1.0,psycopg2==2.8.4,py==1.8.0,pyasn1==0.4.7,pycryptodomex==3.9.3,pyparsing==2.4.5,pysmi==0.3.4,pysnmp==4.4.5,pytest==5.2.2,pytest-cov==2.8.1,PyYAML==3.10,requests==2.22.0,requests-toolbelt==0.8.0,retrying==1.3.3,six==1.13.0,urllib3==1.25.7,wcwidth==0.1.7,zipp==0.6.0 py36 run-test-pre: PYTHONHASHSEED='450921980' py36 run-test: commands[0] | pytest --junitxml xunit-results.xml --cov --cov-report=xml =============================================================================================================================== test session starts =============================================================================================================================== platform linux -- Python 3.6.8, pytest-5.2.2, py-1.8.0, pluggy-0.13.0 cachedir: .tox/py36/.pytest_cache rootdir: ccsdk/plugins/pgaas plugins: cov-2.8.1 collected 7 items tests/test_plugin.py .FF.FF. [100%] ==================================================================================================================================== FAILURES ===================================================================================================================================== _____________________________________________________________________________________________________________________________ test_add_pgaas_cluster ______________________________________________________________________________________________________________________________ monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7faecc6ab160> @pytest.mark.dependency(depends=['test_start']) def test_add_pgaas_cluster(monkeypatch): """ test add_pgaas_cluster() """ try: set_mock_context('test_add_pgaas_cluster', monkeypatch) > pgaas.pgaas_plugin.add_pgaas_cluster(args={}) tests/test_plugin.py:177: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pgaas/pgaas_plugin.py:485: in add_pgaas_cluster raise e pgaas/pgaas_plugin.py:477: in add_pgaas_cluster find_related_nodes('dcae.relationships.pgaas_cluster_uses_sshkeypair')) pgaas/pgaas_plugin.py:461: in getclusterinfo dbexecute_trunc_print(crr, "ALTER USER postgres WITH PASSWORD %s", (getpass(data, 'postgres', wfqdn, 'postgres'),)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ data = {'data': 'testpriv', 'hash': 'sha256', 'pubkey': 'testpub', 'ro': 'test-ro.bar.example.com', ...}, ident = 'postgres', hostport = 'test.bar.example.com', dbname = 'postgres' def getpass(data, ident, hostport, dbname): """ generate the password for a given user on a specific server """ m = hashlib.sha256() > m.update(ident) E TypeError: Unicode-objects must be encoded before hashing pgaas/pgaas_plugin.py:322: TypeError ------------------------------------------------------------------------------------------------------------------------------ Captured stdout call ------------------------------------------------------------------------------------------------------------------------------- ================ test_add_pgaas_cluster ================ 19:05:18 [WARNING] [mock-context-logger] add_pgaas_cluster() invoked 19:05:18 [WARNING] [mock-context-logger] Error: Unicode-objects must be encoded before hashing 19:05:18 [WARNING] [mock-context-logger] Stack: Traceback (most recent call last): File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 477, in add_pgaas_cluster find_related_nodes('dcae.relationships.pgaas_cluster_uses_sshkeypair')) File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 461, in getclusterinfo dbexecute_trunc_print(crr, "ALTER USER postgres WITH PASSWORD %s", (getpass(data, 'postgres', wfqdn, 'postgres'),)) File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 322, in getpass m.update(ident) TypeError: Unicode-objects must be encoded before hashing Error: Unicode-objects must be encoded before hashing Stack: Traceback (most recent call last): File "ccsdk/plugins/pgaas/tests/test_plugin.py", line 177, in test_add_pgaas_cluster pgaas.pgaas_plugin.add_pgaas_cluster(args={}) File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 485, in add_pgaas_cluster raise e File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 477, in add_pgaas_cluster find_related_nodes('dcae.relationships.pgaas_cluster_uses_sshkeypair')) File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 461, in getclusterinfo dbexecute_trunc_print(crr, "ALTER USER postgres WITH PASSWORD %s", (getpass(data, 'postgres', wfqdn, 'postgres'),)) File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 322, in getpass m.update(ident) TypeError: Unicode-objects must be encoded before hashing -------------------------------------------------------------------------------------------------------------------------------- Captured log call -------------------------------------------------------------------------------------------------------------------------------- WARNING mock-context-logger:logginginterface.py:39 add_pgaas_cluster() invoked WARNING mock-context-logger:pgaas_plugin.py:483 Error: Unicode-objects must be encoded before hashing WARNING mock-context-logger:pgaas_plugin.py:484 Stack: Traceback (most recent call last): File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 477, in add_pgaas_cluster find_related_nodes('dcae.relationships.pgaas_cluster_uses_sshkeypair')) File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 461, in getclusterinfo dbexecute_trunc_print(crr, "ALTER USER postgres WITH PASSWORD %s", (getpass(data, 'postgres', wfqdn, 'postgres'),)) File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 322, in getpass m.update(ident) TypeError: Unicode-objects must be encoded before hashing ________________________________________________________________________________________________________________________________ test_add_database ________________________________________________________________________________________________________________________________ monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7faecc4fba20> @pytest.mark.dependency(depends=['test_add_pgaas_cluster']) def test_add_database(monkeypatch): """ test add_database() """ try: set_mock_context('test_add_database', monkeypatch) > pgaas.pgaas_plugin.create_database(args={}) tests/test_plugin.py:192: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pgaas/pgaas_plugin.py:601: in create_database raise e pgaas/pgaas_plugin.py:545: in create_database descs = dbdescs(dbinfo, dbname) pgaas/pgaas_plugin.py:312: in dbdescs 'admin': onedesc(data, dbname, 'admin', 'rw'), pgaas/pgaas_plugin.py:303: in onedesc 'password': getpass(data, user, data['rw'], dbname) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ data = {'data': 'testpriv', 'hash': 'sha256', 'pubkey': 'testpub', 'ro': 'test-ro.bar.example.com', ...}, ident = 'testdb_admin', hostport = 'test.bar.example.com', dbname = 'testdb' def getpass(data, ident, hostport, dbname): """ generate the password for a given user on a specific server """ m = hashlib.sha256() > m.update(ident) E TypeError: Unicode-objects must be encoded before hashing pgaas/pgaas_plugin.py:322: TypeError ------------------------------------------------------------------------------------------------------------------------------ Captured stdout call ------------------------------------------------------------------------------------------------------------------------------- ================ test_add_database ================ 19:05:18 [WARNING] [mock-context-logger] create_database(testdb) 19:05:18 [WARNING] [mock-context-logger] Error: Unicode-objects must be encoded before hashing 19:05:18 [WARNING] [mock-context-logger] Stack: Traceback (most recent call last): File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 545, in create_database descs = dbdescs(dbinfo, dbname) File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 312, in dbdescs 'admin': onedesc(data, dbname, 'admin', 'rw'), File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 303, in onedesc 'password': getpass(data, user, data['rw'], dbname) File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 322, in getpass m.update(ident) TypeError: Unicode-objects must be encoded before hashing Error: Unicode-objects must be encoded before hashing Stack: Traceback (most recent call last): File "ccsdk/plugins/pgaas/tests/test_plugin.py", line 192, in test_add_database pgaas.pgaas_plugin.create_database(args={}) File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 601, in create_database raise e File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 545, in create_database descs = dbdescs(dbinfo, dbname) File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 312, in dbdescs 'admin': onedesc(data, dbname, 'admin', 'rw'), File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 303, in onedesc 'password': getpass(data, user, data['rw'], dbname) File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 322, in getpass m.update(ident) TypeError: Unicode-objects must be encoded before hashing -------------------------------------------------------------------------------------------------------------------------------- Captured log call -------------------------------------------------------------------------------------------------------------------------------- WARNING mock-context-logger:logginginterface.py:39 create_database(testdb) WARNING mock-context-logger:pgaas_plugin.py:599 Error: Unicode-objects must be encoded before hashing WARNING mock-context-logger:pgaas_plugin.py:600 Stack: Traceback (most recent call last): File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 545, in create_database descs = dbdescs(dbinfo, dbname) File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 312, in dbdescs 'admin': onedesc(data, dbname, 'admin', 'rw'), File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 303, in onedesc 'password': getpass(data, user, data['rw'], dbname) File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 322, in getpass m.update(ident) TypeError: Unicode-objects must be encoded before hashing ______________________________________________________________________________________________________________________________ test_update_database _______________________________________________________________________________________________________________________________ monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7faecc6546d8> @pytest.mark.dependency(depends=['test_add_database']) def test_update_database(monkeypatch): """ test update_database() """ try: ######################################################## # Subtle test implications regarding: update_database # # --------------------------------------------------- # # 1) update_database is a workflow and the context # # passed to it has 'nodes' attribute which is not # # not included in MockCloudifyContext # # 2) the 'nodes' attribute is a list of contexts so # # we will have to create a sub-context # # 3) update_database will iterate through each of the # # nodes contexts looking for the correct one # # 4) To identify the correct sub-context it will first# # check each sub-context for the existence of # # properties attribute # # 5) ****Mock_context internally saves properties as # # variable _properties and 'properties' is defined # # as @property...thus it is not recognized as an # # attribute...this will cause update_database to # # fail so we need to explicitly create properties # # properties attribute in the subcontext # ######################################################## #################### # Main context # #################### myctx = set_mock_context('test_update_database', monkeypatch) ########################################################### # Create subcontext and assign it to attribute properties # # in main context # ########################################################### mynode = set_mock_context('test_update_database_node', monkeypatch) # pylint: disable=protected-access mynode.properties = mynode._properties myctx.nodes = [mynode] > pgaas.pgaas_plugin.update_database(refctx=myctx) tests/test_plugin.py:255: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pgaas/pgaas_plugin.py:778: in update_database raise e pgaas/pgaas_plugin.py:745: in update_database descs = dbdescs(dbinfo, dbname) pgaas/pgaas_plugin.py:312: in dbdescs 'admin': onedesc(data, dbname, 'admin', 'rw'), pgaas/pgaas_plugin.py:303: in onedesc 'password': getpass(data, user, data['rw'], dbname) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ data = {'data': 'testpriv', 'hash': 'sha256', 'pubkey': 'testpub', 'ro': 'test-ro.bar.example.com', ...}, ident = 'testdb_admin', hostport = 'test.bar.example.com', dbname = 'testdb' def getpass(data, ident, hostport, dbname): """ generate the password for a given user on a specific server """ m = hashlib.sha256() > m.update(ident) E TypeError: Unicode-objects must be encoded before hashing pgaas/pgaas_plugin.py:322: TypeError ------------------------------------------------------------------------------------------------------------------------------ Captured stdout call ------------------------------------------------------------------------------------------------------------------------------- ================ test_update_database ================ ================ test_update_database_node ================ 19:05:18 [WARNING] [mock-context-logger] Error: Unicode-objects must be encoded before hashing 19:05:18 [WARNING] [mock-context-logger] Stack: Traceback (most recent call last): File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 745, in update_database descs = dbdescs(dbinfo, dbname) File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 312, in dbdescs 'admin': onedesc(data, dbname, 'admin', 'rw'), File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 303, in onedesc 'password': getpass(data, user, data['rw'], dbname) File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 322, in getpass m.update(ident) TypeError: Unicode-objects must be encoded before hashing Error: Unicode-objects must be encoded before hashing Stack: Traceback (most recent call last): File "ccsdk/plugins/pgaas/tests/test_plugin.py", line 255, in test_update_database pgaas.pgaas_plugin.update_database(refctx=myctx) File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 778, in update_database raise e File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 745, in update_database descs = dbdescs(dbinfo, dbname) File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 312, in dbdescs 'admin': onedesc(data, dbname, 'admin', 'rw'), File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 303, in onedesc 'password': getpass(data, user, data['rw'], dbname) File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 322, in getpass m.update(ident) TypeError: Unicode-objects must be encoded before hashing -------------------------------------------------------------------------------------------------------------------------------- Captured log call -------------------------------------------------------------------------------------------------------------------------------- WARNING mock-context-logger:pgaas_plugin.py:776 Error: Unicode-objects must be encoded before hashing WARNING mock-context-logger:pgaas_plugin.py:777 Stack: Traceback (most recent call last): File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 745, in update_database descs = dbdescs(dbinfo, dbname) File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 312, in dbdescs 'admin': onedesc(data, dbname, 'admin', 'rw'), File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 303, in onedesc 'password': getpass(data, user, data['rw'], dbname) File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 322, in getpass m.update(ident) TypeError: Unicode-objects must be encoded before hashing ______________________________________________________________________________________________________________________________ test_delete_database _______________________________________________________________________________________________________________________________ monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7faecc4fb780> @pytest.mark.dependency(depends=['test_update_database']) def test_delete_database(monkeypatch): """ test delete_database() """ try: set_mock_context('test_delete_database', monkeypatch) > pgaas.pgaas_plugin.delete_database(args={}) tests/test_plugin.py:270: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pgaas/pgaas_plugin.py:635: in delete_database raise e pgaas/pgaas_plugin.py:621: in delete_database with rootconn(dbinfo) as conn: pgaas/pgaas_plugin.py:290: in rootconn return doconn(rootdesc(data, dbname, initialpassword)) pgaas/pgaas_plugin.py:281: in rootdesc 'password': initialpassword if initialpassword else getpass(data, 'postgres', data['rw'], 'postgres') _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ data = {'data': 'testpriv', 'hash': 'sha256', 'pubkey': 'testpub', 'ro': 'test-ro.bar.example.com', ...}, ident = 'postgres', hostport = 'test.bar.example.com', dbname = 'postgres' def getpass(data, ident, hostport, dbname): """ generate the password for a given user on a specific server """ m = hashlib.sha256() > m.update(ident) E TypeError: Unicode-objects must be encoded before hashing pgaas/pgaas_plugin.py:322: TypeError ------------------------------------------------------------------------------------------------------------------------------ Captured stdout call ------------------------------------------------------------------------------------------------------------------------------- ================ test_delete_database ================ 19:05:18 [WARNING] [mock-context-logger] delete_database(testdb) 19:05:18 [WARNING] [mock-context-logger] Error: Unicode-objects must be encoded before hashing 19:05:18 [WARNING] [mock-context-logger] Stack: Traceback (most recent call last): File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 621, in delete_database with rootconn(dbinfo) as conn: File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 290, in rootconn return doconn(rootdesc(data, dbname, initialpassword)) File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 281, in rootdesc 'password': initialpassword if initialpassword else getpass(data, 'postgres', data['rw'], 'postgres') File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 322, in getpass m.update(ident) TypeError: Unicode-objects must be encoded before hashing Error: Unicode-objects must be encoded before hashing Stack: Traceback (most recent call last): File "ccsdk/plugins/pgaas/tests/test_plugin.py", line 270, in test_delete_database pgaas.pgaas_plugin.delete_database(args={}) File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 635, in delete_database raise e File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 621, in delete_database with rootconn(dbinfo) as conn: File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 290, in rootconn return doconn(rootdesc(data, dbname, initialpassword)) File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 281, in rootdesc 'password': initialpassword if initialpassword else getpass(data, 'postgres', data['rw'], 'postgres') File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 322, in getpass m.update(ident) TypeError: Unicode-objects must be encoded before hashing -------------------------------------------------------------------------------------------------------------------------------- Captured log call -------------------------------------------------------------------------------------------------------------------------------- WARNING mock-context-logger:logginginterface.py:39 delete_database(testdb) WARNING mock-context-logger:pgaas_plugin.py:633 Error: Unicode-objects must be encoded before hashing WARNING mock-context-logger:pgaas_plugin.py:634 Stack: Traceback (most recent call last): File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 621, in delete_database with rootconn(dbinfo) as conn: File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 290, in rootconn return doconn(rootdesc(data, dbname, initialpassword)) File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 281, in rootdesc 'password': initialpassword if initialpassword else getpass(data, 'postgres', data['rw'], 'postgres') File "ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py", line 322, in getpass m.update(ident) TypeError: Unicode-objects must be encoded before hashing ================================================================================================================================ warnings summary ================================================================================================================================= .tox/py36/lib/python3.6/site-packages/_pytest/mark/structures.py:325 ccsdk/plugins/pgaas/.tox/py36/lib/python3.6/site-packages/_pytest/mark/structures.py:325: PytestUnknownMarkWarning: Unknown pytest.mark.dependency - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html PytestUnknownMarkWarning, tests/test_plugin.py::test_add_pgaas_cluster tests/test_plugin.py::test_add_database tests/test_plugin.py::test_bad_add_database tests/test_plugin.py::test_bad_add_database tests/test_plugin.py::test_delete_database tests/test_plugin.py::test_rm_pgaas_cluster tests/test_plugin.py::test_rm_pgaas_cluster ccsdk/plugins/pgaas/pgaas/logginginterface.py:39: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead ctx.logger.warn(msg) tests/test_plugin.py::test_add_pgaas_cluster ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py:483: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead ctx.logger.warn("Error: {0}".format(e)) tests/test_plugin.py::test_add_pgaas_cluster ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py:484: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead ctx.logger.warn("Stack: {0}".format(traceback.format_exc())) tests/test_plugin.py::test_add_database tests/test_plugin.py::test_bad_add_database ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py:599: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead ctx.logger.warn("Error: {0}".format(e)) tests/test_plugin.py::test_add_database tests/test_plugin.py::test_bad_add_database ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py:600: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead ctx.logger.warn("Stack: {0}".format(traceback.format_exc())) tests/test_plugin.py::test_update_database ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py:776: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead ctx.logger.warn("Error: {0}".format(e)) tests/test_plugin.py::test_update_database ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py:777: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead ctx.logger.warn("Stack: {0}".format(traceback.format_exc())) tests/test_plugin.py::test_delete_database ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py:633: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead ctx.logger.warn("Error: {0}".format(e)) tests/test_plugin.py::test_delete_database ccsdk/plugins/pgaas/pgaas/pgaas_plugin.py:634: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead ctx.logger.warn("Stack: {0}".format(traceback.format_exc())) -- Docs: https://docs.pytest.org/en/latest/warnings.html ----------------------------------------------------------------------------------------------- generated xml file: ccsdk/plugins/pgaas/xunit-results.xml ----------------------------------------------------------------------------------------------- ----------- coverage: platform linux, python 3.6.8-final-0 ----------- Coverage XML written to file coverage.xml ==================================================================================================================== 4 failed, 3 passed, 18 warnings in 8.06s ===================================================================================================================== ERROR: InvocationError for command ccsdk/plugins/pgaas/.tox/py36/bin/pytest --junitxml xunit-results.xml --cov --cov-report=xml (exited with code 1) _____________________________________________________________________________________________________________________________________ summary _____________________________________________________________________________________________________________________________________ py27: commands succeeded ERROR: py36: commands failed