-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ SUBSCRIPTION: | |
RHN_PASSWORD: | ||
# subscription pool id | ||
RHN_POOLID: | ||
# lifecycle API url | ||
LIFECYCLE_API_URL: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
"""Test module for EOL tracking | ||
:Requirement: Dashboard | ||
:CaseAutomation: Automated | ||
:CaseLevel: Acceptance | ||
:CaseComponent: Dashboard | ||
:Team: Endeavour | ||
:TestType: Functional | ||
:CaseImportance: High | ||
:Upstream: No | ||
""" | ||
|
||
from datetime import datetime | ||
|
||
import pytest | ||
import requests | ||
import yaml | ||
|
||
from robottelo.config import settings | ||
from robottelo.constants import LIFECYCLE_METADATA_FILE | ||
|
||
|
||
@pytest.mark.tier2 | ||
def test_positive_check_eol_date(target_sat): | ||
"""Check if the EOL date for the satellite version | ||
:id: 1c2f0d19-a357-4461-9ace-edb468f9ca5c | ||
:expectedresults: EOL date from satellite-lifecycle package is accurate | ||
""" | ||
current_version = '.'.join(target_sat.version.split('.')[0:2]) | ||
output = yaml.load(target_sat.execute(rf'cat {LIFECYCLE_METADATA_FILE}').stdout, yaml.Loader) | ||
eol_datetime = datetime.strptime(output['releases'][current_version]['end_of_life'], '%Y-%m-%d') | ||
result = requests.get(settings.subscription.lifecycle_api_url, verify=False) | ||
if result.status_code != 200: | ||
raise requests.HTTPError(f'{settings.subscription.lifecycle_api_url} is not accessible') | ||
versions = result.json()['data'][0]['versions'] | ||
version = [v for v in versions if v['name'] == current_version] | ||
if len(version) > 0: | ||
api_date = [ | ||
(p['date_format'], p['date']) | ||
for p in version[0]['phases'] | ||
if p['name'] == 'Maintenance support' | ||
] | ||
if api_date[0][0] == 'string': | ||
assert eol_datetime.strftime("%B, %Y") in api_date[0][1] | ||
if api_date[0][0] == 'date': | ||
assert eol_datetime.strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3] + 'Z' == api_date[0][1] |