pymtt
 All Classes Namespaces Files Functions Variables Groups
DefaultMTTDefaults.py
Go to the documentation of this file.
1 # -*- coding: utf-8; tab-width: 4; indent-tabs-mode: f; python-indent: 4 -*-
2 #
3 # Copyright (c) 2015-2018 Intel, Inc. All rights reserved.
4 # $COPYRIGHT$
5 #
6 # Additional copyrights may follow
7 #
8 # $HEADER$
9 #
10 
11 from __future__ import print_function
12 import os
13 from MTTDefaultsMTTStage import *
14 
15 ##
16 # @addtogroup Stages
17 # @{
18 # @addtogroup MTTDefaults
19 # @section DefaultMTTDefaults
20 # Store any provided default MTT settings
21 # @param trial Use when testing your MTT client setup; results that are generated and submitted to the database are marked as \"trials\" and are not included in normal reporting.
22 # @param scratch Specify the DIRECTORY under which scratch files are to be stored
23 # @param description Provide a brief title/description to be included in the log for this test
24 # @param platform Name of the system under test
25 # @param organization Name of the organization running the test
26 # @param merge_stdout_stderr Merge stdout and stderr into one output stream
27 # @param stdout_save_lines Number of lines of stdout to save (-1 for unlimited)
28 # @param stderr_save_lines Number of lines of stderr to save (-1 for unlimited)
29 # @param executor Strategy to use: combinatorial or sequential executor
30 # @param time Record how long it takes to run each individual test
31 # @}
33 
34  def __init__(self):
35  # initialise parent class
36  MTTDefaultsMTTStage.__init__(self)
37  self.options = {}
38  self.options['trial'] = (False, "Use when testing your MTT client setup; results that are generated and submitted to the database are marked as \"trials\" and are not included in normal reporting.")
39  self.options['scratch'] = ("./mttscratch", "Specify the DIRECTORY under which scratch files are to be stored")
40  self.options['description'] = (None, "Provide a brief title/description to be included in the log for this test")
41  self.options['platform'] = (None, "Name of the system under test")
42  self.options['organization'] = (None, "Name of the organization running the test")
43  self.options['merge_stdout_stderr'] = (False, "Merge stdout and stderr into one output stream")
44  self.options['stdout_save_lines'] = (-1, "Number of lines of stdout to save (-1 for unlimited)")
45  self.options['stderr_save_lines'] = (-1, "Number of lines of stderr to save (-1 for unlimited)")
46  self.options['executor'] = ('sequential', "Strategy to use: combinatorial or sequential executor")
47  self.options['time'] = (True, "Record how long it takes to run each individual test")
48  return
49 
50  def activate(self):
51  # get the automatic procedure from IPlugin
52  IPlugin.activate(self)
53  return
54 
55 
56  def deactivate(self):
57  IPlugin.deactivate(self)
58  return
59 
60  def print_name(self):
61  return "DefaultMTTDefaults"
62 
63  def print_options(self, testDef, prefix):
64  lines = testDef.printOptions(self.options)
65  for line in lines:
66  print(prefix + line)
67  return
68 
69  def priority(self):
70  return 5
71 
72  def execute(self, log, keyvals, testDef):
73  testDef.logger.verbose_print("Set MTT Defaults")
74  cmds = {}
75  # the parseOptions function will record status for us
76  testDef.parseOptions(log, self.options, keyvals, cmds)
77  # we need to record the results into our options so
78  # subsequent sections can capture them
79  keys = cmds.keys()
80  for key in keys:
81  self.options[key] = (cmds[key], self.options[key][1])
82  return