Skip to content

Commit

Permalink
kafka io attack: add username and password flags (#231)
Browse files Browse the repository at this point in the history
* add username and password flags

Signed-off-by: cwen0 <cwenyin0@gmail.com>

* fix ci

Signed-off-by: cwen0 <cwenyin0@gmail.com>

---------

Signed-off-by: cwen0 <cwenyin0@gmail.com>
  • Loading branch information
cwen0 authored Jan 29, 2023
1 parent a9c0540 commit 31631c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
elif [[ "$job" == "unit-test" ]]; then
make unit-test
elif [[ "$job" == "integration-test" ]]; then
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y stress-ng
make integration-test
Expand Down
4 changes: 4 additions & 0 deletions cmd/attack/kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ func NewKafkaIOCommand(dep fx.Option, options *core.KafkaCommand) *cobra.Command
},
}

cmd.Flags().StringVarP(&options.Host, "host", "H", "localhost", "the host of kafka server")
cmd.Flags().Uint16VarP(&options.Port, "port", "P", 9092, "the port of kafka server")
cmd.Flags().StringVarP(&options.Username, "username", "u", "", "the username of kafka client")
cmd.Flags().StringVarP(&options.Password, "password", "p", "", "the password of kafka client")
cmd.Flags().StringVarP(&options.ConfigFile, "config", "c", "/etc/kafka/server.properties", "the path of server config")
cmd.Flags().BoolVarP(&options.NonReadable, "non-readable", "r", false, "make kafka cluster non-readable")
cmd.Flags().BoolVarP(&options.NonWritable, "non-writable", "w", false, "make kafka cluster non-writable")
Expand Down

0 comments on commit 31631c3

Please sign in to comment.