예제 #1
0
 def testCreatePods(self, mock_check_call, mock_check_output):
     mock_check_output.return_value = 'nonempty'
     kubectl_util.CreatePods('test_pod', 'test.yaml')
     mock_check_call.assert_called_once_with(
         ['kubectl', 'create', '--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)
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)