Bug 744259

Summary: Entitlement Quantity is no longer in the entitlement certificate
Product: [Community] Candlepin Reporter: Andrew Edwards <aedwards>
Component: candlepinAssignee: Alex Wood <awood>
Status: CLOSED CURRENTRELEASE QA Contact: John Sefler <jsefler>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.5CC: awood, tpfromme
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-05-30 13:16:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 682238    

Description Andrew Edwards 2011-10-07 16:04:04 UTC
Description of problem:
Entitlement Quantity (1.3.6.1.4.1.2312.9.4.5) is no longer in the entitlement certificate.

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

How reproducible:
100%

Steps to Reproduce ():
1. register a consumer to an owner.
2. subscribe consumer to an available pool
3. if doing these steps with rhsm-we download the cert
4. view the entitlement cert
   openssl x509 -text -in <cert_name>.pem | more
5. search for 1.3.6.1.4.1.2312.9.4.5
  
Actual results:
OID 1.3.6.1.4.1.2312.9.4.5 is not found

Expected results:
OID 1.3.6.1.4.1.2312.9.4.5 is found with the appropriate quantity value

Additional info:
quantity oid was removed in commit 8e5a8cf0f641f4698d04c6e223cd4d228db1aabf

Comment 1 Alex Wood 2011-10-17 19:07:33 UTC
Committed 3d5a1562e43d046f9057e1de150d613705b21399

version 0.4.22+

Comment 2 John Sefler 2011-10-18 17:17:27 UTC
Verifying candlepin version...
[root@jsefler-onprem-62candlepin candlepin]# git branch
  0.3
* master
[root@jsefler-onprem-62candlepin candlepin]# git show-ref | grep master
4a94df0aff73231917c88fdbf96c9b8804174f5c refs/heads/master
4a94df0aff73231917c88fdbf96c9b8804174f5c refs/remotes/origin/master


[root@jsefler-onprem-62workstation ~]# subscription-manager register --username testuser1 --password password --org admin
The system has been registered with id: a3570dff-42e7-48f3-b81f-36d7704427f0 
[root@jsefler-onprem-62workstation ~]# subscription-manager list --avail | grep "Awesome OS Workstation Basic" -A7
ProductName:       	Awesome OS Workstation Basic
ProductId:         	awesomeos-workstation-basic
PoolId:            	8a90f8053317f594013317f6debe0343
Quantity:          	10                        
Multi-Entitlement: 	No                       
Expires:           	10/16/2012               
MachineType:       	physical                 

--
ProductName:       	Awesome OS Workstation Basic
ProductId:         	awesomeos-workstation-basic
PoolId:            	8a90f8053317f594013317f6defc0350
Quantity:          	5                        
Multi-Entitlement: 	No                       
Expires:           	10/16/2012               
MachineType:       	physical                 

[root@jsefler-onprem-62workstation ~]# subscription-manager subscribe --pool 8a90f8053317f594013317f6debe0343 --pool 8a90f8053317f594013317f6defc0350
Successfully subscribed the system to Pool 8a90f8053317f594013317f6debe0343
Successfully subscribed the system to Pool 8a90f8053317f594013317f6defc0350
[root@jsefler-onprem-62workstation ~]# 
[root@jsefler-onprem-62workstation ~]# for e in `ls /etc/pki/entitlement/*.pem | grep -v key`; do echo $e; openssl x509 -text -in $e | grep -A1 1.3.6.1.4.1.2312.9.4.5; done;
/etc/pki/entitlement/2406273709879681704.pem
            1.3.6.1.4.1.2312.9.4.5: 
                ..5
/etc/pki/entitlement/8338663351582297128.pem
            1.3.6.1.4.1.2312.9.4.5: 
                ..10
[root@jsefler-onprem-62workstation ~]# 

^^^ VERIFIED the latest candlepin includes entitlement quantity OID (1.3.6.1.4.1.2312.9.4.5) in the granted entitlement certificate.
Moving to VERIFIED


Note: automated test VerifyEntitlementCertContainsExpectedOIDs_Test has also been programmed to cover this scenario for future regression.