Bug 1119170

Summary: [xmlrpc]There is no checking on the bug_system_id when invoking the TestCase.attach_bug method
Product: [Other] TCMS Reporter: Tingting Zhao <tzhao>
Component: XMLRPCAssignee: Yang Ren <ryang>
Status: VERIFIED --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3.8.8CC: cqi, leiwang, ryang
Target Milestone: ---   
Target Release: 3.8.11   
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 Tingting Zhao 2014-07-14 08:10:06 UTC
Description of problem:
There is no checking about the bug_system_id when invoking this method:TestCase.attach_bug().

Version-Release number of selected component (if applicable):
v3.8.9-1 on test server
the test case is https://tcms-test.app.eng.nay.redhat.com/case/390009/

How reproducible:
100%

Steps to Reproduce:
1.invoke the method like this:
 (1)n.TestCase.attach_bug({'case_id':390009,'bug_id':'TCMS-234','bug_system_id':1,'summary':'test','description':'testing'})
Or like this:
 (2)n.TestCase.attach_bug({'case_id':390009,'bug_id':'TCMS-234','bug_system_id':3,'summary':'test','description':'testing'})
2.then invoke the TestCase.get(390009) or refresh the UI page
Then check the result.

Actual results:
(1)there is no wrong msg but this bug was added to the case.And the bug is right in the case.
(2)there is no wrong msg and this bug was not added to the case.

Expected results:
(1) it should has warning that bug_system_id is not existed :1: BZ(Default), 2: JIRA      
(2)it should has warning that 3 is not existed.

Additional info:
TestCase.attach_bug():
  +-------------------+----------------+-----------+-------------------------------+
  | Field             | Type           | Null      | Description                   |
  +-------------------+----------------+-----------+-------------------------------+
  | case_id           | Integer        | Required  | ID of Case                    |
  | bug_id            | Integer        | Required  | ID of Bug                     |
  | bug_system_id     | Integer        | Required  | 1: BZ(Default), 2: JIRA       |
  | summary           | String         | Required  | Bug summary                   |
  | description       | String         | Required  | Bug description               |
  +-------------------+----------------+-----------+-------------------------------+

Comment 1 Tingting Zhao 2014-07-14 08:18:57 UTC
In the following results,both of their bug_system are the same,but actually the bug types are different,which one is bugzilla and the other is jira.
[{'bug_id': '23432',
  'bug_system': 'Red Hat\nBugzilla',
  'bug_system_id': 1,
  'case': 'test case 1',
  'case_id': 390009,
  'case_run': None,
  'case_run_id': None,
  'description': 'just do testing',
  'id': 120333,
  'summary': 'test atach bug'},
 {'bug_id': 'TCMS-234',
  'bug_system': 'Red Hat\nBugzilla',
  'bug_system_id': 1,
  'case': 'test case 1',
  'case_id': 390009,
  'case_run': None,
  'case_run_id': None,
  'description': 'just do testing',
  'id': 120334,
  'summary': 'test atach bug'}]

Comment 2 Tingting Zhao 2014-07-14 09:27:16 UTC
changed to 3.8.8 as it happened on product env too.

Comment 3 Xu Lei 2014-08-25 02:25:39 UTC
fix with https://bugzilla.redhat.com/show_bug.cgi?id=1131920

Comment 4 Tingting Zhao 2014-09-04 10:02:38 UTC
verify on devel server with v3.8.11-1------>pass
verify steps are the same as description.