示例#1
0
    def __init__(self, spec):
        self.__spec = spec
        self.__testbundles = []
        self.__testbunfiles = []
        self.__verifs = []
        self.__debugs = []
        self.__setups = []
        self.__triggers = []
        self.__teardowns = []
        self.__common_args = parser.Dict2Object({})
        self.__setup_complete = False
        self.__release_versions = {}

        self.__aborted = False
        self.__attrs = {}
        self.__timer = timeprofiler.TimeProfiler()

        self.__stats_pass = 0
        self.__stats_fail = 0
        self.__stats_ignored = 0
        self.__stats_error = 0
        self.__stats_total = 0
        self.__stats_target = 0
        self.result = types.status.FAILURE
        self.__skip = self.__apply_skip_filters()
        self.__ignoreList = getattr(spec.meta, "ignore_list", [])
        self.__process_provision_spec()
        self.__defaultNicMode = getattr(spec.meta, "nicmode", "classic")
        self.__defaultNicPipeline = GlobalOptions.pipeline
        self.__portspeed = topo_pb2.DataSwitch.Speed_auto
        return
示例#2
0
 def __init__(self, args):
     self.__status = types.status.FAILURE
     self.__timer = timeprofiler.TimeProfiler()
     self.__test_count = 1
     self.args = args
     self.__instid = ""
     self.iterators = TestcaseDataIters()
     self.selected = None
     self.__package = None
     return
示例#3
0
 def __init__(self, spec):
     self.__spec = spec
     self.__timer = timeprofiler.TimeProfiler()
     self.__trigger = 'auto'
     self.__run = 'once'
     self.__sleep_interval = 0
     self.__terminate = 'teardown'
     self.__background = False
     self.__resolve()
     self.__status = api.types.status.FAILURE
     return
示例#4
0
def Main(tc):
    # Check if tc.skip is set
    tc_skip = getattr(tc, 'skip', False)
    if tc_skip:
        return api.types.status.SUCCESS

    api.Logger.info("Vmotion Callback Invoked. TC: %s" % tc.Name())
    vmotion_enabled = getattr(tc.args, 'vmotion_enable', False)
    if not vmotion_enabled:
        api.Logger.debug("Vmotion is not enabled for TC: %s" % tc.Name())
        return api.types.status.SUCCESS

    tc.vmotion_resp = api.types.status.FAILURE
    if getattr(tc, 'vmotion_cntxt', None):

        timer = timeprofiler.TimeProfiler()
        timer.Start()

        # Update the Naples endpoint information - mimicking Venice (run a thread)
        cfg_thread = threading.Thread(target=__create_endpoint_info,
                                      args=(tc, ))

        req = api.Trigger_WorkloadMoveRequest()
        for dest_host, workloads in tc.vmotion_cntxt.MoveRequest.items():
            api.Trigger_WorkloadMoveAddRequest(req, workloads, dest_host)
        cfg_thread.start()
        tc.vmotion_resp = api.TriggerMove(req)

        if tc.vmotion_resp != api.types.status.SUCCESS:
            api.Logger.error("Vmotion failed for TC: %s" % tc.Name())

        cfg_thread.join()
        __update_endpoint_info(tc)

        if tc.vmotion_resp == api.types.status.SUCCESS:
            __delete_endpoint_info(tc)
            vmotion_utils.UpdateCurrentHome(tc)
        timer.Stop()
        tc.vmotion_cntxt.TimeProfile.append(timer.TotalTime())

    return tc.vmotion_resp
示例#5
0
    def __init__(self, spec, parent):
        self.__spec = spec
        self.__parent = parent
        self.__spec.name = self.__spec.name.replace(' ', '_')
        self.__tc = None
        self.__setups = []
        self.__verifs = []
        self.__debugs = []
        self.__triggers = []
        self.__teardowns = []
        self.__background_tasks = {}
        self.__iterid = 0
        self.__resolve()
        self.__enable = getattr(self.__spec, 'enable', True)
        self.__ignored = getattr(self.__spec, "ignore", False)
        self.__stress = getattr(self.__spec, "stress", GlobalOptions.stress)
        self.__package = self.__spec.packages
        try:
            self.timeout = spec.args.timeout
        except:
            self.timeout = defaultTcTimeout

        self.__timer = timeprofiler.TimeProfiler()
        self.__iters = []
        self.__aborted = False
        self.status = types.status.UNAVAIL
        self.iterRes = IterationResults()

        self.__setup_iters()
        self.__setup_background_tasks()
        self.__apply_stress_factor()

        self.__stats_pass = 0
        self.__stats_fail = 0
        self.__stats_ignored = 0
        self.__stats_error = 0
        self.selected = None
        return
示例#6
0
    def __init__(self, bunfile, parent):
        self.__bunfile = bunfile
        self.__parent = parent
        self.__spec = None
        self.__testcases = []
        self.__skip = False
        self.__aborted = False
        self.__timer = timeprofiler.TimeProfiler()
        self.__sel_module = None
        self.__sel_module_args = None
        self.__max_select = None
        self.__sel_entry = None

        self.__stats_pass = 0
        self.__stats_fail = 0
        self.__stats_ignored = 0
        self.__stats_error = 0
        self.__stats_total = 0
        self.__stats_target = 0
        self.__load_bundle()
        self.result = types.status.FAILURE
        self.selected = None
        self.__tbunResults = []
        self.__ignoreList = []
示例#7
0
__iota_server_port = 60000

# This import will parse all the command line options.
import iota.harness.infra.glopts as glopts
glopts.GlobalOptions.topdir = topdir
if glopts.GlobalOptions.logdir is None:
    glopts.GlobalOptions.logdir = "%s/iota" % topdir

import iota.harness.infra.types as types
import iota.harness.infra.utils.timeprofiler as timeprofiler
import iota.harness.infra.engine as engine
import iota.harness.infra.procs as procs

from iota.harness.infra.utils.logger import Logger as Logger

overall_timer = timeprofiler.TimeProfiler()
overall_timer.Start()

gl_srv_process = None


def MoveOldLogs():
    for i in range(256):
        oldlogdir = '%s/iota/oldlogs%d' % (glopts.GlobalOptions.topdir, i)
        if not os.path.exists(oldlogdir): break
    os.system("mkdir %s" % oldlogdir)
    os.system("mv %s/iota/*.log %s/" %
              (glopts.GlobalOptions.topdir, oldlogdir))
    os.system("mv %s/iota/logs %s/" % (glopts.GlobalOptions.topdir, oldlogdir))
    os.system("mv %s/iota/iota_sanity_logs.tar.gz %s/" %
              (glopts.GlobalOptions.topdir, oldlogdir))
示例#8
0
 def __init__(self, spec):
     self.__spec = spec
     self.__timer = timeprofiler.TimeProfiler()
     self.__resolve()
     self.__status = api.types.status.FAILURE
     return