當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。