From 8f7d9027b3ed5083b66b329f9fbee4c2c70b6139 Mon Sep 17 00:00:00 2001 From: jhughesbiot Date: Tue, 26 Sep 2023 12:54:36 -0600 Subject: [PATCH 1/2] Fix tls details for client test --- modules/test/tls/python/src/tls_module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/test/tls/python/src/tls_module.py b/modules/test/tls/python/src/tls_module.py index 87bbd2db8..970152768 100644 --- a/modules/test/tls/python/src/tls_module.py +++ b/modules/test/tls/python/src/tls_module.py @@ -97,7 +97,7 @@ def _validate_tls_client(self, client_ip, tls_version): elif monitor_result[0] and startup_result[0] is None: result = True, monitor_result[1] elif startup_result[0] and monitor_result[0] is None: - result = True, monitor_result[1] + result = True, startup_result[1] else: result = None, startup_result[1] return result From fc40ac162061f035b0a71832519b7c95f316531e Mon Sep 17 00:00:00 2001 From: jhughesbiot Date: Tue, 26 Sep 2023 12:55:47 -0600 Subject: [PATCH 2/2] Fix single ip test for different DHCP option order Add non-debug logging to allow for easier troubleshooting if single ip test fails --- .../test/conn/python/src/connection_module.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/modules/test/conn/python/src/connection_module.py b/modules/test/conn/python/src/connection_module.py index 8bbee5757..1ffb6ee4a 100644 --- a/modules/test/conn/python/src/connection_module.py +++ b/modules/test/conn/python/src/connection_module.py @@ -130,21 +130,23 @@ def _connection_single_ip(self): # Extract MAC addresses from DHCP packets mac_addresses = set() - LOGGER.debug('Inspecting: ' + str(len(packets)) + ' packets') + LOGGER.info('Inspecting: ' + str(len(packets)) + ' packets') for packet in packets: - # Option[1] = message-type, option 3 = DHCPREQUEST - if DHCP in packet and packet[DHCP].options[0][1] == 3: - mac_address = packet[Ether].src - if not mac_address.startswith(TR_CONTAINER_MAC_PREFIX): - mac_addresses.add(mac_address.upper()) + if DHCP in packet: + for option in packet[DHCP].options: + # message-type, option 3 = DHCPREQUEST + if 'message-type' in option and option[1] == 3: + mac_address = packet[Ether].src + LOGGER.info('DHCPREQUEST detected MAC addres: ' + mac_address) + if not mac_address.startswith(TR_CONTAINER_MAC_PREFIX): + mac_addresses.add(mac_address.upper()) # Check if the device mac address is in the list of DHCPREQUESTs result = self._device_mac.upper() in mac_addresses - LOGGER.debug('DHCPREQUEST detected from device: ' + str(result)) + LOGGER.info('DHCPREQUEST detected from device: ' + str(result)) # Check the unique MAC addresses to see if they match the device for mac_address in mac_addresses: - LOGGER.debug('DHCPREQUEST from MAC address: ' + mac_address) result &= self._device_mac.upper() == mac_address if result: