Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

executer: support run with sudo. #140

Merged
merged 9 commits into from
Feb 3, 2021

Conversation

myakove
Copy link

@myakove myakove commented Feb 1, 2021

exec = host.executor(sudo=True)

@rnetser
Copy link

rnetser commented Feb 1, 2021

/lgtm

@lukas-bednar lukas-bednar added this to the 0.1.25 milestone Feb 1, 2021
@codecov
Copy link

codecov bot commented Feb 1, 2021

Codecov Report

Merging #140 (6e5e580) into master (0827dd7) will decrease coverage by 0.04%.
The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #140      +/-   ##
==========================================
- Coverage   79.87%   79.83%   -0.05%     
==========================================
  Files          19       19              
  Lines        1883     1889       +6     
==========================================
+ Hits         1504     1508       +4     
- Misses        379      381       +2     
Impacted Files Coverage Δ
rrmngmnt/ssh.py 33.11% <60.00%> (+<0.01%) ⬆️
rrmngmnt/host.py 64.31% <100.00%> (+0.50%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0827dd7...6e5e580. Read the comment docs.

@lukas-bednar lukas-bednar self-requested a review February 2, 2021 07:34
@lukas-bednar
Copy link
Member

@myakove could you please add one test case passing sudo=True ?

@myakove
Copy link
Author

myakove commented Feb 2, 2021

@myakove could you please add one test case passing sudo=True ?

@lukas-bednar What am I missing?

def get_host(self, ip='1.1.1.1', sudo=False):
    h = Host(ip)
    h.add_user(User('root', '11111'))
    if sudo:
        h.executor(sudo=sudo)

    return h

def get_pm(self, sudo=False):
    return self.get_host(sudo=sudo).package_manager

def test_exist_with_sudo(self):
    assert self.get_pm(sudo=True).exist(self.packages['installed_1'])

@lukas-bednar lukas-bednar merged commit 14ae0c9 into rhevm-qe-automation:master Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants