Bug 1002946

Summary: Installed product status continued to display"Subscribed" when consumed instance based sub-pool changed from active to future subscription
Product: [Community] Candlepin Reporter: Rehana <redakkan>
Component: candlepinAssignee: Devan Goodwin <dgoodwin>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.9CC: bkearney, dgoodwin, fsharath, jmolet, jsefler, skallesh, spandey
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: 2013-12-05 13:46:55 UTC 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:
Bug Depends On:    
Bug Blocks: 862910    

Description Rehana 2013-08-30 09:58:02 UTC
Description of problem:
During the instance-based sub-pool test, observed that removing the active instance based subscription on the host ( leaving the future subscription untouched) updated the sub-pool dates from current to future but the installed product status continued to display "Subscribed"

Version-Release number of selected component (if applicable):
subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.8.24-1
subscription-manager: 1.9.5-1.git.0.64f1883.el6
python-rhsm: 1.9.4-1.git.0.cfef6c8.el6


How reproducible:
2/2

Steps to Reproduce:
1.Attach a active and future instance based subscrption on the host
[root@rehanatestmachine product]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name: Awesome OS Instance Based (Standard Support)
Provides:          Awesome OS Instance Server Bits
SKU:               awesomeos-instancebased
Contract:          42
Account:           12331131231
Serial:            8997283283390616735
Pool ID:           8ac6a36240ce8b0a0140ce8c11420841
Active:            True
Quantity Used:     2
Service Level:     Standard
Service Type:      L1-L3
Status Details:    Only covers 2 of 4 sockets.
Starts:            08/30/2013
Ends:              08/30/2014

Subscription Name: Awesome OS Instance Based (Standard Support)
Provides:          Awesome OS Instance Server Bits
SKU:               awesomeos-instancebased
Contract:          43
Account:           12331131231
Serial:            4936008264918591674
Pool ID:           8ac6a36240ce8b0a0140ce8c110e0823
Active:            False
Quantity Used:     2
Service Level:     Standard
Service Type:      L1-L3
Status Details:    
Starts:            08/20/2014
Ends:              08/20/2015

2.attach the instance-based sub-pool on the guest
[root@rhel65nightly product]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name: Awesome OS Instance Based (Standard Support)
Provides:          Awesome OS Instance Server Bits
SKU:               awesomeos-instancebased
Contract:          43
Account:           12331131231
Serial:            6629908857353442690
Pool ID:           8ac6a36240ce8b0a0140ce91575914df
Active:            True
Quantity Used:     1
Service Level:     Standard
Service Type:      L1-L3
Status Details:    
Starts:            08/30/2013
Ends:              08/20/2015

3.now remove the active instance based subscription on the host
[root@rehanatestmachine product]# subscription-manager remove --serial 8997283283390616735
Serial numbers successfully removed at the server:
   8997283283390616735
1 local certificate has been deleted.
[root@rehanatestmachine product]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name: Awesome OS Instance Based (Standard Support)
Provides:          Awesome OS Instance Server Bits
SKU:               awesomeos-instancebased
Contract:          43
Account:           12331131231
Serial:            4936008264918591674
Pool ID:           8ac6a36240ce8b0a0140ce8c110e0823
Active:            False
Quantity Used:     2
Service Level:     Standard
Service Type:      L1-L3
Status Details:    
Starts:            08/20/2014
Ends:              08/20/2015


4.do service rhsmcertd restart on the guest machine
[root@rhel65nightly product]# service rhsmcertd restart
Stopping rhsmcertd...                                      [  OK  ]
Starting rhsmcertd...                                      [  OK  ]
[root@rhel65nightly product]# tail -f /var/log/rhsm/rhsmcertd.log 
Fri Aug 30 15:06:40 2013 [INFO] Cert check interval: 240.0 minute(s) [14400 second(s)]
Fri Aug 30 15:06:40 2013 [INFO] Waiting 120 second(s) [2.0 minute(s)] before running updates.
Fri Aug 30 15:08:41 2013 [INFO] (Auto-attach) Certificates updated.
Fri Aug 30 15:08:41 2013 [INFO] (Cert Check) Certificates updated.
Fri Aug 30 15:10:41 2013 [INFO] (Auto-attach) Certificates updated.
Fri Aug 30 15:10:54 2013 [INFO] rhsmcertd is shutting down...
Fri Aug 30 15:10:54 2013 [INFO] Starting rhsmcertd...
Fri Aug 30 15:10:54 2013 [INFO] Auto-attach interval: 4.0 minute(s) [240 second(s)]
Fri Aug 30 15:10:54 2013 [INFO] Cert check interval: 240.0 minute(s) [14400 second(s)]
Fri Aug 30 15:10:54 2013 [INFO] Waiting 120 second(s) [2.0 minute(s)] before running updates.
Fri Aug 30 15:12:55 2013 [INFO] (Auto-attach) Certificates updated.
Fri Aug 30 15:12:55 2013 [INFO] (Cert Check) Certificates updated.
^C
[root@rhel65nightly product]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name: Awesome OS Instance Based (Standard Support)
Provides:          Awesome OS Instance Server Bits
SKU:               awesomeos-instancebased
Contract:          43
Account:           12331131231
Serial:            2487862434252001943
Pool ID:           8ac6a36240ce8b0a0140ce91575914df
Active:            False
Quantity Used:     1
Service Level:     Standard
Service Type:      L1-L3
Status Details:    
Starts:            08/20/2014
Ends:              08/20/2015

[root@rhel65nightly product]# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Awesome OS Instance Server Bits
Product ID:     32060
Version:        6.1
Arch:           ALL
Status:         Subscribed
Status Details: 
Starts:         08/30/2013
Ends:           08/20/2015

[root@rhel65nightly product]# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Current



Actual results:
Observed that the instance based subscription (sub-pool) dates were updated, but list --installed and status command continued to show status as "Subscuribed" and "current" respectively

Expected results:
status and start/end date should get updated

Additional info:

Comment 1 Devan Goodwin 2013-09-06 18:29:34 UTC
Fixed in candlepin.git master: c3a51d22499c2688ebeb4f846e9bcca37be739e6

Will appear in candlepin-0.8.26-1.

Comment 2 Bryan Kearney 2013-09-26 18:21:28 UTC
fixed in candlepin-0.8.26-1

Comment 3 Rehana 2013-09-27 08:48:59 UTC
Retested on 
subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.8.28-1

1.Added current and future subscription on the host 
2.attached sub-pool on the guest

[root@dhcp-37-245 product]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name: Awesome OS Instance Based (Standard Support)
Provides:          Awesome OS Instance Server Bits
SKU:               awesomeos-instancebased
Contract:          0
Account:           12331131231
Serial:            6078568181167725801
Pool ID:           8ac6a36241539ee401415e894fb0247e
Active:            True
Quantity Used:     1
Service Level:     Standard
Service Type:      L1-L3
Status Details:    
Starts:            09/25/2013
Ends:              09/15/2015

3. Removed current subscription on the host
4. service rhsmcertd restart on the guest
5. List consumed and status on the guest
[root@dhcp-37-245 product]# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Awesome OS Instance Server Bits
Product ID:     32060
Version:        6.1
Arch:           ALL
Status:         Future Subscription
Status Details: Not covered by a valid subscription.
Starts:         
Ends:           

[root@dhcp-37-245 product]# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Invalid

Awesome OS Instance Server Bits:
- Not covered by a valid subscription.


Observed that the now the status is getting updated on the guest machine.

Hence moving this bug to "Verified"