Lines Matching refs:mock_runcmd
508 def test_copy_files_to(self, mock_copyfiles, mock_runcmd, mock_isdir): argument
512 self.mock_cmd_exec.RunCommand = mock_runcmd
520 self.assertEqual(mock_runcmd.call_count, 0)
529 mock_runcmd.reset_mock()
534 self.assertEqual(mock_runcmd.call_count, 3)
536 self.assertEqual(mock_runcmd.call_args_list[0],
537 mock_runcmd.call_args_list[1])
538 self.assertEqual(mock_runcmd.call_args_list[0],
539 mock_runcmd.call_args_list[2])
540 self.assertEqual(mock_runcmd.call_args_list[0][0], ('mkdir -p /tmp/test',))
699 def test_get_keyvals(self, mock_chrootruncmd, mock_runcmd, mock_mkdtemp, argument
709 mock_runcmd.reset_mock()
726 self.result.ce.RunCommand = mock_runcmd
735 self.assertEqual(mock_runcmd.call_count, 1)
736 self.assertEqual(mock_runcmd.call_args_list[0][0],
756 self.assertEqual(mock_runcmd.call_count, 0)
796 def test_find_files_in_results_dir(self, mock_runcmd): argument
802 self.result.ce.RunCommand = mock_runcmd
804 mock_runcmd.return_value = [0, '/tmp/test_results/perf.data', '']
806 self.assertEqual(mock_runcmd.call_count, 1)
807 self.assertEqual(mock_runcmd.call_args_list[0][0],
811 mock_runcmd.reset_mock()
812 mock_runcmd.return_value = [1, '', '']
851 def test_get_turbostat_file_finds_single_log(self, mock_runcmd): argument
854 self.result.ce.RunCommandWOutput = mock_runcmd
855 mock_runcmd.return_value = (0, 'some/long/path/turbostat.log', '')
860 def test_get_turbostat_file_finds_multiple_logs(self, mock_runcmd): argument
863 self.result.ce.RunCommandWOutput = mock_runcmd
864 mock_runcmd.return_value = (0,
871 def test_get_turbostat_file_finds_no_logs(self, mock_runcmd): argument
874 self.result.ce.RunCommandWOutput = mock_runcmd
875 mock_runcmd.return_value = (0, '', '')
880 def test_get_turbostat_file_with_failing_find(self, mock_runcmd): argument
883 mock_runcmd.return_value = (-1, '', 'error')
888 def test_get_top_file_finds_single_log(self, mock_runcmd): argument
891 self.result.ce.RunCommandWOutput = mock_runcmd
892 mock_runcmd.return_value = (0, 'some/long/path/top.log', '')
897 def test_get_top_file_finds_multiple_logs(self, mock_runcmd): argument
900 self.result.ce.RunCommandWOutput = mock_runcmd
901 mock_runcmd.return_value = (0, 'some/long/path/top.log\ntop.log', '')
906 def test_get_top_file_finds_no_logs(self, mock_runcmd): argument
909 self.result.ce.RunCommandWOutput = mock_runcmd
910 mock_runcmd.return_value = (0, '', '')
915 def test_get_cpuinfo_file_finds_single_log(self, mock_runcmd): argument
918 self.result.ce.RunCommandWOutput = mock_runcmd
919 mock_runcmd.return_value = (0, 'some/long/path/cpuinfo.log', '')
924 def test_get_cpustats_file_finds_single_log(self, mock_runcmd): argument
927 self.result.ce.RunCommandWOutput = mock_runcmd
928 mock_runcmd.return_value = (0, 'some/long/path/cpustats.log', '')
933 def test_get_cpustats_file_finds_multiple_logs(self, mock_runcmd): argument
936 self.result.ce.RunCommandWOutput = mock_runcmd
937 mock_runcmd.return_value = (0, 'some/long/path/cpustats.log\ncpustats.log',
943 def test_get_cpustats_file_finds_no_logs(self, mock_runcmd): argument
946 self.result.ce.RunCommandWOutput = mock_runcmd
947 mock_runcmd.return_value = (0, '', '')
970 def test_read_pid_from_perf_data_ok(self, mock_runcmd): argument
972 self.result.ce.ChrootRunCommandWOutput = mock_runcmd
975 mock_runcmd.return_value = (0, PERF_DATA_HEADER.format(pid=exp_pid), '')
981 def test_read_pid_from_perf_data_mult_profiles(self, mock_runcmd): argument
983 self.result.ce.ChrootRunCommandWOutput = mock_runcmd
992 mock_runcmd.side_effect = [
1001 def test_read_pid_from_perf_data_no_pid(self, mock_runcmd): argument
1003 self.result.ce.ChrootRunCommandWOutput = mock_runcmd
1006 mock_runcmd.return_value = (0, cmd_line, '')
1013 def test_read_pid_from_perf_data_system_wide(self, mock_runcmd): argument
1015 self.result.ce.ChrootRunCommandWOutput = mock_runcmd
1019 mock_runcmd.return_value = (0, cmd_line, '')
1026 def test_read_pid_from_perf_data_read_fail(self, mock_runcmd): argument
1028 self.result.ce.ChrootRunCommandWOutput = mock_runcmd
1031 mock_runcmd.return_value = (1, '', '')
1037 def test_read_pid_from_perf_data_fail(self, mock_runcmd): argument
1039 self.result.ce.ChrootRunCommandWOutput = mock_runcmd
1042 mock_runcmd.return_value = (0, '', '')
1642 def test_cleanup(self, mock_runcmd, mock_getroot): argument
1647 self.result.ce.RunCommand = mock_runcmd
1652 self.assertEqual(mock_runcmd.call_count, 2)
1653 self.assertEqual(mock_runcmd.call_args_list[0][0],
1655 self.assertEqual(mock_runcmd.call_args_list[1][0], ('rm -rf testtemp_dir',))
1660 mock_runcmd.reset_mock()
1662 self.result.ce.RunCommand = mock_runcmd
1667 self.assertEqual(mock_runcmd.call_count, 2)
1668 self.assertEqual(mock_runcmd.call_args_list[0][0],
1670 self.assertEqual(mock_runcmd.call_args_list[1][0], ('rm -rf testtemp_dir',))
1674 mock_runcmd.reset_mock()
1677 self.assertEqual(mock_runcmd.call_count, 1)
1678 self.assertEqual(mock_runcmd.call_args_list[0][0], ('rm -rf testtemp_dir',))
1682 mock_runcmd.reset_mock()
1687 self.assertEqual(mock_runcmd.call_count, 0)
2048 def test_read_result(self, mock_create, mock_isdir, mock_runcmd): argument
2079 self.assertEqual(mock_runcmd.call_count, 1)
2083 mock_runcmd.reset_mock()
2087 self.assertEqual(mock_runcmd.call_count, 0)
2095 self.assertEqual(mock_runcmd.call_count, 0)
2102 self.assertEqual(mock_runcmd.call_count, 0)
2110 self.assertEqual(mock_runcmd.call_count, 0)
2116 self.assertEqual(mock_runcmd.call_count, 0)
2124 self.assertEqual(mock_runcmd.call_count, 0)