Skip to content

Commit da90bb3

Browse files
committed
xfail "docker top" tests, and adjust for alpine image
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent a9867c9 commit da90bb3

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

tests/integration/api_container_test.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,8 @@ def test_port(self):
11021102

11031103

11041104
class ContainerTopTest(BaseAPIIntegrationTest):
1105+
@pytest.mark.xfail(reason='Output of docker top depends on host distro, '
1106+
'and is not formalized.')
11051107
def test_top(self):
11061108
container = self.client.create_container(
11071109
TEST_IMG, ['sleep', '60']
@@ -1112,28 +1114,25 @@ def test_top(self):
11121114
self.client.start(container)
11131115
res = self.client.top(container)
11141116
if not IS_WINDOWS_PLATFORM:
1115-
assert res['Titles'] == [
1116-
'UID', 'PID', 'PPID', 'C', 'STIME', 'TTY', 'TIME', 'CMD'
1117-
]
1117+
assert res['Titles'] == [u'PID', u'USER', u'TIME', u'COMMAND']
11181118
assert len(res['Processes']) == 1
11191119
assert res['Processes'][0][-1] == 'sleep 60'
11201120
self.client.kill(container)
11211121

11221122
@pytest.mark.skipif(
11231123
IS_WINDOWS_PLATFORM, reason='No psargs support on windows'
11241124
)
1125+
@pytest.mark.xfail(reason='Output of docker top depends on host distro, '
1126+
'and is not formalized.')
11251127
def test_top_with_psargs(self):
11261128
container = self.client.create_container(
11271129
TEST_IMG, ['sleep', '60'])
11281130

11291131
self.tmp_containers.append(container)
11301132

11311133
self.client.start(container)
1132-
res = self.client.top(container, 'waux')
1133-
assert res['Titles'] == [
1134-
'USER', 'PID', '%CPU', '%MEM', 'VSZ', 'RSS',
1135-
'TTY', 'STAT', 'START', 'TIME', 'COMMAND'
1136-
]
1134+
res = self.client.top(container, '-eopid,user')
1135+
assert res['Titles'] == [u'PID', u'USER']
11371136
assert len(res['Processes']) == 1
11381137
assert res['Processes'][0][10] == 'sleep 60'
11391138

0 commit comments

Comments
 (0)