Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 629670

Summary: Support warning periods on entitlements in the compliance icon
Product: Red Hat Enterprise Linux 6 Reporter: James Bowes <jbowes>
Component: subscription-managerAssignee: Bryan Kearney <bkearney>
Status: CLOSED ERRATA QA Contact: John Sefler <jsefler>
Severity: medium Docs Contact:
Priority: low    
Version: 6.1CC: bkearney, jgalipea, jsefler, rmeggins, shaines, syeghiay
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 13:42:18 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: 568421, 648977    
Attachments:
Description Flags
screenshot shows fix for test case - a date within 30 days before the Not After date none

Description James Bowes 2010-09-02 16:47:50 UTC
Some entitlements can specify a warning period (in days). If the entitlement certificate's expiration date - today is less than the warning period, then the compliance icon should appear and display a message telling the user as such.

To test this, you can manually set your warning period and expiration date (set the one on the order) using ajay's cert tool: http://github.com/ajaykumarns/cert-gen

Comment 4 John Sefler 2011-02-23 19:25:21 UTC
Testing Version...
[root@jsefler-onprem03 entitlement]# rpm -qa | grep subscription-manager
subscription-manager-0.95.1-1.git.17.4a23267.el6.x86_64
subscription-manager-firstboot-0.95.1-1.git.17.4a23267.el6.x86_64
subscription-manager-gnome-0.95.1-1.git.17.4a23267.el6.x86_64
[root@jsefler-onprem03 entitlement]# rpm -q python-rhsm
python-rhsm-0.95.3-1.git.0.4d0ef8e.el6.noarch


Our test strategy using an onpremise candlepin deployed with TESTDAT=1 and a rhel61 client with subscription-manager installed was...
1. install only ONE of the generated product certs (27060.pem)

2. register and subscribe to "Awesome OS Workstation Bits" - that will make the system compliant:
[root@jsefler-onprem03 entitlement]# subscription-manager facts --list | grep compliant
system.compliant: True

3. Note the validity period and warning period of the entitlement
[root@jsefler-onprem03 entitlement]# openssl x509 -text -in /etc/pki/entitlement/52129848558823871.pem | grep -A1 1.3.6.1.4.1.2312.9.4.12
            1.3.6.1.4.1.2312.9.4.12: 
                ..30
                  ^^ warning_period is 30 days
[root@jsefler-onprem03 entitlement]# openssl x509 -text -in /etc/pki/entitlement/52129848558823871.pem | grep -A2 Validity
        Validity
            Not Before: Feb 23 18:26:28 2011 GMT
            Not After : Feb 23 00:00:00 2012 GMT

4. restart the process for rhsm-compliance-icon with 3 second check-period
# rhsm-compliance-icon -c 3&

5. use the system clock on the box to change the date to...
- a date after the Not After date
    PASSED - rhsm-compliance-icon appears
- a date 31 days before the Not After date
    PASSED - rhsm-compliance-icon disappears
- a date before the Not Before date
    FAILED - rhsm-compliance-icon should appear
- a date within 30 days before the Not After date
    FAILED - rhsm-compliance-icon should appear
- a date after the Not After date
    PASSED - rhsm-compliance-icon appears

moving back to ASSIGNED

Comment 5 James Bowes 2011-03-07 13:51:56 UTC
I've got a patch for the 'within' 30 days case (looks like we had a regression after a refactor). For the 'date before the Not Before date', can you open a separate bug for that? it's a different issue, and i'm not certain if we want to treat that case identically to having expired/no entitlements.

Comment 6 James Bowes 2011-03-07 14:54:42 UTC
displaying a warning when you're within the warning_period is now fixed in both master and rhel6 branches. should be available in 0.96.2 and 0.95.4 builds.

Comment 8 John Sefler 2011-03-08 16:30:37 UTC
bug https://bugzilla.redhat.com/show_bug.cgi?id=682772 has been opened at the request of comment #5

Comment 9 John Sefler 2011-03-08 16:46:00 UTC
Created attachment 482949 [details]
screenshot shows fix for test case - a date within 30 days before the Not After date

Verified Version...
[root@jsefler-onprem03 ~]# rpm -qa | grep subscription-manager
subscription-manager-gnome-0.95.3-1.git.15.e70d002.el6.x86_64
subscription-manager-firstboot-0.95.3-1.git.15.e70d002.el6.x86_64
subscription-manager-0.95.3-1.git.15.e70d002.el6.x86_64


In the attached screenshot, you will see the date is set to "30 days" before the "Not After" Validity date which means that the rhsm-compliance-icon should appear with a message stating "Some of the system's subscriptions are about to expire".  And now this works as evidenced in the screenshot.

- a date within 30 days before the Not After date
    PASSED - rhsm-compliance-icon should appear

moving to VERIFIED

Comment 10 Rich Megginson 2011-03-23 14:15:47 UTC
Can someone please change the compon

Comment 11 errata-xmlrpc 2011-05-19 13:42:18 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2011-0611.html