示例#1
0
def initial_conf(file_name, sudo_run):
    """
    define initial config simulate background in lettuce
    :param file_name:
    :param sudo_run:
    """
    print colored("  Background: in terrain...",
                  'white',
                  'on_grey',
                  attrs=['bold'])
    print colored("    Given starting the configuration from terrain...",
                  'green',
                  'on_grey',
                  attrs=['bold'])
    properties = Properties(file=file_name, sudo=sudo_run)
    print colored("    And updating properties.json from %s" % file_name,
                  'green',
                  'on_grey',
                  attrs=['bold'])
    properties.read_properties()
    print colored("    And reading properties",
                  'green',
                  'on_grey',
                  attrs=['bold'])
    properties.storing_dictionaries()
    print colored(
        "    And creating instances to sth and mongo with properties",
        'green',
        'on_grey',
        attrs=['bold'])
    world.sth.sth_service("restart")
    print colored("    And restarting sth service",
                  'green',
                  'on_grey',
                  attrs=['bold'])
    world.sth.verify_sth_version()
    print colored("    And verifying sth version",
                  'green',
                  'on_grey',
                  attrs=['bold'])
    world.sth.verify_mongo_version()
    print colored("    And verifying mongo version",
                  'green',
                  'on_grey',
                  attrs=['bold'])
    if properties.get_drop_all_databases().lower().find("true") >= 0:
        world.sth.drop_all_test_databases()
        print colored("    And drop all tests databases with prefix: sth_test",
                      'green',
                      'on_grey',
                      attrs=['bold'])
    print colored("    Then completed the configuration from terrain...",
                  'green',
                  'on_grey',
                  attrs=['bold'])
示例#2
0
def initial_conf(file_name, sudo_run):
    """
    define initial config simulate background in lettuce
    :param file_name:
    :param sudo_run:
    """
    print colored("  Background: in terrain...", 'white', 'on_grey', attrs=['bold'])
    print colored("    Given starting the configuration from terrain...", 'green', 'on_grey', attrs=['bold'])
    properties = Properties (file=file_name, sudo=sudo_run)
    print colored("    And updating properties.json from %s" % file_name, 'green', 'on_grey', attrs=['bold'])
    properties.read_properties()
    print colored("    And reading properties", 'green', 'on_grey', attrs=['bold'])
    properties.storing_dictionaries()
    print colored("    And creating instances to sth and mongo with properties", 'green', 'on_grey', attrs=['bold'])
    world.sth.sth_service("restart")
    print colored("    And restarting sth service", 'green', 'on_grey', attrs=['bold'])
    world.sth.verify_sth_version()
    print colored("    And verifying sth version", 'green', 'on_grey', attrs=['bold'])
    world.sth.verify_mongo_version()
    print colored("    And verifying mongo version", 'green', 'on_grey', attrs=['bold'])
    if properties.get_drop_all_databases().lower().find("true") >=0:
        world.sth.drop_all_test_databases()
        print colored("    And drop all tests databases with prefix: sth_test", 'green', 'on_grey', attrs=['bold'])
    print colored("    Then completed the configuration from terrain...", 'green', 'on_grey', attrs=['bold'])