示例#1
0
 def __init__(self, file, destination, with_rename=False, **kwargs):
     self.file = file
     self.destination = destination
     self.with_rename = with_rename
     local_step.__init__(self, **kwargs)
     self.set_errorm("", "Could not copy file {0} to {1}".format(self.file, self.destination))
     self.set_passm("File {0} copied to {1}".format(self.file, self.destination))
示例#2
0
 def __init__(self, folder, **kwargs):
     self.folder = folder
     local_step.__init__(self, **kwargs)
     self.set_passm("Content of the folder {0} deleted".format(self.folder))
     self.set_errorm(
         "", "Could not delete the content of the folder {0}".format(
             self.folder))
示例#3
0
 def __init__(self, serial, timeout=120, device_state="device", **kwargs):
     self.serial = serial
     self.device_state = device_state
     self.timeout = timeout
     local_step.__init__(self, **kwargs)
     self.set_errorm("", "Serial {0} not in adb".format(self.serial))
     self.set_passm("Serial {0} in adb".format(self.serial))
示例#4
0
 def __init__(self, path, folder, **kwargs):
     self.folder = folder
     self.path = path
     local_step.__init__(self, **kwargs)
     self.folder_path = os.path.join(self.path, self.folder)
     self.set_passm("Create {0}".format(self.folder_path))
     self.set_errorm("", "Could not create folder {0}".format(self.folder_path))
示例#5
0
 def __init__(self,
              command,
              stdout_grep=None,
              stderr_grep=None,
              stdout_not_grep=None,
              stderr_not_grep=None,
              env_vars=None,
              live_print=False,
              check_step=True,
              mode="sync",
              stderr_ok="",
              ignore_error=False,
              **kwargs):
     self.command = command
     self.stdout_grep = stdout_grep
     self.stderr_grep = stderr_grep
     self.stdout_not_grep = stdout_not_grep
     self.stderr_not_grep = stderr_not_grep
     self.live_print = live_print
     self.check_step = check_step
     self.mode = mode
     self.stderr_ok = stderr_ok
     self.ignore_error = ignore_error
     local_step.__init__(self, **kwargs)
     if env_vars:
         for name, value in env_vars:
             self.local_connection.set_env(name, value)
     self.set_passm("Running {0}".format(self.command))
     self.set_errorm("", "Running {0}".format(self.command))
示例#6
0
 def __init__(self,
              command,
              ssh_host,
              ssh_user,
              ssh_pass=None,
              check_command=None,
              check_command_output=None,
              live_print=False,
              stderr_ok="",
              ignore_error=False,
              with_flush=False,
              with_sudo=False,
              mode="sync",
              **kwargs):
     local_step.__init__(self, **kwargs)
     self.command = command
     self.ssh_user = ssh_user
     self.ssh_pass = ssh_pass
     self.ssh_host = ssh_host
     self.check_command = check_command
     self.check_command_output = check_command_output
     self.live_print = live_print
     self.stderr_ok = stderr_ok
     self.with_sudo = with_sudo
     self.with_flush = with_flush
     self.ignore_error = ignore_error
     self.mode = mode
     self.set_errorm(
         "",
         "Command {0} was not executed succesfully".format(self.command))
     self.set_passm("Execute {}".format(self.command))
示例#7
0
 def __init__(self, ip_address, port_number, **kwargs):
     self.port_number = port_number
     self.ip_address = ip_address
     local_step.__init__(self, **kwargs)
     self.set_errorm(
         "", "Socket busy: " + self.ip_address + " : " + self.port_number)
     self.set_passm("Socket available: " + self.ip_address + " : " +
                    self.port_number)
示例#8
0
 def __init__(self, ip, timeout=30, **kwargs):
     self.ip = ip
     self.timeout = timeout
     local_step.__init__(self, **kwargs)
     self.set_errorm(
         "",
         "Could not ping {0} in {1} seconds".format(self.ip, self.timeout))
     self.set_passm("{0} pinged in {1} seconds".format(
         self.ip, self.timeout))
示例#9
0
 def __init__(self, zip_path, unzip_destination, **kwargs):
     self.zip_path = zip_path
     self.unzip_destination = unzip_destination
     local_step.__init__(self, **kwargs)
     self.set_errorm(
         "", "Could not unzip {0} to {1}".format(self.zip_path,
                                                 self.unzip_destination))
     self.set_passm("{0} archive unzipped to {1}".format(
         self.zip_path, self.unzip_destination))
示例#10
0
 def __init__(self, port_number, process_name, **kwargs):
     self.port_number = port_number
     self.process_name = process_name
     local_step.__init__(self, **kwargs)
     self.set_errorm(
         "", "Could not kill PID of " + self.process_name +
         " using port number " + self.port_number)
     self.set_passm("Killed PID of " + self.process_name +
                    " using port number " + self.port_number)
示例#11
0
 def __init__(self, folder, destination, **kwargs):
     self.folder = folder
     self.destination = destination
     local_step.__init__(self, **kwargs)
     self.set_errorm(
         "", "Could not copy folder {0}'s content to {1}".format(
             self.folder, self.destination))
     self.set_passm("Folder {0}'s content copied to {1}".format(
         self.folder, self.destination))
示例#12
0
 def __init__(self,
              ssh_host="192.168.1.1",
              ssh_user="******",
              ssh_pwd=None,
              **kwargs):
     self.ssh_host = ssh_host
     self.ssh_user = ssh_user
     self.ssh_pwd = ssh_pwd
     local_step.__init__(self, **kwargs)
示例#13
0
 def __init__(self, tar_path, untar_path, **kwargs):
     self.tar_path = tar_path
     self.untar_path = untar_path
     local_step.__init__(self, **kwargs)
     self.set_errorm(
         "",
         "Could not extract tar {0} to {1}".format(self.tar_path,
                                                   self.untar_path))
     self.set_passm("{0} archive extracted to {1}".format(
         self.tar_path, self.untar_path))
示例#14
0
 def __init__(self, url, user=None, passwd=None, path_to_download=None, aditional_params=None, live_print=False,
              mode="sync", **kwargs):
     local_step.__init__(self, **kwargs)
     self.url = url
     self.user = user
     self.passwd = passwd
     self.set_passm("{0} download done".format(url))
     self.set_errorm("", "Error! Cannot download {0}!".format(url))
     self.path_to_download = path_to_download
     self.aditional_params = aditional_params
     self.live_print = live_print
     self.mode = mode
示例#15
0
 def __init__(self, local, remote, ssh_host, ssh_user, ssh_pass=None, live_print=False, stderr_ok="",
              with_rename=False, **kwargs):
     local_step.__init__(self, **kwargs)
     self.local = local
     self.remote = remote
     self.ssh_user = ssh_user
     self.ssh_pass = ssh_pass
     self.ssh_host = ssh_host
     self.live_print = live_print
     self.stderr_ok = stderr_ok
     self.with_rename = with_rename
     self.set_errorm("", "{0} could not be copied to {1} on {1}".format(self.local, self.remote, self.ssh_host))
     self.set_passm("{0} copied to {1} on {2}".format(self.local, self.remote, self.ssh_host))
示例#16
0
 def __init__(self,
              script,
              name,
              pass_message="succeeded!",
              fail_message="FAILED",
              **kwargs):
     local_step.__init__(self, **kwargs)
     self.script = script
     self.name = name
     self.pass_message = pass_message
     self.fail_message = fail_message
     self.set_passm("Running Dalvik test " + self.name)
     self.set_errorm("", "Running Dalvik test " + self.name)
示例#17
0
 def __init__(self,
              interface5g='0',
              ssh_host="192.168.1.1",
              ssh_user="******",
              ssh_pwd=None,
              state="up",
              **kwargs):
     self.ssh_host = ssh_host
     self.ssh_user = ssh_user
     self.ssh_pwd = ssh_pwd
     self.state = state
     self.interface5g = interface5g
     local_step.__init__(self, **kwargs)
示例#18
0
 def __init__(self,
              serial,
              android_build_top,
              boot_img,
              username,
              timeout=20,
              **kwargs):
     self.serial = serial
     self.timeout = timeout
     self.android_build_top = android_build_top
     self.boot_img = boot_img
     self.username = username
     local_step.__init__(self, **kwargs)
     self.set_errorm("", "Serial {0} is still in adb".format(self.serial))
     self.set_passm("Serial {0} not adb - rebooting".format(self.serial))
示例#19
0
 def __init__(self,
              screen_name,
              screen_command,
              with_log=False,
              screen_log="screenlog.0",
              grep_for=None,
              timeout=30,
              rows=10,
              **kwargs):
     self.screen_name = screen_name
     self.screen_command = screen_command
     self.with_log = with_log
     self.screen_log = screen_log
     self.timeout = timeout
     self.rows = rows
     if self.with_log:
         with open(self.screen_log, "w"):
             pass
     self.grep_for = grep_for
     local_step.__init__(self, **kwargs)
示例#20
0
 def __init__(self,
              device,
              screen_name,
              screen_log,
              flash_xml_path,
              user_build,
              user_signed,
              timeout=450,
              grep_for=["Phone Flash Tool exited with code "],
              update=False,
              **kwargs):
     adb_step.__init__(self, **kwargs)
     local_step.__init__(self, **kwargs)
     self.device = device
     self.screen_name = screen_name
     self.screen_log = screen_log
     if "xml" in flash_xml_path:
         self.screen_command = "phoneflashtool --cli --os-sn {0} --flash-file {1}".format(
             self.serial, flash_xml_path)
     else:
         if self.device_info.has_multiple_flashfiles:
             flash_conf_id = self.device_info.flash_configuration_id
             if "$platform" in flash_conf_id:
                 flash_conf_id = flash_conf_id.replace(
                     "$platform", os.environ["PLATFORM"])
             self.screen_command = "phoneflashtool --cli --os-sn {0} --flash-file {1} --configuration {2}".format(
                 self.serial,
                 flash_xml_path,
                 flash_conf_id,
             )
         else:
             self.screen_command = "phoneflashtool --cli --os-sn {0} --flash-file {1}".format(
                 self.serial, flash_xml_path)
     self.user_build = user_build
     self.user_signed = user_signed
     self.timeout = timeout
     self.grep_for = grep_for
     self.update = update
示例#21
0
 def __init__(self,
              path_to_image,
              platform="ECS27B",
              prop_file='build.prop',
              device_prop="ro.build.version.incremental",
              user_signed=False,
              cts_abi=None,
              resources_subfolder=None,
              flash_xml_path=None,
              edit_flash_file=True,
              repackage_userdata=False,
              fls_tool_location=None,
              fake_userdata_size="4569694208",
              **kwargs):
     self.path_to_image = path_to_image
     self.platform = platform
     self.prop_file = prop_file
     self.device_prop = device_prop
     self.user_signed = user_signed
     self.cts_abi = cts_abi
     self.flash_xml_path = flash_xml_path
     self.edit_flash_file = edit_flash_file
     self.repackage_userdata = repackage_userdata
     self.fls_tool_location = fls_tool_location
     self.fake_userdata_size = fake_userdata_size
     if "RESOURCES_FOLDER" in os.environ:
         self.resources_folder = os.environ["RESOURCES_FOLDER"]
     else:
         self.resources_folder = os.path.join(os.getenv("HOME"),
                                              "acas/resources/")
     if resources_subfolder:
         self.resources_folder = os.path.join(self.resources_folder,
                                              resources_subfolder)
     self.repackage_build_location = 'build'
     self.repackage_origdata_location = 'origdata'
     self.repackage_fakedata_location = 'fakedata'
     self.new_userdata_name = 'my_new_userdata.fls'
     local_step.__init__(self, **kwargs)
示例#22
0
 def __init__(self, ip, **kwargs):
     self.ip = ip
     local_step.__init__(self, **kwargs)
     self.set_errorm("", "The repair -wR command could not be performed")
示例#23
0
 def __init__(self, file_name, **kwargs):
     self.file_name = file_name
     local_step.__init__(self, **kwargs)
     self.set_errorm("", "Could not delete file {0}".format(self.file_name))
     self.set_passm("Deleting file {0}".format(self.file_name))
示例#24
0
 def __init__(self, file_name, **kwargs):
     self.file_name = file_name
     local_step.__init__(self, **kwargs)
     self.set_passm("File {0} removed".format(self.file_name))
     self.set_errorm("", "Cannot remove file {0}".format(self.file_name))
示例#25
0
 def __init__(self, serial, timeout=120, **kwargs):
     self.serial = serial
     self.timeout = timeout
     local_step.__init__(self, **kwargs)
     self.set_errorm("", "Serial {0} not in cos".format(self.serial))
     self.set_passm("Serial {0} in cos".format(self.serial))
示例#26
0
 def __init__(self, serial, **kwargs):
     self.serial = serial
     local_step.__init__(self, **kwargs)
示例#27
0
 def __init__(self, new_folder, **kwargs):
     self.new_folder = new_folder.rstrip("/")
     local_step.__init__(self, **kwargs)
     self.set_errorm("",
                     "Could not change dir to {0}".format(self.new_folder))
     self.set_passm("Change directory to {0}".format(self.new_folder))
示例#28
0
 def __init__(self, file_name, size, **kwargs):
     self.file_name = file_name
     self.size = size
     local_step.__init__(self, **kwargs)
     self.set_passm("File {0} created".format(self.file_name))
     self.set_errorm("", "Cannot create file {0}".format(self.file_name))