Skip to content

Commit

Permalink
Use client buggify options on the client
Browse files Browse the repository at this point in the history
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
```
  • Loading branch information
nickva committed Mar 5, 2021
1 parent 9ebcc09 commit 341b081
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions c_src/atom_names.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
16 changes: 8 additions & 8 deletions c_src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
8 changes: 4 additions & 4 deletions src/erlfdb_nif.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down

0 comments on commit 341b081

Please sign in to comment.