Bug 1562085

Summary: RFE: Octavia-tempest-plugin: loadbalancer service is missing from tempest.conf
Product: Red Hat OpenStack Reporter: Noam Manos <nmanos>
Component: openstack-tempestAssignee: Chandan Kumar <chkumar>
Status: CLOSED DUPLICATE QA Contact: Martin Kopec <mkopec>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 14.0 (Rocky)CC: amodi, apevec, astafeye, chkumar, lhh, ltoscano, matyoung, mkopec, slinaber, tfreger, udesale
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1557736 Environment:
Last Closed: 2018-06-04 16:12:28 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: 1488126    

Description Noam Manos 2018-03-29 13:46:38 UTC
Description of problem: 
Running "discover-tempest-config" had failure in discovering "api_extensions", and as consequence, "tempest verify-config" (from python-tempestconf) raised IndexError. 


Version-Release number of selected component (if applicable):
OSP: 13   
Puddle: 2018-03-20.2
tempest 18.0.0

How reproducible - 
Always

Steps to Reproduce:
1) Install OSP-13 (master branch).

2) Due to Bug #1554306 - Please also install python-tempestconf:
[stack@undercloud-0 ~]$ sudo yum -y install python-tempestconf

3) Run discover-tempest-config:
[stack@undercloud-0 ~]$ source overcloudrc
(overcloud) [stack@undercloud-0 ~]$ tempest init my_workspace
(overcloud) [stack@undercloud-0 ~]$ cd my_workspace
(overcloud) [stack@undercloud-0 my_workspace]$ discover-tempest-config --deployer-input 

4) Run verify-config:
(overcloud) [stack@undercloud-0 my_workspace]$ tempest verify-config -o ./etc/tempest.conf

Running config verification...

Traceback (most recent call last):
  File "/home/stack/.venv/lib/python2.7/site-packages/tempest/cmd/verify_tempest_config.py", line 488, in take_action
    main(parsed_args)
  File "/home/stack/.venv/lib/python2.7/site-packages/tempest/cmd/verify_tempest_config.py", line 455, in main
    services = check_service_availability(os, update)
  File "/home/stack/.venv/lib/python2.7/site-packages/tempest/cmd/verify_tempest_config.py", line 371, in check_service_availability
    print "cfgname, value = ", cfgname, codename_match[cfgname]
KeyError: 'loadbalancer'


--------

Suggestion - Please fix 3 issues:

1) In "verify_tempest_config.py" - function "check_service_availability":
codename_match dict should include 'loadbalancer': 'loadbalancer'.

A side note - it's rather be 'load-balancer': 'octavia' (as listed by 'openstack endpoint list').


2) Please handle key error for non-existing dict key (in my case "loadbalancer"), to use dict.get() that returns None if no key found: 
< 
if not getattr(CONF.service_available, codename_match[cfgname])'
>

should rather be:
<
'cfg_value = codename_match.get(cfgname)'
if not cfg_value or not getattr(CONF.service_available, cfg_value)
>


3) The generated tempest.conf (by discover-tempest-config) is missing configurations for loadbalancer: 

[service_available]
loadbalancer = True
# rather be named octavia instead, as mentioned before.

[validation]
run_validation = True
# mandatory to later run octavia tempest plugin tests.

Comment 1 Luigi Toscano 2018-03-29 13:55:08 UTC
The first part is a duplicate of 
https://bugzilla.redhat.com/show_bug.cgi?id=1557736

The second part of the bug is really a bug of tempestconf, but at least it can be workarounded (you can pass specific values to override the generated configuration when calling discover-tempest-config, or you can change tempest.conf later).

Comment 2 Noam Manos 2018-04-01 14:19:28 UTC
(In reply to Luigi Toscano from comment #1)
> The first part is a duplicate of 
> https://bugzilla.redhat.com/show_bug.cgi?id=1557736
> 
> The second part of the bug is really a bug of tempestconf, but at least it
> can be workarounded (you can pass specific values to override the generated
> configuration when calling discover-tempest-config, or you can change
> tempest.conf later).

What is duplicate ? 

1) In "verify_tempest_config.py" - function "check_service_availability":
codename_match dict should include 'loadbalancer': 'loadbalancer'.

OR

2) use codename_match.get(cfgname) instead of codename_match[cfgname].

OR

3) tempest.conf missing configurations for loadbalancer.

-------------

(1) and (3) are about loadbalancer.

(2) is to handle KeyError, which is not the same error as in Bug 1557736 - get_enabled_extensions(service) returned IndexError.

Comment 3 Luigi Toscano 2018-04-03 09:04:53 UTC
I see your comment on Bug 1557736., so (2) is a breakage/change introduced by the fix for that bug.

(1) is a problem of tempest verify CLI command, so openstack-tempest.

(3) is related to tempestconf as described in my comment (I see that you opened https://storyboard.openstack.org/#!/story/2001768 )

There are still two different issues in this bug.

Comment 4 Noam Manos 2018-04-09 12:23:15 UTC
(1) and (2) are now also described in Bug 1557736.

(3) should probably be fixed in discover-tempest-config.

It's not part of https://storyboard.openstack.org/#!/story/2001768, which is a different issue (1508904), with different workaround.

Comment 5 Matt Young 2018-04-16 16:39:18 UTC
This is an RFE, not a bug.  It is covered as part of the ongoing tempest refactoring work.

Adding tracker to: https://bugzilla.redhat.com/show_bug.cgi?id=1488126

Comment 6 Noam Manos 2018-04-18 12:34:36 UTC
In latest OSPD 13 puddle 2018-04-10.2, the load balancer service name has been changed to "load_balancer" (was "loadbalancer" previously), so the workaround is:

1) In "verify_tempest_config.py" - function "check_service_availability":
codename_match dict should include 'load_balancer': 'load_balancer'

2) In tempest.conf:
[service_available]
load_balancer = True

Comment 7 Chandan Kumar 2018-06-04 16:12:28 UTC

*** This bug has been marked as a duplicate of bug 1564866 ***

Comment 8 Chandan Kumar 2018-06-04 16:13:11 UTC
https://bugzilla.redhat.com/show_bug.cgi?id=1564866 ->  Configure Roles to support Octavia API RBAC enforcement adds the same in python-tempestconf so marking it as duplicate.