Skip to content

Commit 31631c3

Browse files
authored
kafka io attack: add username and password flags (#231)
* add username and password flags Signed-off-by: cwen0 <[email protected]> * fix ci Signed-off-by: cwen0 <[email protected]> --------- Signed-off-by: cwen0 <[email protected]>
1 parent a9c0540 commit 31631c3

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
elif [[ "$job" == "unit-test" ]]; then
5151
make unit-test
5252
elif [[ "$job" == "integration-test" ]]; then
53+
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
5354
sudo apt-get update
5455
sudo apt-get install -y stress-ng
5556
make integration-test

cmd/attack/kafka.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ func NewKafkaIOCommand(dep fx.Option, options *core.KafkaCommand) *cobra.Command
103103
},
104104
}
105105

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

0 commit comments

Comments
 (0)