How to use tee_redirect_debug_dir method in autotest

Best Python code snippet using autotest_python

subcommand.py

Source:subcommand.py Github

copy

Full Screen

...119 cls.join_hooks.append(hook)120 def redirect_output(self):121 if self.subdir and logging_manager_object:122 tag = os.path.basename(self.subdir)123 logging_manager_object.tee_redirect_debug_dir(self.debug, tag=tag)124 def fork_start(self):125 sys.stdout.flush()126 sys.stderr.flush()127 r, w = os.pipe()128 self.returncode = None129 self.pid = os.fork()130 if self.pid: # I am the parent131 os.close(w)132 self.result_pickle = os.fdopen(r, 'r')133 return134 else:135 os.close(r)136 # We are the child from this point on. Never return.137 signal.signal(signal.SIGTERM, signal.SIG_DFL) # clear handler...

Full Screen

Full Screen

xen.py

Source:xen.py Github

copy

Full Screen

...27 if logfile == '':28 logfile = os.path.join(self.log_dir, 'xen_build')29 os.chdir(self.build_dir)30 self.log('log_dir: %s ' % self.log_dir)31 self.job.logging.tee_redirect_debug_dir(self.log_dir, log_name=logfile)32 # build xen hypervisor and user-space tools33 targets = ['xen', 'tools']34 threads = 2 * utils.count_cpus()35 for t in targets:36 build_string = 'make -j %d %s %s' % (threads, make_opts, t)37 self.log('build_string: %s' % build_string)38 utils.system(build_string)39 # make a kernel job out of the kernel from the xen src if one isn't provided40 if self.kjob is None:41 # get xen kernel tree ready42 self.log("prep-ing xen'ified kernel source tree")43 utils.system('make prep-kernels')44 v = self.get_xen_kernel_build_ver()45 self.log('building xen kernel version: %s' % v)...

Full Screen

Full Screen

client_logging_config.py

Source:client_logging_config.py Github

copy

Full Screen

...8class ClientLoggingConfig(logging_config.LoggingConfig):9 """10 1.首先调用super(ClientLoggingConfig, self).configure_logging,生成两个handler指向stdout和stderr11 2.然后如果有result dir,调用add_debug_file_handlers,生成4个filehandler,指向resultdir/debug/12 3.在test.py中会调用job.logging.tee_redirect_debug_dir(self.debugdir,log_name=self.tagged_testname)13 这是manager的函数,会再次调用到add_debug_file_handlers函数,在debugdir里面重新创建4个filehandler14 """15 def add_debug_file_handlers(self, log_dir, log_name=None):16 #增加4个handler指向4个级别17 if not log_name:18 log_name = settings.get_value('CLIENT', 'default_logging_name',19 type=str, default='client')20 self._add_file_handlers_for_all_levels(log_dir, log_name)21 #这个方法将对logging进行配置,job.py中传入的值为:result_dir=self.resultdir22 #verbose=option.verbose23 def configure_logging(self, results_dir=None, verbose=False):24 super(ClientLoggingConfig, self).configure_logging(25 use_console=self.use_console,26 verbose=verbose)...

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