import yaml

def getConfig(path):

    with open(path) as ymlfile:
        cfg = yaml.load(ymlfile, Loader=yaml.FullLoader)

    configuration = {}

    for i in cfg['tests']:
        configuration[i] = cfg['tests'][str(i)]

    for i in configuration.keys():
        if not configuration[i].__contains__('threads'):
            configuration[i]['threads'] = cfg['default']['threads']
        if not configuration[i].__contains__('duration'):
            configuration[i]['duration'] = cfg['default']['duration']

    return configuration, cfg['jmeterpath']