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

[WIPTEST] Fixing infra_hosts_power_tests for the CFME 5.10 #8327

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dkholodo
Copy link
Contributor

Were fixed infra provider's host_off and host_on tests for the CFME 5.10

{{ pytest: cfme/tests/openstack/infrastructure/test_host_power_control.py }}

@digitronik
Copy link
Contributor

@dkholodo please sign commit with your GPG key.

@digitronik digitronik changed the title [RFR] Fixing infra_hosts_power_tests for the CFME 5.10 [WIPTEST] Fixing infra_hosts_power_tests for the CFME 5.10 Dec 28, 2018
@dkholodo dkholodo force-pushed the fixing_infra_host_power_tests branch from 16ad96a to 87ad02a Compare December 28, 2018 14:06
@dkholodo dkholodo changed the title [WIPTEST] Fixing infra_hosts_power_tests for the CFME 5.10 [RFR] Fixing infra_hosts_power_tests for the CFME 5.10 Jan 3, 2019
try:
my_host_on = provider.nodes.all().pop()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this change? Now the host that we return may not be associated with the provider for the test function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this change there is an issue with navigating to Host's Details view:

"NameError: Could not find field with name 'Hosts'"

ipdb> my_host_on = host_collection.all().pop()

OpenstackNode(name=u'bc5add29-47a9-4387-bbcc-3f9d9e21631d (NovaCompute)', provider=OpenstackInfraProvider(endpoints={'default': <cfme.infrastructure.provider.openstack_infra.RHOSEndpoint object at 0x7f3097ac8d90>, 'rsa_keypair': <cfme.common.provider.SSHEndpoint object at 0x7f309790a5d0>, 'events': <cfme.common.provider.EventsEndpoint object at 0x7f3097ac88d0>}, name='uc_ci', key='uc_ci', zone=None, start_ip='192.168.24.2', end_ip='192.168.24.2', provider_data=None, api_version='Keystone v3', keystone_v3_domain_id='default'), hostname=None, ip_address=None, custom_ident=None, host_platform=None, ipmi_address=None, mac_address=None, credentials={}, ipmi_credentials=None, interface_type='lan')

and then my_host_on.get_power_state() can't be executed because it goes to the Infrastructure Provider Detail page but we expected to see the Host's Detail page

So if we do the code below the method 'my_host_on.get_power_state()' works ok

ipdb> my_host_on = host_collection.all().pop()

Host(name=u'47b49e2d-c65b-48c6-a27b-605207986de6 (NovaCompute)', provider=None, hostname=None, ip_address=None, custom_ident=None, host_platform=None, ipmi_address=None, mac_address=None, credentials={}, ipmi_credentials=None, interface_type='lan')

Copy link
Contributor

@digitronik digitronik Jan 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dkholodo: I like @mshriver comment. extending... suppose, we have already have one provider lets vsphere then we add rhos uc then about situation will occur means host_collection.all() will return you all host for both provider.

I would like to suggest you; Please, use filtering of all method. It will help you to filter out hosts/nodes for specific provider and then you can select anyone of them for power operation.

Copy link
Member

@mshriver mshriver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please justify the changes to test fixtures

@mshriver
Copy link
Member

mshriver commented Jan 3, 2019

This needs rebase, we don't want to include any merge commits. Please rebase/squash to one (new) commit.

try:
my_host_on = provider.nodes.all().pop()
Copy link
Contributor

@digitronik digitronik Jan 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dkholodo: I like @mshriver comment. extending... suppose, we have already have one provider lets vsphere then we add rhos uc then about situation will occur means host_collection.all() will return you all host for both provider.

I would like to suggest you; Please, use filtering of all method. It will help you to filter out hosts/nodes for specific provider and then you can select anyone of them for power operation.

@digitronik digitronik changed the title [RFR] Fixing infra_hosts_power_tests for the CFME 5.10 [WIPTEST] Fixing infra_hosts_power_tests for the CFME 5.10 Jan 10, 2019
@dkholodo dkholodo force-pushed the fixing_infra_host_power_tests branch from 87ad02a to b05ade2 Compare January 12, 2019 17:29
@dkholodo dkholodo force-pushed the fixing_infra_host_power_tests branch from b05ade2 to 40fbd81 Compare January 12, 2019 17:38
@dajoRH
Copy link
Contributor

dajoRH commented Jan 17, 2019

Lint report for commit 40fbd81:

cfme/infrastructure/host.py:

  • ‼️ Line 666:101: E501 line too long (106 > 100 characters)

Please, rectify these issues 😏 .

No commit flaws detected.

CFME QE Bot

@dajoRH
Copy link
Contributor

dajoRH commented Aug 7, 2019

I detected some fixture changes in commit 40fbd81

The local fixture host_on is used in the following files:

  • cfme/tests/openstack/infrastructure/test_host_power_control.py
    • test_host_power_off

The local fixture host_off is used in the following files:

  • cfme/tests/openstack/infrastructure/test_host_power_control.py
    • test_host_power_on

Please, consider creating a PRT run against these tests make sure your fixture changes do not break existing usage 😃

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants