pytest-testinfra icon indicating copy to clipboard operation
pytest-testinfra copied to clipboard

I have issues to run test on a remote VM with paramiko

Open adrienschockaert opened this issue 5 years ago • 1 comments

I want to run a test on a remote VM. To do so I use the paramiko backend like that : py.test -v --instance_name MYDDSR60 --vm_name otvmi460s test_monitoring.py --hosts=otvmi460s

My problem is that when I run the command a password is needed. Althought, When i run it locally no password is needed. In the test I use this kind of command :

batch = "/etc/watchdot/conf.d/batch-mysql.cfg"
    cmd = f"sudo su - mysql -c 'cat {batch}'"

And on the remote VM I only have the right tu run "sudo su - MySQL -c *". Do you know how to solve this ?

adrienschockaert avatar Jul 16 '20 13:07 adrienschockaert

Maybe your sudoers configuration require a tty ?

philpep avatar Jul 20 '20 21:07 philpep