# Path: moduleframework/module_framework.py
# PROFILE = None
# def skipTestIf(value, text="Test not intended for this module profile"):
# 
# Path: moduleframework/common.py
# class MTFConfParser(dict):
# class CommonFunctions(object):
#     def __init__(self):
# def generate_unique_name(size=10):
# def get_openshift_local():
# def get_openshift_ip():
# def get_openshift_user():
# def get_openshift_passwd():
# def get_if_install_default_profile():
# def is_recursive_download():
# def get_if_do_cleanup():
# def get_if_reuse():
# def get_if_remoterepos():
# def get_odcs_envvar():
# def is_true(value):
# def get_openidc_auth():
# def get_if_module():
# def sanitize_text(text, replacement="_", invalid_chars=["/", ";", "&", ">", "<", "|"]):
# def sanitize_cmd(cmd):
# def translate_cmd(cmd, translation_dict=None):
# def get_profile():
# def get_url():
# def get_compose_url():
# def get_modulemdurl():
#     def __init__(self, *args, **kwargs):
#     def loadconfig(self):
#     def set_url(self, url=None, force=False):
#     def get_url(self):
#     def get_template(self):
#     def get_docker_pull(self):
#     def getArch(self):
#     def runHost(self, command="ls /", **kwargs):
#     def get_test_dependencies(self):
#     def installTestDependencies(self, packages=None):
#     def getPackageList(self, profile=None):
#     def getModuleDependencies(self):
#     def dependency_list(self):
#     def dependency_list(self, value):
#     def getModulemdYamlconfig(self, urllink=None):
#     def getIPaddr(self):
#     def ip_address(self):
#     def ip_address(self, value):
#     def _callSetupFromConfig(self):
#     def _callCleanupFromConfig(self):
#     def run(self, command, **kwargs):
#     def get_packager(self):
#     def status(self, command="/bin/true"):
#     def start(self, command="/bin/true"):
#     def stop(self, command="/bin/true"):
#     def install_packages(self, packages=None):
#     def tearDown(self):
#     def copyTo(self, src, dest):
#     def copyFrom(self, src, dest):
#     def run_script(self, filename, *args, **kwargs):
# def get_config(fail_without_url=True, reload=False):
# def list_modules_from_config():
# def get_backend_list():
# def get_module_type():
# def get_module_type_base():
# def get_docker_file(dir_name=conf["docker"]["dockerfiledefaultlocation"]):
# def get_helpmd_file(dir_name=conf["docker"]["dockerfiledefaultlocation"]):
# def getBasePackageSet(modulesDict=None, isModule=True, isContainer=False):
# def get_base_compose():


from moduleframework import module_framework
from moduleframework import common
import time
import urllib
    :avocado: enable
    """
    ip_address = common.trans_dict["GUESTIPADDR"]
    port = "8080"

    def life_check(self, ip_address=None, port=None, textcheck="Hello from gunicorn WSGI application!"):
        ip_address = ip_address or self.ip_address
        port = port or self.port
        # wait until container initialized (without probe)
        time.sleep(3)
        urlfd = urllib.urlopen("http://%s:%s" % (ip_address, port))
        self.assertIn(textcheck, urlfd.read())
        urlfd.close()

    def test_basic(self):
        self.start()
        self.life_check()

    def test_via_curl(self):
        self.start()
        self.life_check()
        output = self.runHost("curl http://%s:%s" % (self.ip_address, self.port))
        self.assertIn("Hello from gunicorn WSGI application!", output.stdout)

    def test_another_port(self):
        self.backend.info["start"]="docker run -p 9999:8080"
        self.start()
        self.life_check(port="9999")



# Path: moduleframework/module_framework.py
# PROFILE = None
# def skipTestIf(value, text="Test not intended for this module profile"):
# 
# Path: moduleframework/common.py
# class MTFConfParser(dict):
# class CommonFunctions(object):
#     def __init__(self):
# def generate_unique_name(size=10):
# def get_openshift_local():
# def get_openshift_ip():
# def get_openshift_user():
# def get_openshift_passwd():
# def get_if_install_default_profile():
# def is_recursive_download():
# def get_if_do_cleanup():
# def get_if_reuse():
# def get_if_remoterepos():
# def get_odcs_envvar():
# def is_true(value):
# def get_openidc_auth():
# def get_if_module():
# def sanitize_text(text, replacement="_", invalid_chars=["/", ";", "&", ">", "<", "|"]):
# def sanitize_cmd(cmd):
# def translate_cmd(cmd, translation_dict=None):
# def get_profile():
# def get_url():
# def get_compose_url():
# def get_modulemdurl():
#     def __init__(self, *args, **kwargs):
#     def loadconfig(self):
#     def set_url(self, url=None, force=False):
#     def get_url(self):
#     def get_template(self):
#     def get_docker_pull(self):
#     def getArch(self):
#     def runHost(self, command="ls /", **kwargs):
#     def get_test_dependencies(self):
#     def installTestDependencies(self, packages=None):
#     def getPackageList(self, profile=None):
#     def getModuleDependencies(self):
#     def dependency_list(self):
#     def dependency_list(self, value):
#     def getModulemdYamlconfig(self, urllink=None):
#     def getIPaddr(self):
#     def ip_address(self):
#     def ip_address(self, value):
#     def _callSetupFromConfig(self):
#     def _callCleanupFromConfig(self):
#     def run(self, command, **kwargs):
#     def get_packager(self):
#     def status(self, command="/bin/true"):
#     def start(self, command="/bin/true"):
#     def stop(self, command="/bin/true"):
#     def install_packages(self, packages=None):
#     def tearDown(self):
#     def copyTo(self, src, dest):
#     def copyFrom(self, src, dest):
#     def run_script(self, filename, *args, **kwargs):
# def get_config(fail_without_url=True, reload=False):
# def list_modules_from_config():
# def get_backend_list():
# def get_module_type():
# def get_module_type_base():
# def get_docker_file(dir_name=conf["docker"]["dockerfiledefaultlocation"]):
# def get_helpmd_file(dir_name=conf["docker"]["dockerfiledefaultlocation"]):
# def getBasePackageSet(modulesDict=None, isModule=True, isContainer=False):
# def get_base_compose():


# Path: examples/s2i-python-sample/simpleTest.py
from moduleframework import module_framework
from moduleframework import common
import time
import urllib

    :avocado: enable
    """
    ip_address = common.trans_dict["GUESTIPADDR"]
    port = "8080"

    def life_check(self, ip_address=None, port=None, textcheck="Hello from gunicorn WSGI application!"):
        ip_address = ip_address or self.ip_address
        port = port or self.port
        # wait until container initialized (without probe)
        time.sleep(3)
        urlfd = urllib.urlopen("http://%s:%s" % (ip_address, port))
        self.assertIn(textcheck, urlfd.read())
        urlfd.close()

    def test_basic(self):
        self.start()
        self.life_check()

    def test_via_curl(self):
        self.start()
        self.life_check()
        output = self.runHost("curl http://%s:%s" % (self.ip_address, self.port))
        self.assertIn("Hello from gunicorn WSGI application!", output.stdout)

    def test_another_port(self):
        self.backend.info["start"]="docker run -p 9999:8080"
        self.start()
        self.life_check(port="9999")



class UsageTest(module_framework.ContainerAvocadoTest):