pytest-testinfra
pytest-testinfra copied to clipboard
I have issues to run test on a remote VM with paramiko
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 ?
Maybe your sudoers configuration require a tty ?