Tox for sysinv is prompting for sudo access

Bug #1829405 reported by Al Bailey on 2019-05-16
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Medium
Al Bailey

Bug Description

Brief Description
-----------------
When attempting to run python unit tests for sysinv in tox, there are prompts for sudo access.

Severity
--------
Minor.

Steps to Reproduce
------------------
In the sysinv directory, type:
tox -e py27
or
tox -e py27 -- tests.conductor.test_ceph.UpdateCephCluster.test_add_4_mix_bbbb

Expected Behavior
------------------
The unit test should run, without requiring sudo access, and without appearing to take forever.

Actual Behavior
----------------
If you dont have sudo access, I think you can eventually enter bad passwords and continue, but if you don't notice the prompts, it looks like tox is taking forever.

Reproducibility
---------------
Always

System Configuration
--------------------
Designer environment. Expect you to checkout starlingx/config the supported way, through repo init.

Branch/Pull Time/Commit
-----------------------
The problem was introduced by this commit
https://opendev.org/starlingx/config/commit/0fe4655be52199b881e65e05da9795b2e5bb2b0a

which adds refresh_helm_repo_information which calls "sudo"

Last Pass
---------
Any time before May 10

Timestamp/Logs
--------------
Nope.

Test Activity
-------------
Developer Testing

Note: I have a fix for this. I will upload a review.

Al Bailey (albailey1974) on 2019-05-16
Changed in starlingx:
assignee: nobody → Al Bailey (albailey1974)
Bruce Jones (brucej) wrote :

The code in question invokes sudo with login "wrsroot" which (hopefully) was addressed during the big wrsroot removal change that just happened. If not, it will fail in a different way.

We probably shouldn't be unit testing code that invokes a shell. :)

Fix proposed to branch: master
Review: https://review.opendev.org/659616

Changed in starlingx:
status: New → In Progress
Ghada Khalil (gkhalil) wrote :

Marking as release gating as this impacts developers' ability/productivity when running tox testing. Medium priority.

Changed in starlingx:
importance: Undecided → Medium
tags: added: stx.tools
Ghada Khalil (gkhalil) on 2019-05-18
tags: added: stx.2.0 stx.zuul

Reviewed: https://review.opendev.org/659616
Committed: https://git.openstack.org/cgit/starlingx/config/commit/?id=d70395104b21f5ba3cbd54b0cc96424e402ac751
Submitter: Zuul
Branch: master

commit d70395104b21f5ba3cbd54b0cc96424e402ac751
Author: Al Bailey <email address hidden>
Date: Thu May 16 11:18:36 2019 -0500

    Mock away a method in unit tests that requires sudo

    When helm repository refreshing was added to sysinv by
    https://review.opendev.org/#/c/656745/
    it meant that any unit tests that construct a conductor
    manager would prompt for sudo password.

    This commit mocks away the method that makes the sudo call.

    Change-Id: If8118b32a03ac9bdaf4bcdbb6e034df38d7de1e2
    Closes-Bug: #1829405
    Signed-off-by: Al Bailey <email address hidden>

Changed in starlingx:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers