Bug 844731

Summary: Add methods for handling test case run logs
Product: [Other] TCMS Reporter: Petr Šplíchal <psplicha>
Component: XMLRPCAssignee: Yang Ren <ryang>
Status: VERIFIED --- QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.7.0CC: dkutalek, ohudlick, ryang
Target Milestone: ---   
Target Release: 3.8.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Petr Šplíchal 2012-07-31 14:33:16 UTC
Description of problem:

Please add new methods attach_log() and detach_log() to the
TestCaseRun class so that we are able to include links to relevant
job logs in scripts. Also provide a way to get all linked logs,
perhaps TestCaseRun.get_logs(). Thanks.

Comment 1 jianchen 2012-09-27 03:32:31 UTC
add attach_log(), detach_log() and get_logs in TestCaseRun class.
please verify after deploy in stage server.

Comment 2 Xin Gao 2012-10-16 04:34:50 UTC
Verify 3.8.1-1 on tcms-test -->PASS

Verify steps:
1. >>> TestCaseRun.attach_log(1595145, 'log_name2', 'https://tcms-test.app.eng.nay.redhat.com')
2. >>> TestCaseRun.get_logs(1595145)
=============
[{'content_type': 'test case run',
  'content_type_id': 57,
  'created_on': '2012-10-16 12:24:33',
  'id': 129,
  'name': 'log_name2',
  'object_pk': '1595145',
  'site': 'tcms.engineering.redhat.com',
  'site_id': 1,
  'url': 'http://ciqe.englab.nay.redhat.com/'},
 {'content_type': 'test case run',
  'content_type_id': 57,
  'created_on': '2012-10-16 12:23:48',
  'id': 128,
  'name': 'log_name2',
  'object_pk': '1595145',
  'site': 'tcms.engineering.redhat.com',
  'site_id': 1,
  'url': 'https://tcms-test.app.eng.nay.redhat.com'},
 {'content_type': 'test case run',
  'content_type_id': 57,
  'created_on': '2012-10-16 12:22:30',
  'id': 127,
  'name': 'log_name',
  'object_pk': '1595145',
  'site': 'tcms.engineering.redhat.com',
  'site_id': 1,
  'url': 'www.redhat.com'},
 {'content_type': 'test case run',
  'content_type_id': 57,
  'created_on': '2012-10-16 12:25:08',
  'id': 130,
  'name': 'log_name2',
  'object_pk': '1595145',
  'site': 'tcms.engineering.redhat.com',
  'site_id': 1,
  'url': 'ciqe.englab.nay.redhat.com/'},
 {'content_type': 'test case run',
  'content_type_id': 57,
  'created_on': '2012-10-16 12:25:40',
  'id': 131,
  'name': 'log_name2',
  'object_pk': '1595145',
  'site': 'tcms.engineering.redhat.com',
  'site_id': 1,
  'url': 'ciqe.englab.nay.redhat.com'},
 {'content_type': 'test case run',
  'content_type_id': 57,
  'created_on': '2012-10-16 12:26:31',
  'id': 132,
  'name': 'log_name2',
  'object_pk': '1595145',
  'site': 'tcms.engineering.redhat.com',
  'site_id': 1,
  'url': 'http://www.baidu.com/'},
 {'content_type': 'test case run',
  'content_type_id': 57,
  'created_on': '2012-10-16 12:27:08',
  'id': 133,
  'name': 'log_name3',
  'object_pk': '1595145',
  'site': 'tcms.engineering.redhat.com',
  'site_id': 1,
  'url': 'http://www.baidu.com/'}]

=============

3. >>> TestCaseRun.detach_log(1595145, 133)
=============
[{'content_type': 'test case run',
  'content_type_id': 57,
  'created_on': '2012-10-16 12:24:33',
  'id': 129,
  'name': 'log_name2',
  'object_pk': '1595145',
  'site': 'tcms.engineering.redhat.com',
  'site_id': 1,
  'url': 'http://ciqe.englab.nay.redhat.com/'},
 {'content_type': 'test case run',
  'content_type_id': 57,
  'created_on': '2012-10-16 12:23:48',
  'id': 128,
  'name': 'log_name2',
  'object_pk': '1595145',
  'site': 'tcms.engineering.redhat.com',
  'site_id': 1,
  'url': 'https://tcms-test.app.eng.nay.redhat.com'},
 {'content_type': 'test case run',
  'content_type_id': 57,
  'created_on': '2012-10-16 12:22:30',
  'id': 127,
  'name': 'log_name',
  'object_pk': '1595145',
  'site': 'tcms.engineering.redhat.com',
  'site_id': 1,
  'url': 'www.redhat.com'},
 {'content_type': 'test case run',
  'content_type_id': 57,
  'created_on': '2012-10-16 12:25:08',
  'id': 130,
  'name': 'log_name2',
  'object_pk': '1595145',
  'site': 'tcms.engineering.redhat.com',
  'site_id': 1,
  'url': 'ciqe.englab.nay.redhat.com/'},
 {'content_type': 'test case run',
  'content_type_id': 57,
  'created_on': '2012-10-16 12:25:40',
  'id': 131,
  'name': 'log_name2',
  'object_pk': '1595145',
  'site': 'tcms.engineering.redhat.com',
  'site_id': 1,
  'url': 'ciqe.englab.nay.redhat.com'},
 {'content_type': 'test case run',
  'content_type_id': 57,
  'created_on': '2012-10-16 12:26:31',
  'id': 132,
  'name': 'log_name2',
  'object_pk': '1595145',
  'site': 'tcms.engineering.redhat.com',
  'site_id': 1,
  'url': 'http://www.baidu.com/'}]

=============

Actual result:
these three new methods work well.