mirror of https://github.com/docker/docker-py.git
xfail "docker top" tests, and adjust for alpine image
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
a9867c9912
commit
da90bb3259
|
@ -1102,6 +1102,8 @@ class PortTest(BaseAPIIntegrationTest):
|
|||
|
||||
|
||||
class ContainerTopTest(BaseAPIIntegrationTest):
|
||||
@pytest.mark.xfail(reason='Output of docker top depends on host distro, '
|
||||
'and is not formalized.')
|
||||
def test_top(self):
|
||||
container = self.client.create_container(
|
||||
TEST_IMG, ['sleep', '60']
|
||||
|
@ -1112,9 +1114,7 @@ class ContainerTopTest(BaseAPIIntegrationTest):
|
|||
self.client.start(container)
|
||||
res = self.client.top(container)
|
||||
if not IS_WINDOWS_PLATFORM:
|
||||
assert res['Titles'] == [
|
||||
'UID', 'PID', 'PPID', 'C', 'STIME', 'TTY', 'TIME', 'CMD'
|
||||
]
|
||||
assert res['Titles'] == [u'PID', u'USER', u'TIME', u'COMMAND']
|
||||
assert len(res['Processes']) == 1
|
||||
assert res['Processes'][0][-1] == 'sleep 60'
|
||||
self.client.kill(container)
|
||||
|
@ -1122,6 +1122,8 @@ class ContainerTopTest(BaseAPIIntegrationTest):
|
|||
@pytest.mark.skipif(
|
||||
IS_WINDOWS_PLATFORM, reason='No psargs support on windows'
|
||||
)
|
||||
@pytest.mark.xfail(reason='Output of docker top depends on host distro, '
|
||||
'and is not formalized.')
|
||||
def test_top_with_psargs(self):
|
||||
container = self.client.create_container(
|
||||
TEST_IMG, ['sleep', '60'])
|
||||
|
@ -1129,11 +1131,8 @@ class ContainerTopTest(BaseAPIIntegrationTest):
|
|||
self.tmp_containers.append(container)
|
||||
|
||||
self.client.start(container)
|
||||
res = self.client.top(container, 'waux')
|
||||
assert res['Titles'] == [
|
||||
'USER', 'PID', '%CPU', '%MEM', 'VSZ', 'RSS',
|
||||
'TTY', 'STAT', 'START', 'TIME', 'COMMAND'
|
||||
]
|
||||
res = self.client.top(container, '-eopid,user')
|
||||
assert res['Titles'] == [u'PID', u'USER']
|
||||
assert len(res['Processes']) == 1
|
||||
assert res['Processes'][0][10] == 'sleep 60'
|
||||
|
||||
|
|
Loading…
Reference in New Issue