Пример #1
0
def test_defaults(options):
    '''
    test of core/plugins/pluginable.py
    '''
    funct = inspect.stack()[0][3]
    print "\n\n[%s]\n" % (funct)
    output = shell("python -u goephor.py -f "
                   "./examples/ex_defaults.yaml -e -E %s" % options.envs).get('stdout')
    if '(PASS)' not in output:
        return {funct: False}
    output = shell("python -u goephor.py -f "
                   "./examples/ex_defaults.yaml -e "
                   "-E 'SWITCH=1'").get('stdout')
    if '(PASS)' not in output:
        return {funct: False}
    return {funct: True}
Пример #2
0
def test_condition(options):
    '''
    test of core/plugins/condition.py
    '''
    funct = inspect.stack()[0][3]
    print "\n\n[%s]\n" % (funct)
    output = shell("python -u goephor.py -f "
                   "./examples/ex_condition.yaml -e -E %s" % options.envs).get('stdout')
    if '(THEN 1)' not in output:
        return {funct: False}
    output = shell("python -u goephor.py -f "
                   "./examples/ex_condition.yaml -e "
                   "-E 'var1=1'").get('stdout')
    if '(IF NEST 1)' not in output:
        return {funct: False}
    return {funct: True}
Пример #3
0
def test_defaults(options):
    '''
    test of core/plugins/pluginable.py
    '''
    funct = inspect.stack()[0][3]
    print "\n\n[%s]\n" % (funct)
    output = shell("python -u goephor.py -f "
                   "./examples/ex_defaults.yaml -e -E %s" %
                   options.envs).get('stdout')
    if '(PASS)' not in output:
        return {funct: False}
    output = shell("python -u goephor.py -f "
                   "./examples/ex_defaults.yaml -e "
                   "-E 'SWITCH=1'").get('stdout')
    if '(PASS)' not in output:
        return {funct: False}
    return {funct: True}
Пример #4
0
def test_condition(options):
    '''
    test of core/plugins/condition.py
    '''
    funct = inspect.stack()[0][3]
    print "\n\n[%s]\n" % (funct)
    output = shell("python -u goephor.py -f "
                   "./examples/ex_condition.yaml -e -E %s" %
                   options.envs).get('stdout')
    if '(THEN 1)' not in output:
        return {funct: False}
    output = shell("python -u goephor.py -f "
                   "./examples/ex_condition.yaml -e "
                   "-E 'var1=1'").get('stdout')
    if '(IF NEST 1)' not in output:
        return {funct: False}
    return {funct: True}
Пример #5
0
def test_http(options):
    '''
    test of core/plugins/http.py
    '''
    funct = inspect.stack()[0][3]
    print "\n[%s]\n" % (funct)
    session = shell("python -u goephor.py -f ./examples/ex_http.yaml -e -E %s" % options.envs)
    if not session.get('code') == 0:
        return {funct: False}
    return {funct: True}
Пример #6
0
def test_scm(options):
    '''
    test of core/plugins/scm.py
    '''
    funct = inspect.stack()[0][3]
    print "\n\n[%s]\n" % (funct)
    session = shell("python -u goephor.py -f ./examples/ex_scm.yaml -e -E %s" %
                    options.envs)
    if not session.get('code') == 0:
        return {funct: False}
    return {funct: True}
Пример #7
0
def test_freebsd(options):
    '''
    test of core/plugins/freebsd.py
    '''
    funct = inspect.stack()[0][3]
    print "\n\n[%s]\n" % (funct)
    if platform.system() == 'FreeBSD':
        session = shell("python -u goephor.py -f ./examples/ex_freebsd.yaml -e -E %s" % options.envs)
        if not session.get('code') == 0:
            return {funct: False}
    return {funct: True}
Пример #8
0
def test_environment(options):
    '''
    test of core/plugins/environment.py
    '''
    funct = inspect.stack()[0][3]
    print "\n\n[%s]\n" % (funct)
    output = shell("python -u goephor.py -f "
                   "./examples/ex_environment.yaml -e -E %s" % options.envs).get('stdout')
    if '(FAIL)' in output:
        return {funct: False}
    return {funct: True}
Пример #9
0
def test_handler(options):
    '''
    test of core/plugins/system.py
    '''
    funct = inspect.stack()[0][3]
    print "\n\n[%s]\n" % (funct)
    sys.stdout.flush()
    session = shell("python -u goephor.py -f ./examples/ex_handler.yaml -e -E %s" % options.envs)
    if session.get('code') > 0:
        return {funct: False}
    return {funct: True}
Пример #10
0
def test_environment(options):
    '''
    test of core/plugins/environment.py
    '''
    funct = inspect.stack()[0][3]
    print "\n\n[%s]\n" % (funct)
    output = shell("python -u goephor.py -f "
                   "./examples/ex_environment.yaml -e -E %s" %
                   options.envs).get('stdout')
    if '(FAIL)' in output:
        return {funct: False}
    return {funct: True}
Пример #11
0
def test_freebsd(options):
    '''
    test of core/plugins/freebsd.py
    '''
    funct = inspect.stack()[0][3]
    print "\n\n[%s]\n" % (funct)
    if platform.system() == 'FreeBSD':
        session = shell(
            "python -u goephor.py -f ./examples/ex_freebsd.yaml -e -E %s" %
            options.envs)
        if not session.get('code') == 0:
            return {funct: False}
    return {funct: True}
Пример #12
0
def test_handler(options):
    '''
    test of core/plugins/system.py
    '''
    funct = inspect.stack()[0][3]
    print "\n\n[%s]\n" % (funct)
    sys.stdout.flush()
    session = shell(
        "python -u goephor.py -f ./examples/ex_handler.yaml -e -E %s" %
        options.envs)
    if session.get('code') > 0:
        return {funct: False}
    return {funct: True}