Skip to content

Commit

Permalink
Turn on test debugging
Browse files Browse the repository at this point in the history
Signed-off-by: Jhon Honce <jhonce@redhat.com>

Closes: #1369
Approved by: rhatdan
  • Loading branch information
jwhonce authored and rh-atomic-bot committed Aug 31, 2018
1 parent 8245f09 commit 6d067fc
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .papr.yml
Expand Up @@ -9,7 +9,7 @@ host:
ram: 8192
cpus: 4
required: true
timeout: 120m
timeout: 90m

tests:
- CONTAINER_RUNTIME="podman" sh .papr_prepare.sh
Expand All @@ -35,7 +35,7 @@ extra-repos:

required: true

timeout: 120m
timeout: 90m

tests:
- sh .papr_prepare.sh
Expand Down Expand Up @@ -63,7 +63,7 @@ tests:
- CONTAINER_RUNTIME="podman" sh .papr_prepare.sh
required: false

timeout: 120m
timeout: 90m
context: "Fedora fedora/28/cloud Podman"

---
Expand Down
2 changes: 1 addition & 1 deletion contrib/python/podman/Makefile
Expand Up @@ -11,7 +11,7 @@ lint:

.PHONY: integration
integration:
test/test_runner.sh
test/test_runner.sh -v

.PHONY: install
install:
Expand Down
19 changes: 13 additions & 6 deletions contrib/python/podman/test/test_containers.py
@@ -1,6 +1,7 @@
import os
import signal
import unittest
from pathlib import Path
from test.podman_testcase import PodmanTestCase
from test.retry_decorator import retry

Expand Down Expand Up @@ -219,13 +220,19 @@ def test_pause_unpause(self):
self.assertTrue(ctnr.status, 'running')

# creating cgoups can be flakey
@retry(podman.libs.errors.ErrorOccurred, tries=16, delay=2, print_=print)
@retry(podman.libs.errors.ErrorOccurred, tries=4, delay=2, print_=print)
def test_stats(self):
self.assertTrue(self.alpine_ctnr.running)

actual = self.alpine_ctnr.stats()
self.assertEqual(self.alpine_ctnr.id, actual.id)
self.assertEqual(self.alpine_ctnr.names, actual.name)
try:
self.assertTrue(self.alpine_ctnr.running)

actual = self.alpine_ctnr.stats()
self.assertEqual(self.alpine_ctnr.id, actual.id)
self.assertEqual(self.alpine_ctnr.names, actual.name)
except Exception:
info = Path('/proc/self/mountinfo')
with info.open() as fd:
print('{} {}'.format(self.alpine_ctnr.id, info))
print(fd.read())

def test_logs(self):
self.assertTrue(self.alpine_ctnr.running)
Expand Down
14 changes: 9 additions & 5 deletions contrib/python/podman/test/test_tunnel.py
@@ -1,5 +1,6 @@
from __future__ import absolute_import

import logging
import time
import unittest
from unittest.mock import MagicMock, patch
Expand Down Expand Up @@ -66,16 +67,19 @@ def test_tunnel(self, mock_finalize, mock_exists, mock_Popen):
)
tunnel = Tunnel(context).bore()

cmd = [
'ssh',
'-fNT',
'-q',
cmd = ['ssh', '-fNT']
if logging.getLogger().getEffectiveLevel() == logging.DEBUG:
cmd.append('-v')
else:
cmd.append('-q')

cmd.extend((
'-L',
'{}:{}'.format(context.local_socket, context.remote_socket),
'-i',
context.identity_file,
'{}@{}'.format(context.username, context.hostname),
]
))

mock_finalize.assert_called_once_with(tunnel, tunnel.close)
mock_exists.assert_called_once_with(context.local_socket)
Expand Down

0 comments on commit 6d067fc

Please sign in to comment.