From 341b08137c9546bebeb8b05c82cdafa8ebbebb38 Mon Sep 17 00:00:00 2001 From: Nick Vatamaniuc Date: Thu, 4 Mar 2021 18:06:16 -0500 Subject: [PATCH] Use client buggify options on the client Previously we used plain buggify options which are meant for the server. Switch them to the client versions. Can check if it works with: ``` ERL_ZFLAGS="-erlfdb network_options '[client_buggify_enable, {client_buggify_section_activated_probability, 60}, {client_buggify_section_fired_probability, 60}]'" make elixir tests=test/elixir/test/basics_test.exs ``` --- c_src/atom_names.h | 8 ++++---- c_src/main.c | 16 ++++++++-------- src/erlfdb_nif.erl | 8 ++++---- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/c_src/atom_names.h b/c_src/atom_names.h index 98b5c4f..97abbf9 100644 --- a/c_src/atom_names.h +++ b/c_src/atom_names.h @@ -50,10 +50,10 @@ ATOM_MAP(tls_cert_path); ATOM_MAP(tls_key_bytes); ATOM_MAP(tls_key_path); ATOM_MAP(tls_verify_peers); -ATOM_MAP(buggify_enable); -ATOM_MAP(buggify_disable); -ATOM_MAP(buggify_section_activated_probability); -ATOM_MAP(buggify_section_fired_probability); +ATOM_MAP(client_buggify_enable); +ATOM_MAP(client_buggify_disable); +ATOM_MAP(client_buggify_section_activated_probability); +ATOM_MAP(client_buggify_section_fired_probability); ATOM_MAP(tls_ca_bytes); ATOM_MAP(tls_ca_path); ATOM_MAP(tls_password); diff --git a/c_src/main.c b/c_src/main.c index 4f669f5..807b7ae 100644 --- a/c_src/main.c +++ b/c_src/main.c @@ -478,14 +478,14 @@ erlfdb_network_set_option(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) option = FDB_NET_OPTION_TLS_KEY_PATH; } else if(IS_ATOM(argv[0], tls_verify_peers)) { option = FDB_NET_OPTION_TLS_VERIFY_PEERS; - } else if(IS_ATOM(argv[0], buggify_enable)) { - option = FDB_NET_OPTION_BUGGIFY_ENABLE; - } else if(IS_ATOM(argv[0], buggify_disable)) { - option = FDB_NET_OPTION_BUGGIFY_DISABLE; - } else if(IS_ATOM(argv[0], buggify_section_activated_probability)) { - option = FDB_NET_OPTION_BUGGIFY_SECTION_ACTIVATED_PROBABILITY; - } else if(IS_ATOM(argv[0], buggify_section_fired_probability)) { - option = FDB_NET_OPTION_BUGGIFY_SECTION_FIRED_PROBABILITY; + } else if(IS_ATOM(argv[0], client_buggify_enable)) { + option = FDB_NET_OPTION_CLIENT_BUGGIFY_ENABLE; + } else if(IS_ATOM(argv[0], client_buggify_disable)) { + option = FDB_NET_OPTION_CLIENT_BUGGIFY_DISABLE; + } else if(IS_ATOM(argv[0], client_buggify_section_activated_probability)) { + option = FDB_NET_OPTION_CLIENT_BUGGIFY_SECTION_ACTIVATED_PROBABILITY; + } else if(IS_ATOM(argv[0], client_buggify_section_fired_probability)) { + option = FDB_NET_OPTION_CLIENT_BUGGIFY_SECTION_FIRED_PROBABILITY; } else if(IS_ATOM(argv[0], tls_ca_bytes)) { option = FDB_NET_OPTION_TLS_CA_BYTES; } else if(IS_ATOM(argv[0], tls_password)) { diff --git a/src/erlfdb_nif.erl b/src/erlfdb_nif.erl index ddb7d0f..9e25520 100644 --- a/src/erlfdb_nif.erl +++ b/src/erlfdb_nif.erl @@ -99,10 +99,10 @@ tls_key_bytes | tls_key_path | tls_verify_peers | - buggify_enable | - buggify_disable | - buggify_section_activated_probability | - buggify_section_fired_probability | + client_buggify_enable | + client_buggify_disable | + client_buggify_section_activated_probability | + client_buggify_section_fired_probability | tls_ca_bytes | tls_ca_path | tls_password |