forked from p15670423/monkey
CR fixes
This commit is contained in:
parent
90be53e920
commit
46868e9996
|
@ -49,10 +49,8 @@ class CommunicateAsNewUser(PBA):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_commandline_for_ping(domain=PING_TEST_DOMAIN, is_windows=is_windows_os()):
|
def get_commandline_for_ping(domain=PING_TEST_DOMAIN, is_windows=is_windows_os()):
|
||||||
if is_windows:
|
format_string = "PING.exe {domain} -n 1" if is_windows else "ping -c 1 {domain}"
|
||||||
return "{} {} {} {}".format("PING.exe", domain, "-n", "1")
|
format_string.format(domain=domain)
|
||||||
else:
|
|
||||||
return "ping -c 1 {domain}".format(domain=PING_TEST_DOMAIN)
|
|
||||||
|
|
||||||
def send_ping_result_telemetry(self, exit_status, commandline, username):
|
def send_ping_result_telemetry(self, exit_status, commandline, username):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -35,4 +35,8 @@ class AutoNewUser:
|
||||||
|
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def run_as(self, command):
|
def run_as(self, command):
|
||||||
|
"""
|
||||||
|
Run the given command as the new user that was created.
|
||||||
|
:param command: The command to run - give as shell commandline (e.g. "ping google.com -n 1")
|
||||||
|
"""
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
|
@ -9,6 +9,7 @@ WAIT_TIMEOUT_IN_MILLISECONDS = 20 * 1000
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def get_windows_commands_to_add_user(username, password, should_be_active=False):
|
def get_windows_commands_to_add_user(username, password, should_be_active=False):
|
||||||
windows_cmds = [
|
windows_cmds = [
|
||||||
'net',
|
'net',
|
||||||
|
@ -41,6 +42,7 @@ class AutoNewWindowsUser(AutoNewUser):
|
||||||
"""
|
"""
|
||||||
See AutoNewUser's documentation for details.
|
See AutoNewUser's documentation for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, username, password):
|
def __init__(self, username, password):
|
||||||
"""
|
"""
|
||||||
Creates a user with the username + password.
|
Creates a user with the username + password.
|
||||||
|
|
Loading…
Reference in New Issue