Update tests

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
This commit is contained in:
Petr "Stone" Hracek 2017-04-07 15:09:05 +02:00
commit 660bcdd20e
2 changed files with 17 additions and 13 deletions

View file

@ -23,7 +23,8 @@
from moduleframework import module_framework
import os
import time
from avocado.utils import service
class simpleTests(module_framework.AvocadoTest):
"""
@ -31,10 +32,11 @@ class simpleTests(module_framework.AvocadoTest):
"""
def setUp(self):
super(self.__class__, self).setUp()
service_manager = service.ServiceManager()
service_manager.start('docker')
self.runHost('docker pull docker.io/httpd')
self.runHost('docker run --name http_name_8000 -d -p 8000:80 docker.io/httpd')
self.runHost('docker run --name http_name_8001 -d -p 8001:80 docker.io/httpd')
time.sleep(5)
def tearDown(self):
super(self.__class__, self).tearDown()
@ -45,5 +47,5 @@ class simpleTests(module_framework.AvocadoTest):
def testAssertIn(self):
self.start()
self.assertIn('It works!',self.runHost('curl localhost:8077').stdout)
self.assertIn('It works!',self.runHost('curl 127.0.0.1:8077', shell = True).stdout)