Project

General

Profile

Bug #42063

Updated by Kefu Chai over 1 year ago

Note: This is on FreeBSD.

During a run-tox-mgr-dashboard there are differences in the expected json out when run under python3.6.
Python2.7 does not seem te have that problem.

<pre>
More tests show the same failure.
The actual response does not have an info: {block}, which btw seems empty.

1/5 Test #1: run-tox-mgr-dashboard ............***Failed 186.57 sec
Requirement already satisfied: tox in /tmp/jenkins-master/mgr-dashboard-virtualenv/lib/python3.6/site-packages (3.14.0)
Requirement already satisfied: filelock<4,>=3.0.0 in /tmp/jenkins-master/mgr-dashboard-virtualenv/lib/python3.6/site-packages (from tox) (3.0.12)
Requirement already satisfied: six<2,>=1.0.0 in /tmp/jenkins-master/mgr-dashboard-virtualenv/lib/python3.6/site-packages (from tox) (1.11.0)
Requirement already satisfied: packaging>=14 in /tmp/jenkins-master/mgr-dashboard-virtualenv/lib/python3.6/site-packages (from tox) (19.2)
Requirement already satisfied: toml>=0.9.4 in /tmp/jenkins-master/mgr-dashboard-virtualenv/lib/python3.6/site-packages (from tox) (0.10.0)
Requirement already satisfied: pluggy<1,>=0.12.0 in /tmp/jenkins-master/mgr-dashboard-virtualenv/lib/python3.6/site-packages (from tox) (0.13.0)
Requirement already satisfied: py<2,>=1.4.17 in /tmp/jenkins-master/mgr-dashboard-virtualenv/lib/python3.6/site-packages (from tox) (1.8.0)
Requirement already satisfied: virtualenv>=14.0.0 in /tmp/jenkins-master/mgr-dashboard-virtualenv/lib/python3.6/site-packages (from tox) (16.7.5)
Requirement already satisfied: importlib-metadata<1,>=0.12; python_version < "3.8" in /tmp/jenkins-master/mgr-dashboard-virtualenv/lib/python3.6/site-packages (from tox) (0.23)
Requirement already satisfied: pyparsing>=2.0.2 in /tmp/jenkins-master/mgr-dashboard-virtualenv/lib/python3.6/site-packages (from packaging>=14->tox) (2.4.2)
Requirement already satisfied: zipp>=0.5 in /tmp/jenkins-master/mgr-dashboard-virtualenv/lib/python3.6/site-packages (from importlib-metadata<1,>=0.12; python_version < "3.8"->tox) (0.6.0)
Requirement already satisfied: more-itertools in /tmp/jenkins-master/mgr-dashboard-virtualenv/lib/python3.6/site-packages (from zipp>=0.5->importlib-metadata<1,>=0.12; python_version < "3.8"->tox) (4.1.0)
py3 installed: -f /home/jenkins/workspace/ceph-master36/src/pybind/mgr/dashboard/wheelhouse,asn1crypto==0.24.0,atomicwrites==1.3.0,attrs==19.1.0,backports.functools-lru-cache==1.5,bcrypt==3.1.4,certifi==2019.9.11,cffi==1.12.3,chardet==3.0.4,cheroot==6.5.8,CherryPy==13.1.0,coverage==4.5.4,cryptography==2.7,defusedxml==0.5.0,idna==2.7,importlib-metadata==0.23,isodate==0.6.0,jaraco.functools==2.0,lxml==4.4.1,more-itertools==4.1.0,pkgconfig==1.5.1,pluggy==0.13.0,portend==2.5,py==1.8.0,pycparser==2.19,PyJWT==1.6.4,pyOpenSSL==17.5.0,pytest==3.10.1,pytest-cov==2.7.1,pytest-instafail==0.4.1,python3-saml==1.4.1,pytz==2019.2,repoze.lru==0.7,requests==2.20.0,Routes==2.4.1,six==1.11.0,sqlite3==0.0.0,tempora==1.14.1,urllib3==1.24.3,xmlsec==1.3.3,zipp==0.6.0
py3 run-test-pre: PYTHONHASHSEED='1950973134'
py3 run-test: commands[0] | pytest
============================= test session starts ==============================
platform freebsd13 -- Python 3.6.9, pytest-3.10.1, py-1.8.0, pluggy-0.13.0
rootdir: /home/jenkins/workspace/ceph-master36/src/pybind/mgr/dashboard, inifile: tox.ini
plugins: cov-2.7.1, instafail-0.4.1
collected 276 items

tools.py ..... [ 1%]
services/ceph_service.py .. [ 2%]
services/rgw_client.py .. [ 3%]
tests/helper.py . [ 3%]
tests/test_access_control.py ........................................... [ 19%]
........... [ 23%]
tests/test_api_auditing.py ........ [ 26%]
tests/test_cephfs.py .... [ 27%]
tests/test_controllers.py .................... [ 34%]
tests/test_docs.py ........ [ 37%]
tests/test_erasure_code_profile.py .... [ 39%]
tests/test_exceptions.py ............ [ 43%]
tests/test_feature_toggles.py .. [ 44%]
tests/test_ganesha.py ............ [ 48%]
tests/test_grafana.py ..... [ 50%]
tests/test_host.py .... [ 51%]
tests/test_iscsi.py ....F

___________________________ IscsiTest.test_add_disk ____________________________

self = <dashboard.tests.test_iscsi.IscsiTest testMethod=test_add_disk>
_validate_image_mock = <MagicMock name='_validate_image' id='34470271800'>

@mock.patch('dashboard.controllers.iscsi.IscsiTarget._validate_image')
def test_add_disk(self, _validate_image_mock):
target_iqn = "iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7"
create_request = copy.deepcopy(iscsi_target_request)
create_request['target_iqn'] = target_iqn
update_request = copy.deepcopy(create_request)
update_request['new_target_iqn'] = target_iqn
update_request['disks'].append(
{
"image": "lun3",
"pool": "rbd",
"controls": {},
"backstore": "user:rbd"
})
update_request['clients'][0]['luns'].append({"image": "lun3", "pool": "rbd"})
response = copy.deepcopy(iscsi_target_response)
response['target_iqn'] = target_iqn
response['disks'].append(
{
"image": "lun3",
"pool": "rbd",
"controls": {},
"backstore": "user:rbd"
})
response['clients'][0]['luns'].append({"image": "lun3", "pool": "rbd"})
> self._update_iscsi_target(create_request, update_request, response)

tests/test_iscsi.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_iscsi.py:372: in _update_iscsi_target
self.assertJsonBody(response)
tests/__init__.py:231: in assertJsonBody
self._handlewebError(msg)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <dashboard.tests.test_iscsi.IscsiTest testMethod=test_add_disk>
msg = "expected body:\n{'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7', 'portals': [{'host': 'node2', 'ip': '10....', 'image': 'lun2'}], 'members': ['iqn.1994-05.com.redhat:rh7-client2']}], 'target_controls': {}, 'acl_enabled': True}"

def _handlewebError(self, msg):
print('')
print(' ERROR: %s' % msg)

if not self.interactive:
> raise self.failureException(msg)
E AssertionError: expected body:
E {'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7', 'portals': [{'host': 'node2', 'ip': '10.0.2.15'}, {'host': 'node2', 'ip': '192.168.100.202'}, {'host': 'node3', 'ip': '192.168.100.203'}], 'disks': [{'pool': 'rbd', 'image': 'lun1', 'backstore': 'user:rbd', 'controls': {'max_data_area_mb': 128}}, {'pool': 'rbd', 'image': 'lun2', 'backstore': 'user:rbd', 'controls': {'max_data_area_mb': 128}}, {'image': 'lun3', 'pool': 'rbd', 'controls': {}, 'backstore': 'user:rbd'}], 'clients': [{'client_iqn': 'iqn.1994-05.com.redhat:rh7-client', 'luns': [{'pool': 'rbd', 'image': 'lun1'}, {'image': 'lun3', 'pool': 'rbd'}], 'auth': {'user': 'myiscsiusername1', 'password': 'myiscsipassword1', 'mutual_password': 'myiscsipassword2', 'mutual_user': 'myiscsiusername2'}, 'info': {'alias': '', 'ip_address': [], 'state': {}}}, {'client_iqn': 'iqn.1994-05.com.redhat:rh7-client2', 'luns': [], 'auth': {'user': 'myiscsiusername3', 'password': 'myiscsipassword3', 'mutual_password': 'myiscsipassword4', 'mutual_user': 'myiscsiusername4'}, 'info': {'alias': '', 'ip_address': [], 'state': {}}}], 'acl_enabled': True, 'groups': [{'group_id': 'mygroup', 'disks': [{'pool': 'rbd', 'image': 'lun2'}], 'members': ['iqn.1994-05.com.redhat:rh7-client2']}], 'target_controls': {}, 'info': {'num_sessions': 0}}
E
E actual body:
E {'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7', 'portals': [{'host': 'node2', 'ip': '10.0.2.15'}, {'host': 'node2', 'ip': '192.168.100.202'}, {'host': 'node3', 'ip': '192.168.100.203'}], 'disks': [{'pool': 'rbd', 'image': 'lun1', 'controls': {'max_data_area_mb': 128}, 'backstore': 'user:rbd'}, {'pool': 'rbd', 'image': 'lun2', 'controls': {'max_data_area_mb': 128}, 'backstore': 'user:rbd'}, {'pool': 'rbd', 'image': 'lun3', 'controls': {}, 'backstore': 'user:rbd'}], 'clients': [{'client_iqn': 'iqn.1994-05.com.redhat:rh7-client', 'luns': [{'pool': 'rbd', 'image': 'lun1'}, {'pool': 'rbd', 'image': 'lun3'}], 'auth': {'user': 'myiscsiusername1', 'password': 'myiscsipassword1', 'mutual_user': 'myiscsiusername2', 'mutual_password': 'myiscsipassword2'}}, {'client_iqn': 'iqn.1994-05.com.redhat:rh7-client2', 'luns': [], 'auth': {'user': 'myiscsiusername3', 'password': 'myiscsipassword3', 'mutual_user': 'myiscsiusername4', 'mutual_password': 'myiscsipassword4'}}], 'groups': [{'group_id': 'mygroup', 'disks': [{'pool': 'rbd', 'image': 'lun2'}], 'members': ['iqn.1994-05.com.redhat:rh7-client2']}], 'target_controls': {}, 'acl_enabled': True}

.tox/py3/lib/python3.6/site-packages/cheroot/test/webtest.py:252: AssertionError
----------------------------- Captured stdout call -----------------------------

ERROR: expected body:
{'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7', 'portals': [{'host': 'node2', 'ip': '10.0.2.15'}, {'host': 'node2', 'ip': '192.168.100.202'}, {'host': 'node3', 'ip': '192.168.100.203'}], 'disks': [{'pool': 'rbd', 'image': 'lun1', 'backstore': 'user:rbd', 'controls': {'max_data_area_mb': 128}}, {'pool': 'rbd', 'image': 'lun2', 'backstore': 'user:rbd', 'controls': {'max_data_area_mb': 128}}, {'image': 'lun3', 'pool': 'rbd', 'controls': {}, 'backstore': 'user:rbd'}], 'clients': [{'client_iqn': 'iqn.1994-05.com.redhat:rh7-client', 'luns': [{'pool': 'rbd', 'image': 'lun1'}, {'image': 'lun3', 'pool': 'rbd'}], 'auth': {'user': 'myiscsiusername1', 'password': 'myiscsipassword1', 'mutual_password': 'myiscsipassword2', 'mutual_user': 'myiscsiusername2'}, 'info': {'alias': '', 'ip_address': [], 'state': {}}}, {'client_iqn': 'iqn.1994-05.com.redhat:rh7-client2', 'luns': [], 'auth': {'user': 'myiscsiusername3', 'password': 'myiscsipassword3', 'mutual_password': 'myiscsipassword4', 'mutual_user': 'myiscsiusername4'}, 'info': {'alias': '', 'ip_address': [], 'state': {}}}], 'acl_enabled': True, 'groups': [{'group_id': 'mygroup', 'disks': [{'pool': 'rbd', 'image': 'lun2'}], 'members': ['iqn.1994-05.com.redhat:rh7-client2']}], 'target_controls': {}, 'info': {'num_sessions': 0}}

actual body:
{'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7', 'portals': [{'host': 'node2', 'ip': '10.0.2.15'}, {'host': 'node2', 'ip': '192.168.100.202'}, {'host': 'node3', 'ip': '192.168.100.203'}], 'disks': [{'pool': 'rbd', 'image': 'lun1', 'controls': {'max_data_area_mb': 128}, 'backstore': 'user:rbd'}, {'pool': 'rbd', 'image': 'lun2', 'controls': {'max_data_area_mb': 128}, 'backstore': 'user:rbd'}, {'pool': 'rbd', 'image': 'lun3', 'controls': {}, 'backstore': 'user:rbd'}], 'clients': [{'client_iqn': 'iqn.1994-05.com.redhat:rh7-client', 'luns': [{'pool': 'rbd', 'image': 'lun1'}, {'pool': 'rbd', 'image': 'lun3'}], 'auth': {'user': 'myiscsiusername1', 'password': 'myiscsipassword1', 'mutual_user': 'myiscsiusername2', 'mutual_password': 'myiscsipassword2'}}, {'client_iqn': 'iqn.1994-05.com.redhat:rh7-client2', 'luns': [], 'auth': {'user': 'myiscsiusername3', 'password': 'myiscsipassword3', 'mutual_user': 'myiscsiusername4', 'mutual_password': 'myiscsipassword4'}}], 'groups': [{'group_id': 'mygroup', 'disks': [{'pool': 'rbd', 'image': 'lun2'}], 'members': ['iqn.1994-05.com.redhat:rh7-client2']}], 'target_controls': {}, 'acl_enabled': True}
----------------------------- Captured stderr call -----------------------------
DEBUG:dashboard:TM: created Task(ns=iscsi/target/create, md={'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7'})
INFO:dashboard:TM: running Task(ns=iscsi/target/create, md={'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7'})
DEBUG:dashboard:TEX: executing task Task(ns=iscsi/target/create, md={'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7'})
DEBUG:dashboard:EX: successfully finished task: Task(ns=iscsi/target/create, md={'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7'})
DEBUG:dashboard:TK: execution of Task(ns=iscsi/target/create, md={'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7'}) finished in: 0.001971006393432617 s
DEBUG:dashboard:NQ: processing queue: 1
INFO:cherrypy.access.34483629192:127.0.0.1 - - [26/Sep/2019:10:49:15] "POST /api/iscsi/target HTTP/1.1" 201 4 "" ""
INFO:dashboard:TM: finished Task(ns=iscsi/target/create, md={'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7'})
INFO:dashboard:task finished immediately
DEBUG:dashboard:TM: created Task(ns=iscsi/target/edit, md={'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7'})
INFO:dashboard:TM: running Task(ns=iscsi/target/edit, md={'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7'})
DEBUG:dashboard:TEX: executing task Task(ns=iscsi/target/edit, md={'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7'})
DEBUG:dashboard:EX: successfully finished task: Task(ns=iscsi/target/edit, md={'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7'})
DEBUG:dashboard:TK: execution of Task(ns=iscsi/target/edit, md={'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7'}) finished in: 0.002953767776489258 s
INFO:cherrypy.access.34483629192:127.0.0.1 - - [26/Sep/2019:10:49:15] "PUT /api/iscsi/target/iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7 HTTP/1.1" 200 4 "" ""
DEBUG:dashboard:NQ: processing queue: 1
INFO:cherrypy.access.34483629192:127.0.0.1 - - [26/Sep/2019:10:49:15] "GET /api/iscsi/target/iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7 HTTP/1.1" 200 1156 "" ""
INFO:dashboard:TM: finished Task(ns=iscsi/target/edit, md={'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7'})
------------------------------ Captured log call -------------------------------
tools.py 440 DEBUG TM: created Task(ns=iscsi/target/create, md={'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7'})
tools.py 442 INFO TM: running Task(ns=iscsi/target/create, md={'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7'})
tools.py 545 DEBUG TEX: executing task Task(ns=iscsi/target/create, md={'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7'})
tools.py 526 DEBUG EX: successfully finished task: Task(ns=iscsi/target/create, md={'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7'})
tools.py 615 DEBUG TK: execution of Task(ns=iscsi/target/create, md={'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7'}) finished in: 0.001971006393432617 s
tools.py 381 DEBUG NQ: processing queue: 1
_cplogging.py 293 INFO 127.0.0.1 - - [26/Sep/2019:10:49:15] "POST /api/iscsi/target HTTP/1.1" 201 4 "" ""
tools.py 418 INFO TM: finished Task(ns=iscsi/target/create, md={'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7'})
__init__.py 148 INFO task finished immediately
tools.py 440 DEBUG TM: created Task(ns=iscsi/target/edit, md={'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7'})
tools.py 442 INFO TM: running Task(ns=iscsi/target/edit, md={'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7'})
tools.py 545 DEBUG TEX: executing task Task(ns=iscsi/target/edit, md={'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7'})
tools.py 526 DEBUG EX: successfully finished task: Task(ns=iscsi/target/edit, md={'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7'})
tools.py 615 DEBUG TK: execution of Task(ns=iscsi/target/edit, md={'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7'}) finished in: 0.002953767776489258 s
_cplogging.py 293 INFO 127.0.0.1 - - [26/Sep/2019:10:49:15] "PUT /api/iscsi/target/iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7 HTTP/1.1" 200 4 "" ""
tools.py 381 DEBUG NQ: processing queue: 1
_cplogging.py 293 INFO 127.0.0.1 - - [26/Sep/2019:10:49:15] "GET /api/iscsi/target/iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7 HTTP/1.1" 200 1156 "" ""
tools.py 418 INFO TM: finished Task(ns=iscsi/target/edit, md={'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw7'})

tests/test_iscsi.py ..F
</pre>

Back