From 678fc86e196f2ff02603de8e82e9ba82a722273e Mon Sep 17 00:00:00 2001 From: JoukoVirtanen Date: Wed, 13 Nov 2024 20:10:26 -0800 Subject: [PATCH] Updated comments --- .../suites/runtime_config_file.go | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/integration-tests/suites/runtime_config_file.go b/integration-tests/suites/runtime_config_file.go index 86580f96cd..940d727207 100644 --- a/integration-tests/suites/runtime_config_file.go +++ b/integration-tests/suites/runtime_config_file.go @@ -84,9 +84,6 @@ func (s *RuntimeConfigFileTestSuite) setExternalIpsEnable(runtimeConfigFile stri } // Launches collector and creates the directory for runtime configuration. -// Writes various things to the file for runtime configuration and checks -// the config introspection endpoint to make sure that the configuration is -// correct. func (s *RuntimeConfigFileTestSuite) SetupTest() { s.RegisterCleanup("external-connection") @@ -138,10 +135,10 @@ func (s *RuntimeConfigFileTestSuite) TestRuntimeConfigFileEnable() { connectionSuccess = s.Sensor().ExpectSameElementsConnections(s.T(), s.ClientContainer, 10*time.Second, expectedConnections...) s.Require().True(connectionSuccess) - s.deleteFile(runtimeConfigFile) - assert.AssertNoRuntimeConfig(s.T(), collectorIP) // The runtime config file is deleted. This disables external IPs. The normalized connection should be active // and the unnormalized connection shoul be inactive. + s.deleteFile(runtimeConfigFile) + assert.AssertNoRuntimeConfig(s.T(), collectorIP) expectedConnections = append(expectedConnections, activeNormalizedConnection, inactiveUnnormalizedConnection) connectionSuccess = s.Sensor().ExpectSameElementsConnections(s.T(), s.ClientContainer, 10*time.Second, expectedConnections...) s.Require().True(connectionSuccess) @@ -155,14 +152,16 @@ func (s *RuntimeConfigFileTestSuite) TestRuntimeConfigFileEnable() { } func (s *RuntimeConfigFileTestSuite) TestRuntimeConfigFileDisable() { - // The runtime config file was deleted before starting collector so there should not be any config + // The runtime config file was deleted before starting collector. + // Default configuration is external IPs disabled. + // We expect normalized connections. assert.AssertNoRuntimeConfig(s.T(), collectorIP) - // Since there is no config the default is used, which means external IPs is disabled and we should - // expect a normalized connection expectedConnections := []types.NetworkInfo{activeNormalizedConnection} connectionSuccess := s.Sensor().ExpectSameElementsConnections(s.T(), s.ClientContainer, 10*time.Second, expectedConnections...) s.Require().True(connectionSuccess) + // The runtime config file is created, but external IPs is disables. + // There is no change in the state, so there are no changes to the connections s.setExternalIpsEnable(runtimeConfigFile, false) assert.AssertExternalIps(s.T(), false, collectorIP) common.Sleep(3 * time.Second) // Sleep so that collector has a chance to report connections @@ -178,10 +177,10 @@ func (s *RuntimeConfigFileTestSuite) TestRuntimeConfigFileDisable() { } func (s *RuntimeConfigFileTestSuite) TestRuntimeConfigFileInvalid() { - // The runtime config file was deleted before starting collector so there should not be any config + // The runtime config file was deleted before starting collector. + // Default configuration is external IPs disabled. + // We expect normalized connections. assert.AssertNoRuntimeConfig(s.T(), collectorIP) - // Since there is no config the default is used, which means external IPs is disabled and we should - // expect a normalized connection expectedConnections := []types.NetworkInfo{activeNormalizedConnection} connectionSuccess := s.Sensor().ExpectSameElementsConnections(s.T(), s.ClientContainer, 10*time.Second, expectedConnections...) s.Require().True(connectionSuccess)