本文整理汇总了Python中lava_dispatcher.action.Pipeline.describe方法的典型用法代码示例。如果您正苦于以下问题:Python Pipeline.describe方法的具体用法?Python Pipeline.describe怎么用?Python Pipeline.describe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lava_dispatcher.action.Pipeline
的用法示例。
在下文中一共展示了Pipeline.describe方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_kvm_simulation
# 需要导入模块: from lava_dispatcher.action import Pipeline [as 别名]
# 或者: from lava_dispatcher.action.Pipeline import describe [as 别名]
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)