Beispiel #1
0
def initial_conf(file_name, sudo_run, drop_all_databases):
    """
    define initial config simulate background in lettuce
    :param file_name:
    :param sudo_run:
    :param drop_all_databases:
    """
    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'])
    # The next line is commented because at the moment the rpm package does not exists. STH is executed manually
    #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 drop_all_databases:
        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'])
Beispiel #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'])
Beispiel #3
0
def copy_properties_file_from_and_sudo(step, file_name, sudo_run):
    """
    copy properties.json specific to feature from setting folder, read properties and create necessaries class
    :param step:
    :param file_name: file name of configuration associated at features, stored in settings folder
    :param sudo_run:  with superuser privileges (True | False)
    """
    if not world.background_executed:
        properties = Properties(file=file_name, sudo=sudo_run)
        properties.read_properties()
        properties.storing_dictionaries()
Beispiel #4
0
def copy_properties_file_from_and_sudo(step, file_name, sudo_run):
    """
    copy properties.json specific to feature from setting folder, read properties and create necessaries class
    :param step:
    :param file_name: file name of configuration associated at features, stored in settings folder
    :param sudo_run:  with superuser privileges (True | False)
    """
    if not world.background_executed:
        properties = Properties (file=file_name, sudo=sudo_run)
        properties.read_properties()
        properties.storing_dictionaries()
def copy_properties_json_file_to_test_from_setting_and_sudo_local (step, file_name, sink, sudo_run):
    """
    copy properties.json specific to feature from setting folder, read properties and create necessaries class
    :param step:
    :param file_name: file name of configuration associated at features, stored in settings folder
    :param sink: sink used in each feature (ckan-sink |mysql-sink | hdfs-sink)
    :param sudo_run:  with superuser privileges (True | False)
    """
    if not world.background_executed:
        world.sink = sink
        properties = Properties (file=file_name, sudo=sudo_run)
        properties.read_properties()
        properties.storing_dictionaries(sink)
def copy_properties_json_file_to_test_from_setting_and_sudo_local (step, file_name, sink, sudo_run):
    """
    copy properties.json specific to feature from setting folder, read properties and create necessaries class
    :param step:
    :param file_name: file name of configuration associated at features, stored in settings folder
    :param sink: sink used in each feature (ckan-sink |mysql-sink | hdfs-sink)
    :param sudo_run:  with superuser privileges (True | False)
    """
    if not world.background_executed:
        world.sink = sink
        properties = Properties (file=file_name, sudo=sudo_run)
        properties.read_properties()
        properties.storing_dictionaries(sink)
Beispiel #7
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'])