From 22e848f88e2cb9510e82fb4875c182240fff3303 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Fri, 29 Mar 2019 08:30:49 +0530 Subject: protocol: add an option to force using old-protocol As protocol implements every fop, and in general a large part of the codebase. Considering our regression is run mostly in 1 machine, there was no way of forcing the client to use old protocol (while new one is available). With this patch, a new 'testing' option is provided which forces client to use old protocol if found. This should help increase the code coverage by at least 10k lines overall. updates: bz#1693692 Change-Id: Ie45256f7dea250671b689c72b4b6f25037cef948 Signed-off-by: Amar Tumballi --- xlators/protocol/client/src/client.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'xlators/protocol/client/src/client.c') diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c index 1e9f47297ee..fffe22380b1 100644 --- a/xlators/protocol/client/src/client.c +++ b/xlators/protocol/client/src/client.c @@ -2508,6 +2508,8 @@ build_client_config(xlator_t *this, clnt_conf_t *conf) GF_OPTION_INIT("send-gids", conf->send_gids, bool, out); + GF_OPTION_INIT("testing.old-protocol", conf->old_protocol, bool, out); + conf->client_id = glusterfs_leaf_position(this); ret = client_check_remote_host(this, this->options); @@ -3048,6 +3050,16 @@ struct volume_options options[] = { " power. Range 1-32 threads.", .op_version = {GD_OP_VERSION_3_7_0}, .flags = OPT_FLAG_SETTABLE | OPT_FLAG_DOC}, + + /* This option is required for running code-coverage tests with + old protocol */ + { + .key = {"testing.old-protocol"}, + .type = GF_OPTION_TYPE_BOOL, + .default_value = "off", + .op_version = {GD_OP_VERSION_7_0}, + .flags = OPT_FLAG_SETTABLE, + }, {.key = {NULL}}, }; -- cgit