Skip to content

Commit

Permalink
fix(broker/grpc): transport_protocol with grpc must be case insensiti…
Browse files Browse the repository at this point in the history
…ve (#354)

REFS: MON-14165
  • Loading branch information
bouda1 authored Sep 6, 2022
1 parent dd71f03 commit 9625276
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion broker/core/src/compression/factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ bool factory::has_endpoint(config::endpoint& cfg, io::extension* ext) {
if (cfg.type == "bbdo_server" || cfg.type == "bbdo_client") {
auto it = cfg.params.find("transport_protocol");
if (it != cfg.params.end()) {
if (cfg.params["transport_protocol"] == "grpc") {
if (absl::EqualsIgnoreCase(cfg.params["transport_protocol"], "grpc")) {
*ext = io::extension("COMPRESSION", false, false);
return false;
}
Expand Down
4 changes: 3 additions & 1 deletion broker/grpc/src/factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

#include "com/centreon/broker/grpc/factory.hh"

#include <absl/strings/match.h>

#include "com/centreon/broker/config/parser.hh"
#include "com/centreon/broker/grpc/acceptor.hh"
#include "com/centreon/broker/grpc/connector.hh"
Expand Down Expand Up @@ -50,7 +52,7 @@ bool factory::has_endpoint(com::centreon::broker::config::endpoint& cfg,
/* New case: we create a bbdo_server or a bbdo_client with transport protocol
* set to 'grpc' */
if ((cfg.type == "bbdo_server" || cfg.type == "bbdo_client") &&
cfg.params["transport_protocol"] == "grpc")
absl::EqualsIgnoreCase(cfg.params["transport_protocol"], "grpc"))
return true;

return false;
Expand Down
2 changes: 1 addition & 1 deletion broker/tls/src/factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ bool factory::has_endpoint(config::endpoint& cfg, io::extension* ext) {
if (cfg.type == "bbdo_client" || cfg.type == "bbdo_server") {
it = cfg.params.find("transport_protocol");
if (it != cfg.params.end()) {
if (cfg.params["transport_protocol"] == "grpc") {
if (absl::EqualsIgnoreCase(cfg.params["transport_protocol"], "grpc")) {
*ext = io::extension("TLS", false, false);
return false;
}
Expand Down
24 changes: 12 additions & 12 deletions tests/broker/bbdo-server-client.robot
Original file line number Diff line number Diff line change
Expand Up @@ -63,34 +63,34 @@ BSCSSG1
[Tags] Broker start-stop bbdo_server bbdo_client grpc
Config Broker central
Config Broker rrd
Config Broker BBDO Input central bbdo_server 5669 grpc localhost
Config Broker BBDO Output central bbdo_client 5670 grpc localhost
Config Broker BBDO Input rrd bbdo_server 5670 grpc
Config Broker BBDO Input central bbdo_server 5669 gRPC localhost
Config Broker BBDO Output central bbdo_client 5670 gRPC localhost
Config Broker BBDO Input rrd bbdo_server 5670 gRPC
Broker Config Log central config info
Repeat Keyword 5 times Start Stop Service 0

BSCSSG2
[Documentation] Start/Stop 10 times broker with 300ms interval and no coredump
[Tags] Broker start-stop bbdo_server bbdo_client grpc
Config Broker central
Config Broker BBDO Input central bbdo_server 5669 grpc localhost
Config Broker BBDO Output central bbdo_client 5670 grpc localhost
Config Broker BBDO Input central bbdo_server 5669 gRPC localhost
Config Broker BBDO Output central bbdo_client 5670 gRPC localhost
Repeat Keyword 10 times Start Stop Instance 300ms

BSCSSG3
[Documentation] Start-Stop one instance of broker and no coredump
[Tags] Broker start-stop bbdo_server bbdo_client grpc
Config Broker central
Config Broker BBDO Input central bbdo_server 5669 grpc
Config Broker BBDO Output central bbdo_client 5670 grpc localhost
Config Broker BBDO Input central bbdo_server 5669 gRPC
Config Broker BBDO Output central bbdo_client 5670 gRPC localhost
Repeat Keyword 5 times Start Stop Instance 0

BSCSSG4
[Documentation] Start/Stop 10 times broker with 1sec interval and no coredump
[Tags] Broker start-stop bbdo_server bbdo_client grpc
Config Broker central
Config Broker BBDO Input central bbdo_server 5669 grpc
Config Broker BBDO Output central bbdo_client 5670 grpc localhost
Config Broker BBDO Input central bbdo_server 5669 gRPC
Config Broker BBDO Output central bbdo_client 5670 gRPC localhost
Repeat Keyword 10 times Start Stop Instance 1s

BSCSST1
Expand Down Expand Up @@ -141,9 +141,9 @@ BSCSSTG1
[Tags] Broker start-stop bbdo_server bbdo_client grpc tls
Config Broker central
Config Broker rrd
Config Broker BBDO Input central bbdo_server 5669 grpc
Config Broker BBDO Output central bbdo_client 5670 grpc localhost
Config Broker BBDO Input rrd bbdo_server 5670 grpc
Config Broker BBDO Input central bbdo_server 5669 gRPC
Config Broker BBDO Output central bbdo_client 5670 gRPC localhost
Config Broker BBDO Input rrd bbdo_server 5670 gRPC
Broker Config Output set central central-broker-master-output encryption yes
Broker Config Input set rrd rrd-broker-master-input encryption yes
Broker Config Log central config off
Expand Down

0 comments on commit 9625276

Please sign in to comment.