Best Python code snippet using lisa_python
manager.py
Source:manager.py
...232 ]233 #234 # Install operating system specific packages235 #236 self._install_os_packages(kit, os_info_list)237 #238 # Initialize any DB tables provided by the kit239 #240 db_manager.init_database()241 #242 # Add the kit to the database243 #244 self._kit_db_api.addKit(installer.session, kit)245 #246 # Clean up the kit archive directory247 #248 self._clean_kit_achiv_dir(kit, installer.install_path)249 #250 # Install puppet modules251 #252 installer.run_action('install_puppet_modules')253 #254 # Run post install255 #256 installer.run_action('post_install')257 if eula:258 ActionManager().logAction(259 'Kit [{}] installed and EULA accepted at [{}]'260 ' local machine time.'.format(261 installer.spec, time.ctime())262 )263 else:264 ActionManager().logAction(265 'Kit [{}] installed at [{}] local machine time.'.format(266 installer.spec, time.ctime())267 )268 def _install_os_packages(self, kit, os_info_list):269 """270 Installs OS specific packages from the kit into the repo.271 :param kit: the kit instance272 :param os_info_list: a list of osInfo instances to install for273 """274 all_component_list = kit.getComponentList()275 for os_info in os_info_list:276 self._logger.debug(277 'Preparing to install ({}, {}, {}) for {}'.format(278 kit.getName(), kit.getVersion(), kit.getIteration(),279 os_info280 )281 )282 #...
dpdkovs.py
Source:dpdkovs.py
...39 kernel_version = self.node.tools[Uname].get_linux_information().kernel_version40 return kernel_version > "4.4.0" and (41 isinstance(self.node.os, Debian) or isinstance(self.node.os, Fedora)42 )43 def _install_os_packages(self) -> None:44 os = self.node.os45 if isinstance(os, Debian):46 os.install_packages(self.ubuntu_packages)47 elif isinstance(self.node.os, Fedora):48 # NOTE: RHEL 8 works without additional packages,49 # an edit may be needed later after further testing.50 pass51 else:52 raise UnsupportedDistroException(53 os,54 "OVS install for this test is not implemented on this platform",55 )56 def _install(self) -> bool:57 # NOTE: defer building until we can provide the DPDK source dir as a parameter.58 # _install just checks out our resources and sets up the version info59 # TODO: Add option to select which OVS version to use other than latest60 node = self.node61 self._install_os_packages()62 # NOTE: dpdk build is big, use this function to find a safe spot to build.63 build_path = node.find_partition_with_freespace(size_in_gb=30)64 self.ovs_build_path = node.get_pure_path(build_path).joinpath("ovs_build")65 # create the dir and chown it since partition ownership is not guaranteed66 node.shell.mkdir(self.ovs_build_path)67 username = node.tools[Whoami].get_username()68 node.tools[Chown].change_owner(self.ovs_build_path, username, recurse=True)69 # checkout git and get latest version tag70 git = self.node.tools[Git]71 self.repo_dir = git.clone(72 "https://github.com/openvswitch/ovs.git",73 cwd=self.ovs_build_path,74 )75 latest_version_tag = git.get_tag(cwd=self.repo_dir)...
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!!