aboutsummaryrefslogtreecommitdiffstats
path: root/test/csit/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py
blob: f07f385f572f156194d20fa86218caaa5faa8a77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import docker

class PrhLibrary(object):
    
    def __init__(self):
        pass

    def check_for_log(self, search_for):
        client = docker.from_env()
        container = client.containers.get('prh')
        for line in container.logs(stream=True):
            if search_for in line.strip():
                return True
        else:
            return False