How to use load_from_build_log method in autotest

Best Python code snippet using autotest_python

version_0.py

Source:version_0.py Github

copy

Full Screen

...90 while True:91 if not os.path.exists(build_dir):92 break93 build_log = os.path.join(build_dir, "debug", "build_log")94 attributes = kernel.load_from_build_log(build_log)95 if attributes:96 break97 i += 198 build_dir = os.path.join(dir, "build.%d" % (i))99 if not attributes:100 if verify_ident:101 base = verify_ident102 else:103 base = kernel.load_from_sysinfo(dir)104 patches = []105 hashes = []106 else:107 base, patches, hashes = attributes108 logging.debug("kernel.__init__() found kernel version %s"109 % base)110 # compute the kernel hash111 if base == "UNKNOWN":112 kernel_hash = "UNKNOWN"113 else:114 kernel_hash = kernel.compute_hash(base, hashes)115 return {"base": base, "patches": patches,116 "kernel_hash": kernel_hash}117 @staticmethod118 def load_from_sysinfo(path):119 for subdir in ("reboot1", ""):120 uname_path = os.path.join(path, "sysinfo", subdir,121 "uname_-a")122 if not os.path.exists(uname_path):123 continue124 uname = open(uname_path).readline().split()125 return re.sub("-autotest$", "", uname[2])126 return "UNKNOWN"127 @staticmethod128 def load_from_build_log(path):129 if not os.path.exists(path):130 return None131 base, patches, hashes = "UNKNOWN", [], []132 for line in file(path):133 head, rest = line.split(": ", 1)134 rest = rest.split()135 if head == "BASE":136 base = rest[0]137 elif head == "PATCH":138 patches.append(patch(*rest))139 hashes.append(rest[2])140 return base, patches, hashes141class test(models.test):142 def __init__(self, subdir, testname, status, reason, test_kernel,...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run autotest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful