def verify_user_can_ssh_in_and_cannot_sudo(driver, nas_ip): """verify user can ssh in and cannot sudo.""" global sudo_results cmd = 'ls /' sudo_results = ssh_sudo(cmd, nas_ip, 'qetestuser', 'testing') assert "Sorry, user qetestuser is not allowed to execute" in sudo_results, str( sudo_results)
def open_shell_and_run_su_user(driver): """Open shell and run su user to become that user.""" global sudo_results cmd = 'sudo ls /var/lib/sudo' sudo_results = ssh_sudo(cmd, host, 'ericbsd', 'testing')
def open_a_shell_and_run_su_user_to_become_that_user(driver, nas_ip): """open a shell and run su user to become that user.""" global sudo_results cmd = 'ls /tmp' sudo_results = ssh_sudo(cmd, nas_ip, 'ericbsd', 'testing')
def ssh_in_with_qetest_user_and_try_to_sudo(driver, nas_ip): """ssh in with qetest user and try to sudo.""" global sudo_results2 cmd = 'ls /' sudo_results2 = ssh_sudo(cmd, nas_ip, 'qetestuser', 'testing') assert "vmlinuz" in sudo_results2, str(sudo_results2)