smartcat-labs / berserker

Berserker is load generator with pluggable input source and configurable output.
Apache License 2.0
52 stars 8 forks source link

CSV data source support through configuration file #42

Closed vajda closed 6 years ago

vajda commented 6 years ago

Currently, CSV data source is supported only through Java code. However, that solution is not good enough since CSV data source cannot be used within configuration file. This is a proposal how CSV data source configuration can be used:

data-source-configuration:
  parser:
    file: # mandatory
    delimiter: # optional, defaults to ','
    record-separator: # optional, defaults to '\n'
    trim: # optional, defaults to true
    quote: # optional, defaults to null, usually is " or ', but can be any character
    comment-marker: # optional, defaults to '#' and is interpreted at the beginning of line where that line is ignored
    skip-header-record: # optional, defaults to false, can skip first row
    ignore-empty-lines: # optional, defaults to true
    null-string: # optional, set char sequence which will be mapped to String null, defaults to not set
  mapping:
    user:
      firstName: $c0
      lastName: $c1
      age: $c2
  output: $user

parser section would contain parameters relevant for parsin the CSV file output section would contain final output value of this data source, similar to output in Ranger data source mapping section would contain custom structure definition where values that can be referenced are columns of CSV. $c0 represents first column, $c1 represents second column and so on...

Additional: mapping section might contain Ranger constructs which will provide rich value creation with combination of Ranger's random values and values taken from CSV file.