New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qa/suites/rados/rest: test restful mgr module #15604

Merged
merged 3 commits into from Jun 12, 2017

Conversation

Projects
None yet
2 participants
@liewegas
Member

liewegas commented Jun 9, 2017

The problem is this fails on trusty because requests doesn't support the json
thing

2017-06-09T16:51:56.648 INFO:tasks.workunit.client.a.smithi063.stderr:Traceback (most recent call last):
2017-06-09T16:51:56.649 INFO:tasks.workunit.client.a.smithi063.stderr:  File "/home/ubuntu/cephtest/clone.client.a/qa/workunits/rest/test_mgr_rest_api.py", line 21, in 
2017-06-09T16:51:56.651 INFO:tasks.workunit.client.a.smithi063.stderr:    request = requests.post(addr + '/pool?wait=yes', json={'name': 'supertestfriends', 'pg_num': 128}, verify=False, auth=auth)
2017-06-09T16:51:56.651 INFO:tasks.workunit.client.a.smithi063.stderr:  File "/usr/lib/python2.7/dist-packages/requests/api.py", line 88, in post
2017-06-09T16:51:56.658 INFO:tasks.workunit.client.a.smithi063.stderr:    return request('post', url, data=data, **kwargs)
2017-06-09T16:51:56.658 INFO:tasks.workunit.client.a.smithi063.stderr:  File "/usr/lib/python2.7/dist-packages/requests/api.py", line 44, in request
2017-06-09T16:51:56.658 INFO:tasks.workunit.client.a.smithi063.stderr:    return session.request(method=method, url=url, **kwargs)
2017-06-09T16:51:56.658 INFO:tasks.workunit.client.a.smithi063.stderr:TypeError: request() got an unexpected keyword argument 'json'

and/or the urllib3 thing doesn't work:

2017-06-09T16:36:44.341 INFO:tasks.workunit.client.a.smithi063.stderr:Traceback (most recent call last):
2017-06-09T16:36:44.341 INFO:tasks.workunit.client.a.smithi063.stderr:  File "/home/ubuntu/cephtest/clone.client.a/qa/workunits/rest/test_mgr_rest_api.py", line 8, in 
2017-06-09T16:36:44.341 INFO:tasks.workunit.client.a.smithi063.stderr:    from requests.packages.urllib3.exceptions import InsecureRequestWarning
2017-06-09T16:36:44.341 INFO:tasks.workunit.client.a.smithi063.stderr:ImportError: No module named packages.urllib3.exceptions
@liewegas

This comment has been minimized.

@liewegas

This comment has been minimized.

Member

liewegas commented Jun 9, 2017

Just restricting the test to centos for now.

@liewegas liewegas requested a review from b-ranto Jun 9, 2017

@liewegas

This comment has been minimized.

Member

liewegas commented Jun 9, 2017

retest this please

@b-ranto

lgtm, the test run does show the expected output.

@b-ranto

This comment has been minimized.

Contributor

b-ranto commented Jun 12, 2017

As long as those two denials go, you should be able to avoid them quite easily. You can use data=json.dumps({'name': 'supertestfriends', 'pg_num': 128}) keyword argument instead of json={'name': 'supertestfriends', 'pg_num': 128} but you need to import json module first.

The second one (the failed import statement) can be just removed or made into

try:
  from requests.packages.urllib3.exceptions import InsecureRequestWarning
  requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)
except:
  pass

statement since that only removes an annoying warning in current systems but does not affect the functionality of the script.

liewegas added some commits Jun 9, 2017

qa/suites/rados/rest/mgr-restful: test restful module
Signed-off-by: Sage Weil <sage@redhat.com>
qa/workunits/rest/test_mgr_rest_api.py: tolerate old distros
Work with older requests and/or missing urllib3.

Signed-off-by: Sage Weil <sage@redhat.com>
@liewegas

This comment has been minimized.

Member

liewegas commented Jun 12, 2017

updated, and removed the distro restriction.. i'll run this through and make sure it behaves on trusty and xenial!

@liewegas

This comment has been minimized.

Member

liewegas commented Jun 12, 2017

next problem: on trusty,

2017-06-12 16:34:29.815205 7f2e0d7ae700  0 mgr[restful] Traceback (most recent call last):
  File "/usr/lib/ceph/mgr/restful/module.py", line 233, in serve
    self._serve()
  File "/usr/lib/ceph/mgr/restful/module.py", line 288, in _serve
    hooks = lambda: [ErrorHook()],
  File "/usr/lib/python2.7/dist-packages/pecan/__init__.py", line 72, in make_app
    app = Pecan(root, **kw)
  File "/usr/lib/python2.7/dist-packages/pecan/core.py", line 211, in __init__
    key=operator.attrgetter('priority')
TypeError: 'function' object is not iterable

from the mgr.
/a/sage-2017-06-12_16:22:35-rados-master---basic-smithi/1280052

qa/suites/rados/rest/mgr-restful: test on centos
Signed-off-by: Sage Weil <sage@redhat.com>
@liewegas

This comment has been minimized.

Member

liewegas commented Jun 12, 2017

merging with the centos restriction for now, and opened http://tracker.ceph.com/issues/20258

@liewegas liewegas merged commit b98fad9 into ceph:master Jun 12, 2017

0 of 3 checks passed

Signed-off-by checking if commits are signed
Details
Unmodified Submodules checking if PR has modified submodules
Details
make check running make check
Details

@liewegas liewegas deleted the liewegas:wip-rest-test-qa branch Jun 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment