Bug 1034375 - Candlepin should ensure all content override names are lowercase
Summary: Candlepin should ensure all content override names are lowercase
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Subscription Management
Version: Nightly
Hardware: Unspecified
OS: Unspecified
unspecified
medium vote
Target Milestone: Unspecified
Assignee: Michael Stead
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-25 17:11 UTC by Michael Stead
Modified: 2019-09-26 13:44 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-17 18:33:21 UTC
Target Upstream Version:


Attachments (Terms of Use)
Test reproducer data. (171 bytes, application/json)
2013-11-25 17:11 UTC, Michael Stead
no flags Details

Description Michael Stead 2013-11-25 17:11:55 UTC
Created attachment 828773 [details]
Test reproducer data.

Description of problem:

Currently when a content override is created with the same name, but with different case, it is not seen as a duplicate and multiple overrides are created.

Since yum will always convert repo properties to lowercase, candlepin should do the same.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:

Referencing the attached JSON file (override-case-test.json) and my test candlepin:

curl -k -u admin:admin -X PUT -H "Content-Type: application/json" -d @"../override-case-test.json" http://localhost:8080/candlepin/consumers/65d417b0-9ee0-48a1-a152-28efabd07abb/content_overrides/


Actual results:

A JSON response with an override for both gpgcheck and GPGCheck

[ {
  "contentLabel" : "my-repo",
  "name" : "gpgcheck",
  "value" : "1"
}, {
  "contentLabel" : "test",
  "name" : "GPGCheck",
  "value" : "0"
} ]


Expected results:

A JSON response with a single override for gpgcheck (lowercase).

** NOTE: In the case above the values are different. Suggest that the value be set to that of the last override processed.


[ {
  "contentLabel" : "my-repo",
  "name" : "gpgcheck",
  "value" : "0"
} ]


Additional info:

We should consider override validation checks in the rules as well to make sure that it always checks the lowercase version of the override name.

We can test this by using case variances against trying to override the baseurl property.

In the test json provided, changing the 'name' to baseUrl and baseurl should produce an error.

Comment 1 RHEL Program Management 2013-11-25 17:34:45 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 3 Michael Stead 2014-01-08 15:21:23 UTC
There is an error in the attached test data JSON file. The 'contentLabel' of both entries should be the same.

Here is a corrected version:

[ 
  {
    "contentLabel" : "my-repo",
    "name" : "gpgcheck",
    "value" : "1"
  }, 
  {
    "contentLabel" : "my-repo",
    "name" : "GPGCheck",
    "value" : "0"
  } 
]

Expected results will remain the same as in the description.

Comment 4 Michael Stead 2014-01-08 15:24:16 UTC
Follow these steps to test with subscription-manager:

Reproduced
--------------

[mstead@highside candlepin]$ sudo subscription-manager identity
system identity: 41fda330-47f8-42b1-92f8-a8d7c7c6d9e6
name: highside
org name: Admin Owner
org ID: admin

[mstead@highside candlepin]$ sudo subscription-manager repo-override --repo test --add gpgcheck:0
Repository 'test' does not currently exist, but the override has been added.

[mstead@highside candlepin]$ sudo subscription-manager repo-override --repo test --add GPGCheck:1
Repository 'test' does not currently exist, but the override has been added.

[mstead@highside candlepin]$ sudo subscription-manager repo-override --list
Repository: test
  GPGCheck: 1
  gpgcheck: 0



Expected
----------

[mstead@highside candlepin]$ sudo subscription-manager identity
system identity: 41fda330-47f8-42b1-92f8-a8d7c7c6d9e6
name: highside
org name: Admin Owner
org ID: admin

[mstead@highside candlepin]$ sudo subscription-manager repo-override --repo test --add gpgcheck:0
Repository 'test' does not currently exist, but the override has been added.

[mstead@highside candlepin]$ sudo subscription-manager repo-override --repo test --add GPGCheck:1
Repository 'test' does not currently exist, but the override has been added.

[mstead@highside candlepin]$ sudo subscription-manager repo-override --list
Repository: test
  gpgcheck: 1

Comment 5 Michael Stead 2014-01-08 15:40:00 UTC
https://github.com/candlepin/candlepin/pull/483

Comment 9 Corey Welton 2014-07-17 18:33:21 UTC
Closing upstream -  devtask


Note You need to log in before you can comment on or make changes to this bug.