Bug 1310098 - externalusers function does not support pagination properly
externalusers function does not support pagination properly
Status: CLOSED WONTFIX
Product: Red Hat Storage Console
Classification: Red Hat
Component: core (Show other bugs)
2
Unspecified Unspecified
unspecified Severity unspecified
: ---
: 3
Assigned To: Timothy Asir
sds-qe-bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-19 07:47 EST by Martin Kudlej
Modified: 2017-03-23 00:06 EDT (History)
3 users (show)

See Also:
Fixed In Version: rhscon-ceph-0.0.23-1.el7scon.x86_64, rhscon-core-0.0.24-1.el7scon.x86_64, rhscon-ui-0.0.39-1.el7scon.noarch
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-03-23 00:06:10 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Martin Kudlej 2016-02-19 07:47:46 EST
Description of problem:
when user call:
/externalusers?search=test&pageno=1&pagesize=1
it returns more than one user.

Version-Release number of selected component (if applicable):
rhscon-core-0.0.8-4.el7.x86_64
rhscon-ceph-0.0.6-4.el7.x86_64
rhscon-ui-0.0.14-1.el7.noarch

How reproducible:
100%

Steps to Reproduce:
1. configure ldap
2. try to call externalusers with pagination parameters
Comment 2 Timothy Asir 2016-03-02 07:02:00 EST
Can you post here the output
Comment 3 Martin Kudlej 2016-03-04 06:05:15 EST
It seems that above example works with search=test but:

/externalusers?pageno=1&pagesize=1"
{"totalcount":4,"startindex":1,"endindex":1,"users":null}

/externalusers?pageno=1&pagesize=2" - only one user and there should be 2 users in result
{"totalcount":4,"startindex":1,"endindex":2,"users":[{"username":"admin","email":"","role":"","groups":[""],"type":1,"status":false,"firstname":"","lastname":"Administrator","notificationenabled":false}]}

Number of user is correct but user "admin" is first so I expect that he will be in 1st page:
/externalusers?pageno=2&pagesize=1"
{"totalcount":4,"startindex":2,"endindex":2,"users":[{"username":"admin","email":"","role":"","groups":[""],"type":1,"status":false,"firstname":"","lastname":"Administrator","notificationenabled":false}]}

also I see just 3 users and totalcount is 4:
{"totalcount":4,"startindex":1,"endindex":4,"users":[
* {"username":"admin","email":"","role":"","groups":[""],"type":1,"status":false,"firstname":"","lastname":"Administrator","notificationenabled":false},
* {"username":"testldap","email":"testldap@localhost.localdomain, testldap@example.com, testldap2@example.com","role":"","groups":[""],"type":1,"status":false,"firstname":"Test","lastname":"Ldap","notificationenabled":false},
* {"username":"testldap2","email":"testldap2@lab.eng.brq.redhat.com","role":"","groups":[""],"type":1,"status":false,"firstname":"test2","lastname":"last2","notificationenabled":false}]}

If numbers are not valid there should be error status return HTTP code instead of some default result. Not valid numbers for pagination:
- negative numbers
- zero
so queries like:
/externalusers?pageno=1&pagesize=-922
/externalusers?pageno=0&pagesize=90
/externalusers?pageno=0&pagesize=0
/externalusers?pageno=-10&pagesize=90

should return error status code.
Comment 4 Timothy Asir 2016-05-05 04:05:53 EDT
Patch sent to upstream for review: https://review.gerrithub.io/#/c/275285/
Comment 5 Martin Kudlej 2016-07-04 07:38:24 EDT
Tested with 
rhscon-ceph-0.0.29-1.el7scon.x86_64
rhscon-core-0.0.29-1.el7scon.x86_64
rhscon-core-selinux-0.0.29-1.el7scon.noarch
rhscon-ui-0.0.43-1.el7scon.noarch
queries are OK, but there is not ERROR message in case of incorrect query params. ->FailedQA

Note You need to log in before you can comment on or make changes to this bug.