def pixel_fire_and_verify_logs(self,test): data=data_set[test['test_case']] issues=[] desired_cap = config_helper.read_config('pixel_mt3') self.ssh = PySSH() self.ssh.connect(desired_cap) pixel_fire=self.ssh.runcmd("testmt 88 '%s'"%data['curl_parameter']) if 'HTTP/1.1 200 OK' not in pixel_fire: issues.append('pixel fire does not success..please check') '''Verify udb logs 1-verify parent pixel 2-verify uuid pixel , uuid start with 7 3-verify child pixel(v6/v10/s1...) ''' retrive_pixel_from_udb_logs=self.ssh.get_pixel_logs(log_type='udb',search_string=data['udb_log_parent_pixel_search_string']) if data["udb_log_parent_pixel_search_string"] not in retrive_pixel_from_udb_logs: issues.append('retrive_pixel_from_udb_logs does not match with udb_log_parent_pixel_search_string input') retrive_pixel_from_udb_logs=self.ssh.get_pixel_logs(log_type='udb',search_string=data['udb_log_child_pixel_search_string']) if data["udb_log_child_pixel_search_string"] not in retrive_pixel_from_udb_logs: issues.append('retrive_pixel_from_udb_logs:%s does not match with udb_log_child_pixel_search_string input:%s'%(retrive_pixel_from_udb_logs,data["udb_log_child_pixel_search_string"])) retrive_pixel_from_udb_logs=self.ssh.get_pixel_logs(log_type='udb',search_string=data['udb_log_uuid_pixel_search_string']) if 'uuid_not_start_with_7' in test['test_case']: if data['udb_log_uuid_pixel_search_string'] in retrive_pixel_from_udb_logs: issues.append('retrive_pixel_from_udb_logs should not include child pixel(%s) as uuid not start with 7'%data['child_pixel']) else: if data['udb_log_uuid_pixel_search_string'] not in retrive_pixel_from_udb_logs: issues.append('retrive_pixel_from_udb_logs should include child pixel(%s) as uuid start with 7'%data['child_pixel']) '''Verify pixel logs 1-verify parent pixel 2-verify uuid pixel , uuid start with 7 3-verify child pixel(v6/v10/s1...) ''' retrive_pixel_from_pixel_logs=self.ssh.get_pixel_logs(log_type='pixel',search_string=data['pixel_log_parent_pixel_search_string']) if '%s'%data['expeced_event_in_pixel_log'] not in retrive_pixel_from_pixel_logs: issues.append('retrive_pixel_from_pixel_logs:%s does not match with expected input:%s'%(retrive_pixel_from_pixel_logs,data['expeced_event_in_pixel_log'])) retrive_pixel_from_pixel_logs=self.ssh.get_pixel_logs(log_type='pixel',search_string=data['pixel_log_uuid_pixel_search_string']) if 'uuid_not_start_with_7' in test['test_case']: if '%s'%data['expeced_event_in_pixel_log2'] in retrive_pixel_from_pixel_logs: issues.append('retrive_pixel_from_pixel_logs:%s should not include child pixel(%s) as uuid not start with 7'%(retrive_pixel_from_pixel_logs,data['child_pixel'])) retrive_pixel_from_pixel_logs=self.ssh.get_pixel_logs(log_type='pixel',search_string=data['pixel_log_child_pixel_search_string']) if '%s'%data['expeced_event_in_pixel_log3'] not in retrive_pixel_from_pixel_logs: issues.append('retrive_pixel_from_pixel_logs should include v6 pixel(%s) as v6=%s'%(data['v6_pixel'],data['v6'])) else: if '%s'%data['expeced_event_in_pixel_log2'] not in retrive_pixel_from_pixel_logs: issues.append('retrive_pixel_from_pixel_logs should include child pixel(%s) as uuid start with 7'%data['child_pixel']) retrive_pixel_from_pixel_logs=self.ssh.get_pixel_logs(log_type='pixel',search_string=data['pixel_log_child_pixel_search_string']) if '%s'%data['expeced_event_in_pixel_log3'] not in retrive_pixel_from_pixel_logs: issues.append('retrive_pixel_from_pixel_logs should include v6 pixel(%s) as v6=%s'%(data['v6_pixel'],data['v6'])) assert not issues, '||'.join(issues)
def get_pixel_logs(self,cmd): desired_cap = config_helper.read_config('pixel_mt3') self.ssh = PySSH() self.ssh.connect(desired_cap) pixel_logs=self.ssh.runcmd(cmd) return pixel_logs