Best Python code snippet using autotest_python
dacapo.py
Source:dacapo.py
...43 if not os.path.isdir(cachedir):44 os.makedirs(cachedir)45 dacapo_url = cfg.get('dacapo', 'tarball_url')46 dacapo_md5 = cfg.get('dacapo', 'package_md5')47 dacapo_pkg = utils.unmap_url_cache(cachedir, dacapo_url, dacapo_md5)48 if not jvm == 'default':49 # Get the jvm package50 jvm_pkg_url = cfg.get(jvm, 'jvm_pkg_url')51 jvm_pkg_md5 = cfg.get(jvm, 'package_md5')52 jvm_pkg = utils.unmap_url_cache(cachedir, jvm_pkg_url, jvm_pkg_md5)53 # Install it54 swman = software_manager.SoftwareManager()55 swman.install(jvm_pkg)56 # Basic Java environment variables setup57 java_root = cfg.get(jvm, 'java_root')58 self.set_java_environment(jvm, java_root)59 if cfg.get('global', 'use_global') == 'yes':60 iterations = cfg.get('global', 'iterations')61 workload = cfg.get('global', 'workload')62 else:63 iterations = cfg.get(test, 'iterations')64 workload = cfg.get(test, 'workload')65 verbose = '-v '66 workload = '-s %s ' % workload...
rhts_linpack.py
Source:rhts_linpack.py
...15 rhts_pkg_list = ['beakerlib', 'rhts_test_env']16 for pkg in rhts_pkg_list:17 pkg_url = cfg.get('rhts_test_env', '%s_url' % pkg)18 pkg_md5 = cfg.get('rhts_test_env', '%s_md5' % pkg)19 pkg = utils.unmap_url_cache(cachedir, pkg_url, pkg_md5)20 package.install(pkg)21 linpack_url = cfg.get('linpack', 'package_url')22 linpack_md5 = cfg.get('linpack', 'package_md5')23 linpack_pkg = utils.unmap_url_cache(cachedir, linpack_url, linpack_md5)24 package.install(linpack_pkg)25 self.raw_result_file = os.path.join(self.resultsdir,26 'raw_output_%s' % self.iteration)27 raw_result = open(self.raw_result_file, 'w')28 logging.info('Running linpack perf test...')29 try:30 cmd = '(cd /mnt/tests/performance/linpack/certification/ && ' \31 '/bin/bash runtest.sh)'32 results = utils.run(command=cmd, stdout_tee=raw_result,33 stderr_tee=raw_result)34 self.results = results.stderr35 raw_result.close()36 except error.CmdError, e:37 raise error.TestError('Linpack perf test has failed: %s' % e)...
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!