コード例 #1
0
def _RunBenchmark(name, yaml_file):
    """Runs a single distributed benchmark.

  Args:
    name: name of the benchmark to run.
    yaml_file: path to kubernetes config file.
  """
    kubectl_util.DeletePods(name, yaml_file)
    kubectl_util.CreatePods(name, yaml_file)
    kubectl_util.WaitForCompletion(name)
    kubectl_util.DeletePods(name, yaml_file)
コード例 #2
0
 def testDeletePods(self, mock_check_call, mock_check_output):
     mock_check_output.return_value = ''
     kubectl_util.DeletePods('test_pod', 'test.yaml')
     mock_check_call.assert_called_once_with(
         ['kubectl', 'delete', '--filename=test.yaml'])
     mock_check_output.assert_called_once_with([
         'kubectl', 'get', 'pods', '-o', 'name', '-a', '-l',
         'name-prefix in (test_pod)'
     ],
                                               universal_newlines=True)