Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[System test runner] Support for multiple tests per data stream #208

Closed
andrewkroh opened this issue Dec 18, 2020 · 4 comments
Closed

[System test runner] Support for multiple tests per data stream #208

andrewkroh opened this issue Dec 18, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@andrewkroh
Copy link
Member

Data streams can have multiple input options such as logfile, syslog over UDP, and syslog over TCP. In order to have test coverage over all of the supported input configurations we need a way to execute more than one system test per data stream.

Current a single test is declared in data_stream/<name>/_dev/test/system/config.yml. If we can expand this to allow more than one test definition then we'll be able to expand test coverage.

@ruflin
Copy link
Contributor

ruflin commented Dec 21, 2020

@andrewkroh Does each of these have a separate stream template?

@andrewkroh
Copy link
Member Author

Yes, as an example this package has a template for the UDP input and a logfile input. https://github.com/elastic/integrations/tree/0d55adaa4ea33e94b05f5c5106cc22c845b720ae/packages/checkpoint/data_stream/firewall/agent/stream

@ruflin
Copy link
Contributor

ruflin commented Dec 22, 2020

👍 Each template should allow its own test. I'm wondering if we should go so far to allow each template multiple tests?

adriansr added a commit that referenced this issue Jan 12, 2021
Updates the system tests runner so that multiple test-*-config.yml files
can be included in <data_stream>/_dev/tests/system. This allows testing
multiple inputs and/or different configuration options per data stream.

Example test for two inputs:

test-tcp-input.yml:

  input: tcp
  service: bluecoat-director-tcp
  vars: ~
  data_stream:
    vars:
      tcp_host: 0.0.0.0
      tcp_port: 9514

test-udp-input.yml:

  input: udp
  service: bluecoat-director-udp
  vars: ~
  data_stream:
    vars:
      udp_host: 0.0.0.0
      udp_port: 9514

The service tags allows to uses different containers for the tests.
In this case, to generate traffic using different protocols.

Sample docker-compose.yml in <package>/_dev/deploy/docker:

version: '2.3'
services:
  bluecoat-director-tcp:
    tty: true
    build: .
    volumes:
      - ./logs:/logs/:ro
    command: /stream -proto tcp -dest elastic-agent:9514 /logs/generated.log
  bluecoat-director-udp:
    tty: true
    build: .
    volumes:
      - ./logs:/logs/:ro
    command: /stream -proto udp -delay 100ms -dest elastic-agent:9514 /logs/generated.log 

Relates #208
@andrewkroh
Copy link
Member Author

Implemented in #209.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants