Skip to content

Commit

Permalink
Merge branch 'master' into fix-data-import
Browse files Browse the repository at this point in the history
  • Loading branch information
filipecosta90 authored Dec 2, 2023
2 parents 567348c + a5e6f19 commit 151c1ae
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ jobs:
if: matrix.platform == 'ubuntu-latest'
timeout-minutes: 10
run: |
TLS_PROTOCOLS="tlsv1.2" TLS=1 ./tests/run_tests.sh
TLS_PROTOCOLS='TLSv1.2' VERBOSE=1 TLS=1 ./tests/run_tests.sh
- name: Test OSS TCP TLS v1.3
if: matrix.platform == 'ubuntu-latest'
timeout-minutes: 10
run: |
TLS_PROTOCOLS="tlsv1.3" TLS=1 ./tests/run_tests.sh
TLS_PROTOCOLS='TLSv1.3' VERBOSE=1 TLS=1 ./tests/run_tests.sh
- name: Test OSS-CLUSTER TCP
timeout-minutes: 10
Expand Down
13 changes: 7 additions & 6 deletions memtier_benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@

#endif

#include <cstring>
#include <stdexcept>

#include "client.h"
Expand Down Expand Up @@ -896,9 +897,9 @@ static int config_parse_args(int argc, char *argv[], struct benchmark_config *cf
break;
case o_tls_protocols:
{
const char tls_delimiter = ',';
char* tls_token = strtok(optarg, &tls_delimiter);
while (tls_token != 0) {
const char* tls_delimiter = ",";
char* tls_token = std::strtok(optarg, tls_delimiter);
while (tls_token != NULL) {
if (!strcasecmp(tls_token, "tlsv1"))
cfg->tls_protocols |= REDIS_TLS_PROTO_TLSv1;
else if (!strcasecmp(tls_token, "tlsv1.1"))
Expand All @@ -913,12 +914,12 @@ static int config_parse_args(int argc, char *argv[], struct benchmark_config *cf
return -1;
#endif
} else {
fprintf(stderr, "Invalid tls-protocols specified. "
"Use a combination of 'TLSv1', 'TLSv1.1', 'TLSv1.2' and 'TLSv1.3'.");
fprintf(stderr, "Invalid tls-protocols specified %s. "
"Use a combination of 'TLSv1', 'TLSv1.1', 'TLSv1.2' and 'TLSv1.3'.", tls_token);
return -1;
break;
}
tls_token = strtok(0, &tls_delimiter);
tls_token = std::strtok(NULL, tls_delimiter);
}
break;
}
Expand Down
1 change: 0 additions & 1 deletion tests/include.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def assert_minimum_memtier_outcomes(config, env, memtier_ok, overall_expected_re

def add_required_env_arguments(benchmark_specs, config, env, master_nodes_list):
if VERBOSE:
import logging
logging.basicConfig(level=logging.DEBUG)

# if we've specified TLS_PROTOCOLS ensure we configure it on redis
Expand Down
23 changes: 17 additions & 6 deletions tests/tests_oss_simple_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,10 @@ def test_default_set_get_3_runs(env):


def test_default_arbitrary_command_pubsub(env):
benchmark_specs = {"name": env.testName, "args": ['--command=publish \"__key__\" \"__data__\"']}
benchmark_specs = {"name": env.testName, "args": []}
addTLSArgs(benchmark_specs, env)
# on arbitrary command args should be the last one
benchmark_specs["args"].append('--command=publish \"__key__\" \"__data__\"')
config = get_default_memtier_config()
master_nodes_list = env.getMasterNodesList()

Expand All @@ -282,8 +284,10 @@ def test_default_arbitrary_command_pubsub(env):


def test_default_arbitrary_command_keyless(env):
benchmark_specs = {"name": env.testName, "args": ['--command=PING']}
benchmark_specs = {"name": env.testName, "args": []}
addTLSArgs(benchmark_specs, env)
# on arbitrary command args should be the last one
benchmark_specs["args"].append('--command=PING')
config = get_default_memtier_config()
master_nodes_list = env.getMasterNodesList()

Expand All @@ -302,8 +306,10 @@ def test_default_arbitrary_command_keyless(env):


def test_default_arbitrary_command_set(env):
benchmark_specs = {"name": env.testName, "args": ['--command=SET __key__ __data__']}
benchmark_specs = {"name": env.testName, "args": []}
addTLSArgs(benchmark_specs, env)
# on arbitrary command args should be the last one
benchmark_specs["args"].append('--command=SET __key__ __data__')
config = get_default_memtier_config()
master_nodes_list = env.getMasterNodesList()
overall_expected_request_count = get_expected_request_count(config)
Expand All @@ -328,8 +334,10 @@ def test_default_arbitrary_command_set(env):


def test_default_arbitrary_command_hset(env):
benchmark_specs = {"name": env.testName, "args": ['--command=HSET __key__ field1 __data__']}
benchmark_specs = {"name": env.testName, "args": []}
addTLSArgs(benchmark_specs, env)
# on arbitrary command args should be the last one
benchmark_specs["args"].append('--command=HSET __key__ field1 __data__')
config = get_default_memtier_config()
master_nodes_list = env.getMasterNodesList()
overall_expected_request_count = get_expected_request_count(config)
Expand All @@ -354,9 +362,11 @@ def test_default_arbitrary_command_hset(env):


def test_default_arbitrary_command_hset_multi_data_placeholders(env):
benchmark_specs = {"name": env.testName, "args": ['--command=HSET __key__ field1 __data__ field2 __data__ field3 __data__']}
benchmark_specs = {"name": env.testName, "args": []}
addTLSArgs(benchmark_specs, env)
memtier_config = get_default_memtier_config()
# on arbitrary command args should be the last one
benchmark_specs["args"].append('--command=HSET __key__ field1 __data__ field2 __data__ field3 __data__')
config = get_default_memtier_config()
master_nodes_list = env.getMasterNodesList()
overall_expected_request_count = get_expected_request_count(memtier_config)

Expand All @@ -381,6 +391,7 @@ def test_default_arbitrary_command_hset_multi_data_placeholders(env):
overall_request_count)

def test_default_set_get_rate_limited(env):
env.skipOnCluster()
master_nodes_list = env.getMasterNodesList()
for client_count in [1,2,4]:
for thread_count in [1,2]:
Expand Down

0 comments on commit 151c1ae

Please sign in to comment.