From f2446afa817c3d9edb64b96746eaa4ebf2369ff9 Mon Sep 17 00:00:00 2001 From: sandhi Date: Tue, 11 Jul 2023 12:09:04 +0530 Subject: [PATCH] Changes for changing the resolution message Signed-off-by: sandhi --- .../verifyserver/constants/portreachable.go | 2 +- .../firewallchecktrigger_test.go | 22 +++++++++---------- .../firewallservice/firewallservice.go | 2 +- .../firewallservice/firewallservice_test.go | 2 +- .../services/fqdnservice/fqdnservice.go | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/components/automate-cli/pkg/verifyserver/constants/portreachable.go b/components/automate-cli/pkg/verifyserver/constants/portreachable.go index ae1536780dd7..82b2b4c84419 100644 --- a/components/automate-cli/pkg/verifyserver/constants/portreachable.go +++ b/components/automate-cli/pkg/verifyserver/constants/portreachable.go @@ -5,5 +5,5 @@ const ( PORT_REACHABLE_SUCCESS_MSG = "The %s service running at %s:%d is reachable" PORT_REACHABLE_ERROR_MSG = "The %s service running at %s:%d is not reachable" - PORT_REACHABLE_RESOLUTION_MSG = "Check your firewall settings to provide access to %d port on %s" + PORT_REACHABLE_RESOLUTION_MSG = "Check your firewall settings and provide access to port %d on %s" ) diff --git a/components/automate-cli/pkg/verifyserver/services/batchcheckservice/trigger/firewallchecktrigger/firewallchecktrigger_test.go b/components/automate-cli/pkg/verifyserver/services/batchcheckservice/trigger/firewallchecktrigger/firewallchecktrigger_test.go index 603d7d15ab38..b58dc3e0e664 100644 --- a/components/automate-cli/pkg/verifyserver/services/batchcheckservice/trigger/firewallchecktrigger/firewallchecktrigger_test.go +++ b/components/automate-cli/pkg/verifyserver/services/batchcheckservice/trigger/firewallchecktrigger/firewallchecktrigger_test.go @@ -66,7 +66,7 @@ const ( "passed": false, "success_msg": "", "error_msg": "The service running at : is not reachable from ", - "resolution_msg": "Check your firewall settings to provide access to port at from " + "resolution_msg": "Check your firewall settings and provide access to port on from " } ] } @@ -122,7 +122,7 @@ const ( "passed": false, "success_msg": "", "error_msg": "The service running at : is not reachable from ", - "resolution_msg": "Check your firewall settings to provide access to port at from ", + "resolution_msg": "Check your firewall settings and provide access to port on from ", "skipped": false }, { @@ -130,7 +130,7 @@ const ( "passed": false, "success_msg": "", "error_msg": "The service running at : is not reachable from ", - "resolution_msg": "Check your firewall settings to provide access to port at from ", + "resolution_msg": "Check your firewall settings and provide access to port on from ", "skipped": false } ], @@ -326,10 +326,10 @@ func TestFirewallCheck_Run(t *testing.T) { Certificate: certificatelist, }, }, - response: "Internal Server Error", - httpStatusCode: http.StatusInternalServerError, - isError: true, - invalidParseResponse: false, + response: "Internal Server Error", + httpStatusCode: http.StatusInternalServerError, + isError: true, + invalidParseResponse: false, requiredStatusResponse: `{"error":{"code":500,"message":"Internal Server Error"}}`, }, { @@ -360,10 +360,10 @@ func TestFirewallCheck_Run(t *testing.T) { Certificate: certificatelist, }, }, - response: "source_node_ip, destination_node_ip, destination_service_port or destination_service_protocol cannot be empty", - httpStatusCode: http.StatusBadRequest, - isError: true, - invalidParseResponse: true, + response: "source_node_ip, destination_node_ip, destination_service_port or destination_service_protocol cannot be empty", + httpStatusCode: http.StatusBadRequest, + isError: true, + invalidParseResponse: true, requiredStatusResponse: `{"error":{"code":400,"message":"source_node_ip, destination_node_ip, destination_service_port or destination_service_protocol cannot be empty"}}`, }, { diff --git a/components/automate-cli/pkg/verifyserver/services/firewallservice/firewallservice.go b/components/automate-cli/pkg/verifyserver/services/firewallservice/firewallservice.go index 764fccaa0c1d..ff76e5fcc665 100644 --- a/components/automate-cli/pkg/verifyserver/services/firewallservice/firewallservice.go +++ b/components/automate-cli/pkg/verifyserver/services/firewallservice/firewallservice.go @@ -152,7 +152,7 @@ func GetFirewallErrorMsg(service, destinationIP, destinationPort, sourceIP strin } func GetFirewallResolutionMsg(destinationIP, destinationPort, sourceIP string) string { - return fmt.Sprintf("Check your firewall settings to provide access on %s port at %s from %s", destinationPort, destinationIP, sourceIP) + return fmt.Sprintf("Check your firewall settings and provide access to port %s on %s from %s", destinationPort, destinationIP, sourceIP) } func createFirewallCheck(passed bool, successMsg, errorMsg, resolutionMsg string) models.Checks { diff --git a/components/automate-cli/pkg/verifyserver/services/firewallservice/firewallservice_test.go b/components/automate-cli/pkg/verifyserver/services/firewallservice/firewallservice_test.go index ca4cde339479..d4d092ad45ef 100644 --- a/components/automate-cli/pkg/verifyserver/services/firewallservice/firewallservice_test.go +++ b/components/automate-cli/pkg/verifyserver/services/firewallservice/firewallservice_test.go @@ -42,7 +42,7 @@ const ( "passed": false, "success_msg": "", "error_msg": "The tcp service running at ANY_IP:7433 is not reachable", - "resolution_msg": "Check your firewall settings to provide access to 7433 port at 13.39.148.115" + "resolution_msg": "Check your firewall settings and provide access to port 7433 on 13.39.148.115" } } ` diff --git a/components/automate-cli/pkg/verifyserver/services/fqdnservice/fqdnservice.go b/components/automate-cli/pkg/verifyserver/services/fqdnservice/fqdnservice.go index 41bc19a77b9f..700c5d59b21b 100644 --- a/components/automate-cli/pkg/verifyserver/services/fqdnservice/fqdnservice.go +++ b/components/automate-cli/pkg/verifyserver/services/fqdnservice/fqdnservice.go @@ -114,7 +114,7 @@ func makeSet(reqNodes []string, isAfterDeployment bool) (map[string]int, error) func (fq *FqdnService) MakeConcurrentCalls(url string, client *http.Client, setNodes map[string]int) error { fq.log.Debug("Making Concurrent Calls...") fqdnResultChan := make(chan string) - minNumberOfCalls := 3 * len(setNodes) + minNumberOfCalls := 5 * len(setNodes) for i := 0; i < minNumberOfCalls; i++ { go func(fqdnResultChan chan string) { res, err := client.Get(url)