Project

General

Profile

Bug #42063

dashboard/iscsi: _update_iscsi_target fails in run-tox-mgr-dashboard

Added by Willem Jan Withagen over 4 years ago. Updated almost 3 years ago.

Status:
Duplicate
Priority:
Urgent
Assignee:
-
Category:
Component - iSCSI
Target version:
% Done:

0%

Source:
Tags:
Backport:
Regression:
Yes
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

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.

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

Related issues

Duplicates Dashboard - Bug #42187: mgr/dashboard: dashboard test fails due to adaptation of iscsi response Resolved

History

#1 Updated by Kefu Chai over 4 years ago

  • Description updated (diff)

it's not related to python version. this very test is failing randomly in jenkins "make check" runs.

tests/test_iscsi.py .....F

____________________ IscsiTest.test_change_client_password _____________________

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

    @mock.patch('dashboard.controllers.iscsi.IscsiTarget._validate_image')
    def test_change_client_password(self, _validate_image_mock):
        target_iqn = "iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw5" 
        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['clients'][0]['auth']['password'] = 'mynewiscsipassword'
        response = copy.deepcopy(iscsi_target_response)
        response['target_iqn'] = target_iqn
        response['clients'][0]['auth']['password'] = 'mynewiscsipassword'
>       self._update_iscsi_target(create_request, update_request, response)

tests/test_iscsi.py:191: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
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_change_client_password>
msg = "expected body:\n{'acl_enabled': True, 'info': {'num_sessions': 0}, 'target_controls': {}, 'groups': [{'disks': [{'ima...user:rbd'}, {u'pool': u'rbd', u'image': u'lun2', u'controls': {u'max_data_area_mb': 128}, u'backstore': u'user:rbd'}]}" 

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

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

.tox/py27/local/lib/python2.7/site-packages/cheroot/test/webtest.py:251: AssertionError

#2 Updated by Kefu Chai over 4 years ago

  • Status changed from New to 12
  • Priority changed from Normal to High

#3 Updated by Kefu Chai over 4 years ago

  • Assignee set to Ricardo Marques

Ricardo, could you please take a look?

#4 Updated by Kefu Chai over 4 years ago

  • Subject changed from dashboard/iscsi: Difference between a python 2.7 and 3.6 run of run-tox-mgr-dashboard to dashboard/iscsi: _update_iscsi_target fails in run-tox-mgr-dashboard
platform linux2 -- Python 2.7.12, pytest-3.10.1, py-1.8.0, pluggy-0.13.0
rootdir: /home/jenkins-build/build/workspace/ceph-pull-requests/src/pybind/mgr/dashboard, inifile: tox.ini
plugins: instafail-0.4.1, cov-2.8.1
collected 278 items

...

tests/test_iscsi.py ..F

______________________ IscsiTest.test_add_client_to_group ______________________

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

    @mock.patch('dashboard.controllers.iscsi.IscsiTarget._validate_image')
    def test_add_client_to_group(self, _validate_image_mock):
        target_iqn = "iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw13" 
        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['clients'].append(
            {
                "luns": [],
                "client_iqn": "iqn.1994-05.com.redhat:rh7-client3",
                "auth": {
                    "password": None,
                    "user": None,
                    "mutual_password": None,
                    "mutual_user": None}
            })
        update_request['groups'][0]['members'].append('iqn.1994-05.com.redhat:rh7-client3')
        response = copy.deepcopy(iscsi_target_response)
        response['target_iqn'] = target_iqn
        response['clients'].append(
            {
                "luns": [],
                "client_iqn": "iqn.1994-05.com.redhat:rh7-client3",
                "auth": {
                    "password": None,
                    "user": None,
                    "mutual_password": None,
                    "mutual_user": None},
                "info": {
                    "alias": "",
                    "ip_address": [],
                    "state": {}
                }
            })
        response['groups'][0]['members'].append('iqn.1994-05.com.redhat:rh7-client3')
>       self._update_iscsi_target(create_request, update_request, response)

tests/test_iscsi.py:322: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
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_client_to_group>
msg = "expected body:\n{'info': {'num_sessions': 0}, 'target_iqn': 'iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw13', 'target_co...ssword': None, u'password': None, u'user': None}, u'luns': [], u'client_iqn': u'iqn.1994-05.com.redhat:rh7-client3'}]}" 

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

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

#5 Updated by Kefu Chai over 4 years ago

  • Priority changed from High to Urgent

#6 Updated by Kefu Chai over 4 years ago

  • Related to Bug #42187: mgr/dashboard: dashboard test fails due to adaptation of iscsi response added

#7 Updated by Ricardo Marques over 4 years ago

#8 Updated by Ricardo Marques over 4 years ago

  • Assignee changed from Ricardo Marques to Ricardo Dias

Ricardo Dias is now working on this.

See https://tracker.ceph.com/issues/42187?#note-7 for more info.

#9 Updated by Ricardo Marques over 4 years ago

  • Assignee deleted (Ricardo Dias)

#10 Updated by Ricardo Marques over 4 years ago

  • Related to deleted (Bug #42187: mgr/dashboard: dashboard test fails due to adaptation of iscsi response)

#11 Updated by Ricardo Marques over 4 years ago

  • Duplicates Bug #42187: mgr/dashboard: dashboard test fails due to adaptation of iscsi response added

#12 Updated by Ricardo Marques over 4 years ago

  • Status changed from 12 to Duplicate

#13 Updated by Ernesto Puerta almost 3 years ago

  • Project changed from mgr to Dashboard
  • Category changed from 141 to Component - iSCSI

Also available in: Atom PDF