MantisBT - TestLink
View Issue Details
0005220TestLinkAPI - XMLRPCpublic2012-09-11 14:372015-05-16 08:45
lblestel 
fman 
normalmajoralways
closedfixed 
1.9.3 (2011 Q3 - bug fixing) 
1.9.14 (2015 Q3) 
MySQL
TBD
0005220: xml-rpc : Error with /view.php?id=5063 patch, when rights on test project / test plan differ
With the 0005063 patch http://mantis.testlink.org/view.php?id=5063 [^] (relative to http://www.teamst.org/forum/viewtopic.php?f=10&t=6845 [^])


Create
 - an automation project "Auto"
 - a user, with a "guest" role as testproject generic role, and "admin" role on "Auto" testproject.


With our scripts, an error is returned, but the result of the request is done too...


the problem seems be here => TestlinkXMLRPCServer->userHasRight(mgt_view_tc) called at [C:\xampp\htdocs\testlink\lib\api\xmlrpc.class.php:1820]



Workaround : we have deleted the 0005063 patch, and set a general "based <admin>" (with the necessary rights) role to the user, and set "<no right>" role on all project except "Auto"


----------------

Voici les erreurs que j'ai eu en appelant la method : getTestCaseIDByName

Avec le patch :

Requête :
rwPE4n@n,XPoGP<?xml version='1.0'?>
<methodCall>
<methodName>tl.getTestCaseIDByName</methodName>
<params>
<param>
<value><struct>
<member>
<name>testcasepathname</name>
<value><string>WEB Services::API::Impaired::test_Impaired_HWR_apiKey_missing</string></value>
</member>
<member>
<name>devKey</name>
<value><string>de5a51b2263c4ed1b40f618c9fb91776</string></value>
</member>
<member>
<name>testcasename</name>
<value><string>test_Impaired_HWR_apiKey_missing</string></value>
</member>
</struct></value>
</param>
</params>
</methodCall>

Réponse :
 ============================================================================== 
 DB Access Error - debug_print_backtrace() OUTPUT START 
 ============================================================================== 
#0  database->exec_query(/* Class:testplan - Method: get_by_id */  SELECT testplans.*,NH.name,NH.parent_id  
FROM testplans testplans,  nodes_hierarchy NH  WHERE testplans.id = NH.id AND  testplans.id = , -1) called 
at [C:\xampp\htdocs\testlink\lib\functions\database.class.php:717]
#1  database->get_recordset(/* Class:testplan - Method: get_by_id */  SELECT testplans.*,NH.name,NH.parent_id  
FROM testplans testplans,  nodes_hierarchy NH  WHERE testplans.id = NH.id AND  testplans.id = ) called 
at [C:\xampp\htdocs\testlink\lib\functions\testplan.class.php:266]
0000002  testplan->get_by_id() called at [C:\xampp\htdocs\testlink\lib\api\xmlrpc.class.php:444]
0000003  TestlinkXMLRPCServer->userHasRight(mgt_view_tc) called at [C:\xampp\htdocs\testlink\lib\api\xmlrpc.class.php:1820]

0000004  TestlinkXMLRPCServer->getTestCaseIDByName(Array ([testcasepathname] => WEB Services::API::Impaired::test_Impaired_HWR_apiKey_missing,[devKey] 
=> de5a51b2263c4ed1b40f618c9fb91776,[testcasename] => test_Impaired_HWR_apiKey_missing)) called 
at [C:\xampp\htdocs\testlink\third_party\xml-rpc\class-IXR.php:336]
0000005  IXR_Server->call(tl.getTestCaseIDByName, Array ([0] => Array ([testcasepathname] => WEB 
Services::API::Impaired::test_Impaired_HWR_apiKey_missing,[devKey] => de5a51b2263c4ed1b40f618c9fb91776,[testcasename] 
=> test_Impaired_HWR_apiKey_missing))) called at [C:\xampp\htdocs\testlink\third_party\xml-rpc\class-IXR.php:294]

0000006  IXR_Server->serve() called at [C:\xampp\htdocs\testlink\third_party\xml-rpc\class-IXR.php:277]

0000007  IXR_Server->IXR_Server(Array ([tl.reportTCResult] => this:reportTCResult,[tl.setTestCaseExecutionResult] 
=> this:reportTCResult,[tl.createBuild] => this:createBuild,[tl.createTestCase] => this:createTestCase,[tl.createTestPlan] 
=> this:createTestPlan,[tl.createTestProject] => this:createTestProject,[tl.createTestSuite] => 
this:createTestSuite,[tl.uploadExecutionAttachment] => this:uploadExecutionAttachment,[tl.uploadRequirementSpecificationAttachment] 
=> this:uploadRequirementSpecificationAttachment,[tl.uploadRequirementAttachment] => this:uploadRequirementAttachment,[tl.uploadTestProjectAttachment] 
=> this:uploadTestProjectAttachment,[tl.uploadTestSuiteAttachment] => this:uploadTestSuiteAttachment,[tl.uploadTestCaseAttachment] 
=> this:uploadTestCaseAttachment,[tl.uploadAttachment] => this:uploadAttachment,[tl.assignRequirements] 
=> this:assignRequirements,[tl.addTestCaseToTestPlan] => this:addTestCaseToTestPlan,
[tl.getProjects] => this:getProjects,[tl.getTestProjectByName] => this:getTestProjectByName,[tl.getTestPlanByName] 
=> this:getTestPlanByName,[tl.getProjectTestPlans] => this:getProjectTestPlans,[tl.getTestPlanPlatforms] 
=> this:getTestPlanPlatforms,[tl.getTotalsForTestPlan] => this:getTotalsForTestPlan,[tl.getBuildsForTestPlan] 
=> this:getBuildsForTestPlan,[tl.getLatestBuildForTestPlan] => this:getLatestBuildForTestPlan,[tl.getLastExecutionResult] 
=> this:getLastExecutionResult,[tl.getTestSuitesForTestPlan] => this:getTestSuitesForTestPlan,[tl.getTestSuitesForTestSuite] 
=> this:getTestSuitesForTestSuite,[tl.getTestCasesForTestSuite] => this:getTestCasesForTestSuite,[tl.getTestCasesForTestPlan] 
=> this:getTestCasesForTestPlan,[tl.getTestCaseIDByName] => this:getTestCaseIDByName,[tl.getTestCaseCustomFieldDesignValue] 
=> this:getTestCaseCustomFieldDesignValue,[tl.getFirstLevelTestSuitesForTestProject] => this:getFirstLevelTestSuitesForTest

Project,[tl.getTestCaseAttachments] => this:getTestCaseAttachments,[tl.getTestCase] => this:getTestCase,[tl.getFullPath] 
=> this:getFullPath,[tl.getTestSuiteByID] => this:getTestSuiteByID,[tl.deleteExecution] => this:deleteExecution,[tl.doesUserExist] 
=> this:doesUserExist,[tl.checkDevKey] => this:checkDevKey,[tl.about] => this:about,[tl.setTestMode] 
=> this:setTestMode,[tl.ping] => this:sayHello,[tl.sayHello] => this:sayHello,[tl.repeat] => 
this:repeat)) called at [C:\xampp\htdocs\testlink\lib\api\xmlrpc.class.php:281]
0000008  TestlinkXMLRPCServer->__construct() called at [C:\xampp\htdocs\testlink\lib\api\xmlrpc.php:25]

 ============================================================================== 
<?xml version="1.0"?>
<methodResponse>
  <params>
    <param>
      <value>
        <array><data>
  <value><struct>
  <member><name>id</name><value><string>100482</string></value></member>
  <member><name>name</name><value><string>test_Impaired_HWR_apiKey_missing</string></value></member>
  <member><name>parent_id</name><value><string>100480</string></value></member>
  <member><name>tsuite_name</name><value><string>Impaired</string></value></member>
  <member><name>tc_external_id</name><value><string>1</string></value></member>
</struct></value>
</data></array>
      </value>
    </param>
  </params>
</methodResponse>
No tags attached.
Issue History
2012-09-11 14:37lblestelNew Issue
2013-04-25 17:30fmanCategoryTL API => XMLRPC API
2013-04-25 17:30fmanCategoryXMLRPC API => API - XMLRPC
2015-05-03 13:58Mr.BricodageNote Added: 0023310
2015-05-03 13:58Mr.BricodageRelationship addedchild of 0007083
2015-05-16 08:45fmanStatusnew => closed
2015-05-16 08:45fmanAssigned To => fman
2015-05-16 08:45fmanResolutionopen => fixed
2015-05-16 08:45fmanFixed in Version => 1.9.14 (2015 Q3)
2015-05-19 18:59Mr.BricodageRelationship deletedchild of 0007083

Notes
(0023310)
Mr.Bricodage   
2015-05-03 13:58   
test content :
project "auto"
user "5220",
user rights : no_right(global), admin (auto),
dev-key : 8cdb0e6cc91edbd13c711489d7ae41ec

using "lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCaseIDByName.php" (same function that is listed in bug):

POST /TestLink/lib/api/xmlrpc/v1/xmlrpc.php HTTP/1.0
Host: localhost
Content-Type: text/xml
User-Agent: Incutio XML-RPC
Content-length: 353

<?xml version="1.0"?>
<methodCall>
<methodName>tl.getTestCaseIDByName</methodName>
<params>
<param><value><struct>
  <member><name>devKey</name><value><string>8cdb0e6cc91edbd13c711489d7ae41ec</string></value></member>
  <member><name>testcasename</name><value><string>KOMODO</string></value></member>
</struct></value></param>
</params></methodCall>
<?xml version="1.0"?>
<methodResponse>
<params>
<param>
<value>
<array><data>
<value><struct>
<member><name>id</name><value><string>6</string></value></member>
<member><name>name</name><value><string>KOMODO</string></value></member>
<member><name>parent_id</name><value><string>3</string></value></member>
<member><name>tsuite_name</name><value><string>TS101</string></value></member>
<member><name>tc_external_id</name><value><string>2</string></value></member>
</struct></value>
</data></array>
</value>
</param>
</params>
</methodResponse>

==> no more
 ==============================================================================
 DB Access Error - debug_print_backtrace() OUTPUT START
 ==============================================================================

issue can be closed