tripleoclient stable/train unit tests prompts for sudo

Bug #1895683 reported by Alex Schultz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
High
Alex Schultz

Bug Description

We appear to be missing a mock somewhere as the unit tests are prompting for sudo access.

Creating Swift container to store the plan
Creating plan from template files in: /tht-root/
sys:1: ResourceWarning: unclosed file <_io.FileIO name=1 mode='wb' closefd=True>

[sudo] password for aschultz:
ERROR: got KeyboardInterrupt signal
Traceback (most recent call last):
  File "/home/aschultz/Documents/workspace/tripleo/python-tripleoclient/.tox/py36/lib/python3.6/site-packages/stestr/commands/load.py", line 267, in _load_case
    case.run(result)
  File "/home/aschultz/Documents/workspace/tripleo/python-tripleoclient/.tox/py36/lib/python3.6/site-packages/testtools/testsuite.py", line 168, in run
    event_dict = queue.get()
  File "/home/aschultz/.pyenv/versions/3.6.8/lib/python3.6/queue.py", line 164, in get
    self.not_empty.wait()
  File "/home/aschultz/.pyenv/versions/3.6.8/lib/python3.6/threading.py", line 295, in wait
    waiter.acquire()
KeyboardInterrupt

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    b'Traceback (most recent call last):'
    b' File "/home/aschultz/Documents/workspace/tripleo/python-tripleoclient/tripleoclient/utils.py", line 1789, in run_command'
    b' env=env)'
    b' File "/home/aschultz/.pyenv/versions/3.6.8/lib/python3.6/subprocess.py", line 356, in check_output'
    b' **kwargs).stdout'
    b' File "/home/aschultz/.pyenv/versions/3.6.8/lib/python3.6/subprocess.py", line 438, in run'
    b' output=stdout, stderr=stderr)'
    b"subprocess.CalledProcessError: Command '['sudo', 'ln', '-s', '/usr/bin/ansible-playbook', '/usr/bin/ansible-playbook-3']' returned non-zero exit status 1."
    b''
    b'During handling of the above exception, another exception occurred:'
    b''
    b'Traceback (most recent call last):'
    b' File "/home/aschultz/Documents/workspace/tripleo/python-tripleoclient/tripleoclient/tests/v1/container_image/test_tripleo_container_image.py", line 187, in test_image_build_with_volume'
    b' self._take_action(parsed_args=parsed_args)'
    b' File "/home/aschultz/Documents/workspace/tripleo/python-tripleoclient/tripleoclient/tests/v1/container_image/test_tripleo_container_image.py", line 93, in _take_action'
    b' self.cmd.take_action(parsed_args)'
    b' File "/home/aschultz/Documents/workspace/tripleo/python-tripleoclient/tripleoclient/v1/tripleo_container_image.py", line 548, in take_action'
    b' utils.ansible_symlink()'
    b' File "/home/aschultz/Documents/workspace/tripleo/python-tripleoclient/tripleoclient/utils.py", line 1940, in ansible_symlink'
    b" run_command(cmd, name='ansible-playbook-3-symlink')"
    b' File "/home/aschultz/Documents/workspace/tripleo/python-tripleoclient/tripleoclient/utils.py", line 1796, in run_command'
    b' raise RuntimeError(message)'
    b"RuntimeError: ansible-playbook-3-symlink failed: b'sudo: 3 incorrect password attempts\\n'"
    b''

description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-tripleoclient (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/752054

Changed in tripleo:
assignee: nobody → Alex Schultz (alex-schultz)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-tripleoclient (stable/train)

Reviewed: https://review.opendev.org/752054
Committed: https://git.openstack.org/cgit/openstack/python-tripleoclient/commit/?id=370be5b41e136333e51e37528f01a0020e4ce5ba
Submitter: Zuul
Branch: stable/train

commit 370be5b41e136333e51e37528f01a0020e4ce5ba
Author: Alex Schultz <email address hidden>
Date: Tue Sep 15 08:17:04 2020 -0600

    [TRAIN-Only] Fix missing mock

    We're currently getting prompted for sudo because we are not properly
    mocking the symlink function. This change adds a mock for the
    utils.ansible_symlink to prevent it from being executed.

    Change-Id: Ifdd9c9ccbdf4d04a1f4f5017f4920b788ea5ca76
    Closes-Bug: #1895683

tags: added: in-stable-train
Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-tripleoclient 12.4.0

This issue was fixed in the openstack/python-tripleoclient 12.4.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.