Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

Commit

Permalink
Merge pull request #8247 from lina-nikiforova/test_configure_vmdb_las…
Browse files Browse the repository at this point in the history
…t_start_time

[1LP][RFR] added properties table for vmdb summary
  • Loading branch information
izapolsk committed Dec 7, 2018
2 parents 6244ff2 + db6b013 commit 35a97eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion cfme/base/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from widgetastic.utils import Version, VersionPick
from widgetastic.widget import View, Table, Text, Image, FileInput
from widgetastic_manageiq import (ManageIQTree, Checkbox, AttributeValueForm, TimelinesView,
SummaryFormItem, WaitTab)
SummaryFormItem, SummaryTable, WaitTab)
from widgetastic_patternfly import (Accordion, Input, Button, Dropdown, DatePicker,
FlashMessages, BootstrapSelect, CheckableBootstrapTreeview)

Expand Down Expand Up @@ -625,6 +625,7 @@ def is_displayed(self):


class DatabaseSummaryView(ServerDatabaseView):
properties = SummaryTable(title='Properties')

@property
def is_displayed(self):
Expand Down
6 changes: 3 additions & 3 deletions cfme/tests/configure/test_database_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


@pytest.mark.tier(2)
@pytest.mark.uncollectif(lambda appliance: appliance.version < '5.9')
def test_configure_vmdb_last_start_time(appliance):
"""
Go to Settings -> Configure -> Database
Expand All @@ -23,12 +22,13 @@ def test_configure_vmdb_last_start_time(appliance):

view = navigate_to(appliance.server, 'DatabaseSummary')

for item in view.summary('Properties').get_text_of('Data Directory').split('/'):
for item in view.properties.get_text_of('Data Directory').split('/'):
if 'rh-postgresql' in item:
logs_last_start_time = appliance.ssh_client.run_command(
"journalctl -u {}-postgresql.service --boot=0 | sed '4!d'".format(item))
break

ui_last_start_time = parser.parse(view.summary('Properties').get_text_of('Last Start Time'))
ui_last_start_time = parser.parse(view.properties.get_text_of('Last Start Time'))
# timedatectl is used here as we will get full timezone name, like 'US/Eastern',
# which is easier and safer(to omit UnknownTimeZoneError) to use later
tz = pytz.timezone(appliance.ssh_client.run_command("timedatectl | grep 'Time zone'")
Expand Down

0 comments on commit 35a97eb

Please sign in to comment.