本文整理汇总了Python中utils.dockerutil.DockerUtil._parse_subsystem方法的典型用法代码示例。如果您正苦于以下问题:Python DockerUtil._parse_subsystem方法的具体用法?Python DockerUtil._parse_subsystem怎么用?Python DockerUtil._parse_subsystem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utils.dockerutil.DockerUtil
的用法示例。
在下文中一共展示了DockerUtil._parse_subsystem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_parse_subsystem
# 需要导入模块: from utils.dockerutil import DockerUtil [as 别名]
# 或者: from utils.dockerutil.DockerUtil import _parse_subsystem [as 别名]
def test_parse_subsystem(self):
lines = [
# (line, expected_result)
(
# Kubernetes < 1.6
['10', 'memory', '/2ea504688cad325b9105f183b0d7831266a05f95b513c7327a6e9989ce8a450a'],
'2ea504688cad325b9105f183b0d7831266a05f95b513c7327a6e9989ce8a450a'
), (
# New CoreOS / most systems
['10', 'memory', '/docker/2ea504688cad325b9105f183b0d7831266a05f95b513c7327a6e9989ce8a450a'],
'docker/2ea504688cad325b9105f183b0d7831266a05f95b513c7327a6e9989ce8a450a'
), (
# Unidentified legacy system?
['10', 'memory', '2ea504688cad325b9105f183b0d7831266a05f95b513c7327a6e9989ce8a450a'],
'2ea504688cad325b9105f183b0d7831266a05f95b513c7327a6e9989ce8a450a'
), (
# Rancher
['10', 'memory', '/docker/864daa0a0b19aa4703231b6c76f85c6f369b2452a5a7f777f0c9101c0fd5772a/docker/3bac629503293d1bb61e74f3e25b6c525f0c262f22974634c5d6988bb4b07927'],
'docker/3bac629503293d1bb61e74f3e25b6c525f0c262f22974634c5d6988bb4b07927'
), (
# Legacy CoreOS 7xx
['7', 'memory', '/system.slice/docker-71116698eb215f2a5819f11ece7ea721f0e8d45169c7484d1cd7812596fad454.scope'],
'system.slice/docker-71116698eb215f2a5819f11ece7ea721f0e8d45169c7484d1cd7812596fad454.scope'
), (
# Kubernetes >= 1.6 QoS cgroups
['7', 'memory', '/kubepods/burstable/poda0f63163-3fa8-11e7-a098-42010a840216/7e071d0086ebe623dcbf3a7e0005f23eb08d7ea4df4bb42075df43c9359ce078'],
'kubepods/burstable/poda0f63163-3fa8-11e7-a098-42010a840216/7e071d0086ebe623dcbf3a7e0005f23eb08d7ea4df4bb42075df43c9359ce078'
)
]
du = DockerUtil()
for line, exp_res in lines:
self.assertEquals(du._parse_subsystem(line), exp_res)
示例2: test_parse_subsystem
# 需要导入模块: from utils.dockerutil import DockerUtil [as 别名]
# 或者: from utils.dockerutil.DockerUtil import _parse_subsystem [as 别名]
def test_parse_subsystem(self):
lines = [
# (line, expected_result)
(
['10', 'memory', '/2ea504688cad325b9105f183b0d7831266a05f95b513c7327a6e9989ce8a450a'],
'2ea504688cad325b9105f183b0d7831266a05f95b513c7327a6e9989ce8a450a'
), (
['10', 'memory', '/docker/2ea504688cad325b9105f183b0d7831266a05f95b513c7327a6e9989ce8a450a'],
'docker/2ea504688cad325b9105f183b0d7831266a05f95b513c7327a6e9989ce8a450a'
), (
['10', 'memory', '2ea504688cad325b9105f183b0d7831266a05f95b513c7327a6e9989ce8a450a'],
'2ea504688cad325b9105f183b0d7831266a05f95b513c7327a6e9989ce8a450a'
), (
['10', 'memory', '/docker/864daa0a0b19aa4703231b6c76f85c6f369b2452a5a7f777f0c9101c0fd5772a/docker/3bac629503293d1bb61e74f3e25b6c525f0c262f22974634c5d6988bb4b07927'],
'docker/3bac629503293d1bb61e74f3e25b6c525f0c262f22974634c5d6988bb4b07927'
), (
['7', 'memory', '/system.slice/docker-71116698eb215f2a5819f11ece7ea721f0e8d45169c7484d1cd7812596fad454.scope'],
'system.slice/docker-71116698eb215f2a5819f11ece7ea721f0e8d45169c7484d1cd7812596fad454.scope'
)
]
du = DockerUtil()
for line, exp_res in lines:
self.assertEquals(du._parse_subsystem(line), exp_res)