chaos-mesh / chaosd

A Chaos Engineering toolkit.
Apache License 2.0
136 stars 63 forks source link

support HTTP Attack on chaosd #165

Closed Andrewmatilde closed 2 years ago

Andrewmatilde commented 2 years ago

Signed-off-by: andrewmatilde davis6813585853062@outlook.com Please install chaos-tproxy before use the HTTP attack. usage:

./bin/chaosd attack http abort -h
abort selected HTTP Package

Usage:
  chaosd attack http abort [flags]

Flags:
  -c, --code int32          Code is a rule to select target by http status code in response.
  -h, --help                help for abort
  -m, --method string       HTTP method
      --path string         Mathc path of Uri with wildcard matches.
      --port int32          port is a rule to select server listening on specific port.
  -p, --proxy_ports uints   composed with one of the port of HTTP connection, we will only attack HTTP connection with port inside proxy_ports (default [])
  -t, --target string       HTTP target: Request or Response

Global Flags:
      --log-level string   the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'
      --uid string         the experiment ID
./bin/chaosd attack http delay -h
delay selected HTTP Package

Usage:
  chaosd attack http delay [flags]

Flags:
  -c, --code int32          Code is a rule to select target by http status code in response.
  -d, --delay time string   Delay represents the delay of the target request/response.
  -h, --help                help for delay
  -m, --method string       HTTP method
      --path string         Mathc path of Uri with wildcard matches.
      --port int32          port is a rule to select server listening on specific port.
  -p, --proxy_ports uints   composed with one of the port of HTTP connection, we will only attack HTTP connection with port inside proxy_ports (default [])
  -t, --target string       HTTP target: Request or Response

Global Flags:
      --log-level string   the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'
      --uid string         the experiment ID
./bin/chaosd attack http file -h
attack with config file

Usage:
  chaosd attack http file [flags]

Flags:
  -p, --file path string   Config file path.
  -h, --help               help for file

Global Flags:
      --log-level string   the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'
      --uid string         the experiment ID
ti-chi-bot commented 2 years ago

[REVIEW NOTIFICATION]

This pull request has been approved by:

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment. After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review. Reviewer can cancel approval by submitting a request changes review.
Andrewmatilde commented 2 years ago

PTAL @WangXiangUSTC

WangXiangUSTC commented 2 years ago

@Hexilee PTAL

ti-chi-bot commented 2 years ago

@Hexilee: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.

In response to [this](https://github.com/chaos-mesh/chaosd/pull/165#pullrequestreview-996275819): >LGTM Instructions for interacting with me using PR comments are available [here](https://prow.tidb.io/command-help). If you have questions or suggestions related to my behavior, please file an issue against the [ti-community-infra/tichi](https://github.com/ti-community-infra/tichi/issues/new?title=Prow%20issue:) repository.