当前位置: 首页>>代码示例>>Python>>正文


Python test_basic.Factory类代码示例

本文整理汇总了Python中lava_dispatcher.pipeline.test.test_basic.Factory的典型用法代码示例。如果您正苦于以下问题:Python Factory类的具体用法?Python Factory怎么用?Python Factory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Factory类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_basic_actions

 def test_basic_actions(self):
     factory = Factory()
     job = factory.create_fake_qemu_job(mkdtemp())
     if not job:
         return unittest.skip("not all deployments have been implemented")
     self.assertIsInstance(job, Job)
     self.assertIsInstance(job.pipeline, Pipeline)
开发者ID:dawei1991,项目名称:lava-dispatcher,代码行数:7,代码来源:test_kvm.py

示例2: setUp

 def setUp(self):
     """
     Attempt to setup a valid group with clients and test the protocol
     """
     super(TestMultinode, self).setUp()
     factory = Factory()
     self.client_job = factory.create_kvm_job('sample_jobs/kvm-multinode-client.yaml')
     self.server_job = factory.create_kvm_job('sample_jobs/kvm-multinode-server.yaml')
     self.coord = TestCoordinator()
开发者ID:dawei1991,项目名称:lava-dispatcher,代码行数:9,代码来源:test_multinode.py

示例3: test_kvm_simulation

    def test_kvm_simulation(self):  # pylint: disable=too-many-statements
        """
        Build a pipeline which simulates a KVM LAVA job
        without using the formal objects (to avoid validating
        data known to be broken). The details are entirely
        arbitrary.
        """
        factory = Factory()
        job = factory.create_kvm_job('sample_jobs/kvm.yaml')
        pipe = Pipeline()
        action = Action()
        action.name = "deploy_linaro_image"
        action.description = "deploy action using preset subactions in an internal pipe"
        action.summary = "deploy_linaro_image"
        action.job = job
        # deliberately unlikely location
        # a successful validation would need to use the cwd
        action.parameters = {"image": "file:///none/images/bad-kvm-debian-wheezy.img"}
        pipe.add_action(action)
        self.assertEqual(action.level, "1")
        deploy_pipe = Pipeline(action)
        action = Action()
        action.name = "downloader"
        action.description = "download image wrapper, including an internal retry pipe"
        action.summary = "downloader"
        action.job = job
        deploy_pipe.add_action(action)
        self.assertEqual(action.level, "1.1")
        # a formal RetryAction would contain a pre-built pipeline which can be inserted directly
        retry_pipe = Pipeline(action)
        action = Action()
        action.name = "wget"
        action.description = "do the download with retries"
        action.summary = "wget"
        action.job = job
        retry_pipe.add_action(action)
        self.assertEqual(action.level, "1.1.1")
        action = Action()
        action.name = "checksum"
        action.description = "checksum the downloaded file"
        action.summary = "md5sum"
        action.job = job
        deploy_pipe.add_action(action)
        self.assertEqual(action.level, "1.2")
        action = Action()
        action.name = "overlay"
        action.description = "apply lava overlay"
        action.summary = "overlay"
        action.job = job
        deploy_pipe.add_action(action)
        self.assertEqual(action.level, "1.3")
        action = Action()
        action.name = "boot"
        action.description = "boot image"
        action.summary = "qemu"
        action.job = job
        # cmd_line built from device configuration
        action.parameters = {
            'cmd_line': [
                'qemu-system-x86_64',
                '-machine accel=kvm:tcg',
                '-hda'
                '%s' % "tbd",
                '-nographic',
                '-net',
                'nic,model=virtio'
                '-net user'
            ]
        }
        pipe.add_action(action)
        self.assertEqual(action.level, "2")

        action = Action()
        action.name = "simulated"
        action.description = "lava test shell"
        action.summary = "simulated"
        action.job = job
        # a formal lava test shell action would include an internal pipe
        # which would handle the run.sh
        pipe.add_action(action)
        self.assertEqual(action.level, "3")
        # just a fake action
        action = Action()
        action.name = "fake"
        action.description = "faking results"
        action.summary = "fake action"
        action.job = job
        pipe.add_action(action)
        self.assertEqual(action.level, "4")
        self.assertEqual(len(pipe.describe()), 4)
开发者ID:dawei1991,项目名称:lava-dispatcher,代码行数:90,代码来源:test_kvm.py

示例4: setUp

 def setUp(self):
     super(TestKVMInlineTestDeploy, self).setUp()
     factory = Factory()
     self.job = factory.create_kvm_job('sample_jobs/kvm-inline.yaml', mkdtemp())
开发者ID:dawei1991,项目名称:lava-dispatcher,代码行数:4,代码来源:test_kvm.py

示例5: setUp

 def setUp(self):
     super(TestMonitor, self).setUp()
     factory = Factory()
     self.job = factory.create_kvm_job('sample_jobs/qemu-monitor.yaml', mkdtemp())
开发者ID:BayLibre,项目名称:lava-dispatcher,代码行数:4,代码来源:test_kvm.py

示例6: setUp

 def setUp(self):
     super(TestDefinitionHandlers, self).setUp()
     factory = Factory()
     self.job = factory.create_kvm_job("sample_jobs/kvm.yaml")
开发者ID:dawei1991,项目名称:lava-dispatcher,代码行数:4,代码来源:test_defs.py

示例7: test_basic_actions

 def test_basic_actions(self):
     factory = Factory()
     job = factory.create_fake_qemu_job()
     self.assertIsInstance(job, Job)
     self.assertIsInstance(job.pipeline, Pipeline)
开发者ID:inwotep,项目名称:lava-dispatcher,代码行数:5,代码来源:test_job.py

示例8: setUp

 def setUp(self):
     super(TestKVMBasicDeploy, self).setUp()
     factory = Factory()
     self.job = factory.create_job('sample_jobs/kvm.yaml', self.config_dir)
开发者ID:inwotep,项目名称:lava-dispatcher,代码行数:4,代码来源:test_job.py

示例9: setUp

 def setUp(self):
     super(TestRepeatBootTest, self).setUp()
     factory = Factory()
     self.job = factory.create_kvm_job('sample_jobs/kvm-repeat.yaml', mkdtemp())
开发者ID:dawei1991,项目名称:lava-dispatcher,代码行数:4,代码来源:test_repeat.py


注:本文中的lava_dispatcher.pipeline.test.test_basic.Factory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。