Commit 4cc43a96 authored by vattezhang's avatar vattezhang
Browse files

benchmark: add auth check in benchmark

    When we run benchmark but forget to set the right requirepass, benchmark should return error.
parent e6948b8f
...@@ -204,6 +204,12 @@ static void readHandler(aeEventLoop *el, int fd, void *privdata, int mask) { ...@@ -204,6 +204,12 @@ static void readHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
if (redisBufferRead(c->context) != REDIS_OK) { if (redisBufferRead(c->context) != REDIS_OK) {
fprintf(stderr,"Error: %s\n",c->context->errstr); fprintf(stderr,"Error: %s\n",c->context->errstr);
exit(1); exit(1);
}
else if (strlen(c->context->reader->buf)>=32
&& !strncmp(c->context->reader->buf,"-NOAUTH Authentication required.", 32))
{
fprintf(stderr,"Error: %s\n",c->context->reader->buf);
exit(1);
} else { } else {
while(c->pending) { while(c->pending) {
if (redisGetReply(c->context,&reply) != REDIS_OK) { if (redisGetReply(c->context,&reply) != REDIS_OK) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment