Closed Bug 423637 Opened 17 years ago Closed 16 years ago

python xmlrpc client (contrib) is broken

Categories

(Testopia :: API, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: csabakoncz, Assigned: dmalcolm)

References

()

Details

Attachments

(3 files, 1 obsolete file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12 Build Identifier: 2 beta Landfill Testopia 2 (http://landfill.bugzilla.org/testopia2) installation is not accessible via XML-RPC. Reproducible: Always Steps to Reproduce: 1. Try to get test case with id=5 with one of the XML-RPC clients. Using python, my test code looks like this: from testopia import Testopia t = Testopia('csabakoncz@gmail.com', ******, host='landfill.bugzilla.org', resource='testopia2/tr_xmlrpc.cgi') tc = t.testcase_get() print tc Actual Results: C:\cko\testopia2\testopia\contrib\drivers\python>python cko_landfill.py Error while executing cmd 'TestCase.get(5)' --> <ProtocolError for csabakoncz@gmail.com:******@landfill.bugzilla.org:80/testopia2/tr_xmlrpc.cgi: 500 Internal Server Error> None Expected Results: A testcase instance or a meaningful error message.
This is working with the perl driver: perl client.pl --uri http://landfill.mozilla.org/testopia2/tr_xmlrpc.cgi --login ghendricks@novell.com --password **** Login successful. Calling: 'TestCase.get', 278 The results are: $VAR1 = { 'author_id' => '11687', 'script' => '', 'version' => '1', 'sortkey' => '248', 'estimated_time' => '00:00:00', 'case_id' => '278', 'case_status_id' => '2', 'default_tester_id' => '11687', 'priority_id' => '1', 'requirement' => 'dfg', 'category_id' => '12', 'creation_date' => '2006-11-07 01:33:51', 'summary' => 'Testing', 'text' => { 'breakdown' => '', 'setup' => '', 'effect' => 'login to the client <br>', 'version' => '1', 'action' => 'Test the user name &amp; password', 'author' => 'Sharmila Manoharaj' }, 'isautomated' => '0', 'arguments' => '', 'alias' => '' }; I think you need to pass an id of a test case to get in your case.
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → WORKSFORME
Unfortunately my Perl skills are not enough to run the test above. (was unable to install XMLRPC::Lite on a machine where I have no superuser privileges) I re-checked my Python example and it still fails (sorry: my snippet was incorrect, as I did use a test ID also on the first try). I ran a test with the Java client and that fails in a similar manner.
Please attach a wireshark trace showing the problem. http://www.wireshark.org/
Status: RESOLVED → UNCONFIRMED
Resolution: WORKSFORME → ---
Accessing landfill Testopia2 with Perl xmlrpc client was successful.
Python client fails seemingly because it tries to use HTTP Basic authentication (Perl version first invokes User.login, stores the cookie, and so on) I do not know how to get the Python xmlrpclib do the same thing.
The python client code is unsupported (for reference only), and yes, it's broken -- sigh. The solution would be to port the User.login stuff from perl to python. Since the python code is not supported, I need to close this bug -- sorry.
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago17 years ago
Resolution: --- → WONTFIX
Summary: xmlrpc does not work with landfill installation → python xmlrpc client (unsupported) is broken
Cookies are not supported by default by the Apache XML-RPC implementation used by the Java client. (see http://ws.apache.org/xmlrpc/advanced.html) So the Java client can have this same bug filed.
The java client is also unsupported. That is, entering a bug against it wouldn't do any good -- sorry.
Attached is a work-in-progress patch that makes this work in an analagous way to the perl helper: login and get a cookie first, and stash it somewhere. Change of API; takes different constructor parameters. This works, but currently requires the SafeCookieTransport class from Will Woods' python module for talking to Red Hat's XML-RPC bugzilla implementation. Hopefully we can get this split out somehow.
Thanks, Dave. I can reopen and assign to you, if you're willing....
Status: RESOLVED → UNCONFIRMED
Resolution: WONTFIX → ---
Assignee: ghendricks → dmalcolm
Status: UNCONFIRMED → NEW
Ever confirmed: true
Thanks for taking this, Dave.
Attached patch Updated patchSplinter Review
This version of the patch: - embeds a copy of Will Woods' SafeCookieTransport code (in turn, based on Python's xmlrpclib code) - adds a config file system so that you don't have to embed your password in the script - adds a TestopiaXmlrpcError class and raises this when exceptions occur, rather than simply intercepting and printing errors - add wrappers for Build.check_build, Environment.check_environment, Product.check_product - add a unit test suite (invoke by running the file directly from command-line; you'll need to write a config file to tell it which testopia instance to point at)
Attachment #326026 - Attachment is obsolete: true
Summary: python xmlrpc client (unsupported) is broken → python xmlrpc client (contrib) is broken
This is looking very good. My only concern is the extended license included at the top. Is this s separate license from the MPL? If so we need to dual license this script or find an alternative. I am not a lawyer though so I am not sure what the ramifications are.
This is excellent. It works great for me, but with one small little change: Line 248 is self.userId = loginDict['id']. I was getting a tuple index error, so I had to change it to self.userId = loginDict[1]['id']
Checking in testopia/contrib/drivers/python/testopia.py; /cvsroot/mozilla/webtools/testopia/testopia/contrib/drivers/python/testopia.py,v <-- testopia.py new revision: 1.3; previous revision: 1.2
Status: NEW → RESOLVED
Closed: 17 years ago16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: