### Parse config ### using FakeSecHead class for creating fake section [default] in config-file configuration_file = ConfigParser.SafeConfigParser(default) configuration_file.optionxform = str configuration_file.readfp(stepper.FakeSecHead(open(options.config))) ### Tank type: 1 - HTTP requests, 2 - RAW requests (no ammo count and progress bar) tank_type = configuration_file.getint('DEFAULT', 'tank_type') ### MultiValues parametres # load - list of elements (step, line, const) for load scheme # uri - list of uri for requests load_multi = stepper.get_config_multiple(options.config) (load_steps, load_scheme, load_count) = stepper.make_steps(options.config) # handle instances schedule try: instances_schedule_count = 0 instances_schedule = [] instances_chunk_cnt = 0 instances = configuration_file.get('DEFAULT', 'instances_schedule') sched_parts=instances.split(" ") for sched_part in sched_parts: [expanded_sched, skip, skip, max_val]=stepper.expand_load_spec(sched_part) instances_schedule += expanded_sched if max_val > instances_schedule_count: instances_schedule_count = max_val instances_schedule = stepper.collapse_schedule(instances_schedule) except ConfigParser.NoOptionError:
rgx_self = re.compile('^selfload=(.+)%$') rgx_req = re.compile('^reqps=(-?\d+)') rgx_case = re.compile('^case=(.*)$') rgx_resp = re.compile('^answ_time=(\d+)-(\d+):(\d+)') rgx_http = re.compile('^HTTPcode=(\d+):(\d+)') rgx_netw = re.compile('^netwcode=(\d+):(\d+)') rgx_answ = re.compile('^(input|output|tasks|interval_real_expect)=(\d+)') rgx_prcn = re.compile('^(.+?)_q(\d+)=(\d+)') rgx_expect = re.compile('^(connect_time|latency|receive_time|send_time)_expect=(\d+)') rgx_disp = re.compile('^(.+?_dispersion)=(\d+)') test_duration = 0 # config parse logging.info('Parse config, prepare scheme') (steps, loadscheme, load_ammo) = stepper.make_steps(options.config) for c in steps: test_duration += c[1] load = ConfigParser.RawConfigParser() load.optionxform = str load.readfp(stepper.FakeSecHead(open("lp.conf"))) # cases list now_case = defaultdict(int) now_case['http'] = defaultdict(int) now_case['net'] = defaultdict(int) now_case['answ'] = defaultdict(int) for el in re.findall("'.+?'", load.get('DEFAULT', 'cases')): case = el[1:-1]