def setUp(self):

      dir_name = os.path.dirname(os.path.abspath(__file__))

      f, self.jobfile = tempfile.mkstemp()
      init_runtime(runtime)
      runtime.configuration.load()
      runtime.job = Job(jobfile = self.jobfile,
                        runtime = runtime,
                        **runtime.configuration.components.job)

      mgr = runtime.tasks
      task = mgr.Task(testscript = os.path.join(dir_name, 'mock_yamls/trigger_datafile.yaml'),
                      taskid = 'awesome')

      self.testbed = load(os.path.join(dir_name, 'mock_testbeds/testbed.yaml'))
      self.mock_testbed_devices()
      Blitz.parameters = ParameterMap()
      Blitz.uid = 'test.dev'
      Blitz.parameters['testbed'] = self.testbed

      self.blitz_obj = Blitz()
      self.uid = self.blitz_obj.uid
      self.blitz_obj.parent = self
      self.blitz_obj.parent.parameters = mock.Mock()

      self.dev = Device( name='PE1', os='iosxe')
      self.dev.custom = {'abstraction': {'order': ['os']}}
      self.blitz_obj.parameters['test_sections'] = [{'section1': [{'execute': {'command': 'cmd', 'device': 'PE1'}}]}]
      sections = self.blitz_obj._discover()
      self.kwargs = {'self': self.blitz_obj,
                     'testbed': self.testbed,
                     'section': sections[0].__testcls__(sections[0]),
                     'name': ''}
Beispiel #2
0
    def setUp(self):

        test_dir_path = os.path.abspath(
            os.path.join(os.path.dirname(__file__), '../..', 'tests'))
        self.testsuite = os.path.join(test_dir_path,
                                      'mock_yamls/maple_testsuite.yaml')
        self.converter = Testsuite_Converter(self.testsuite)

        file_path = os.path.dirname(os.path.abspath(__file__))
        f, self.jobfile = tempfile.mkstemp()
        init_runtime(runtime)
        runtime.configuration.load()
        runtime.job = Job(jobfile=self.jobfile,
                          runtime=runtime,
                          **runtime.configuration.components.job)
Beispiel #3
0
    def setUp(self):

        dir_name = os.path.dirname(os.path.abspath(__file__))
        f, self.jobfile = tempfile.mkstemp()
        init_runtime(runtime)
        runtime.configuration.load()
        runtime.job = Job(jobfile=self.jobfile,
                          runtime=runtime,
                          **runtime.configuration.components.job)

        mgr = runtime.tasks
        task = mgr.Task(testscript=os.path.join(
            dir_name, 'mock_yamls/trigger_datafile.yaml'),
                        taskid='awesome')

        self._initiate_blitz_cls(self.yaml1)
Beispiel #4
0
    def setUp(self):

        dir_name = os.path.dirname(os.path.abspath(__file__))

        f, self.jobfile = tempfile.mkstemp()
        init_runtime(runtime)
        runtime.configuration.load()
        runtime.job = Job(jobfile=self.jobfile,
                          runtime=runtime,
                          **runtime.configuration.components.job)

        mgr = runtime.tasks
        task = mgr.Task(testscript=os.path.join(
            dir_name, 'mock_yamls/trigger_datafile.yaml'),
                        taskid='awesome')

        self.testbed = load(
            os.path.join(dir_name, 'mock_testbeds/testbed.yaml'))
        self.mock_testbed_devs()
        Blitz.parameters = ParameterMap()
        Blitz.uid = 'test.dev'
        Blitz.parameters['testbed'] = self.testbed

        self.blitz_obj = Blitz()

        self.blitz_obj.parameters['test_sections'] = [{
            'section1': [{
                'parallel': [{
                    'action': {
                        'arg1': 'cmd'
                    }
                }]
            }]
        }]
        sections = self.blitz_obj._discover()

        self.kwargs = {
            'self': self.blitz_obj,
            'testbed': self.testbed,
            'section': sections[0].__testcls__(sections[0]),
            'name': ''
        }