How to use get_pidfile_id_from method in autotest

Best Python code snippet using autotest_python

drone_manager_unittest.py

Source:drone_manager_unittest.py Github

copy

Full Screen

...272 os.path.join(self._DRONE_RESULTS_DIR, file_path), written_data))273 def test_pidfile_expiration(self):274 self.god.stub_with(self.manager, '_get_max_pidfile_refreshes',275 lambda: 0)276 pidfile_id = self.manager.get_pidfile_id_from('tag', 'name')277 self.manager.register_pidfile(pidfile_id)278 self.manager._drop_old_pidfiles()279 self.manager._drop_old_pidfiles()280 self.assertFalse(self.manager._registered_pidfile_info)281class ThreadedDroneTest(unittest.TestCase):282 _DRONE_INSTALL_DIR = '/drone/install/dir'283 _RESULTS_DIR = '/results/dir'284 _DRONE_CLASS = drones._RemoteDrone285 _DRONE_HOST = ssh_host.SSHHost286 def create_drone(self, drone_hostname, mock_hostname,287 timestamp_remote_calls=False):288 """Create and initialize a Remote Drone.289 @return: A remote drone instance.290 """291 mock_host = self.god.create_mock_class(self._DRONE_HOST, mock_hostname)292 self.god.stub_function(drones.drone_utility, 'create_host')293 drones.drone_utility.create_host.expect_call(drone_hostname).and_return(294 mock_host)295 mock_host.is_up.expect_call().and_return(True)296 return self._DRONE_CLASS(drone_hostname,297 timestamp_remote_calls=timestamp_remote_calls)298 def create_fake_pidfile_info(self, tag='tag', name='name'):299 pidfile_id = self.manager.get_pidfile_id_from(tag, name)300 self.manager.register_pidfile(pidfile_id)301 return self.manager._registered_pidfile_info302 def setUp(self):303 self.god = mock.mock_god()304 self.god.stub_with(drones, 'AUTOTEST_INSTALL_DIR',305 self._DRONE_INSTALL_DIR)306 self.manager = drone_manager.DroneManager()307 self.god.stub_with(self.manager, '_results_dir', self._RESULTS_DIR)308 # we don't want this to ever actually get called309 self.god.stub_function(drones, 'get_drone')310 # we don't want the DroneManager to go messing with global config311 def do_nothing():312 pass313 self.god.stub_with(self.manager, 'refresh_drone_configs', do_nothing)...

Full Screen

Full Screen

pidfile_monitor.py

Source:pidfile_monitor.py Github

copy

Full Screen

...57 def attach_to_existing_process(self, execution_path,58 pidfile_name=drone_manager.AUTOSERV_PID_FILE,59 num_processes=None):60 self._set_start_time()61 self.pidfile_id = self._drone_manager.get_pidfile_id_from(62 execution_path, pidfile_name=pidfile_name)63 if num_processes is not None:64 self._drone_manager.declare_process_count(self.pidfile_id, num_processes)65 def kill(self):66 if self.has_process():67 self._drone_manager.kill_process(self.get_process())68 self._killed = True69 def has_process(self):70 self._get_pidfile_info()71 return self._state.process is not None72 def get_process(self):73 self._get_pidfile_info()74 assert self._state.process is not None75 return self._state.process...

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