def test08_send_package_with_mac_security_enabled(self): # ************************************************************************************************# # Test #8: Test with Mac security enabled 1000 bytes length payload to BPD: # *************************************************************# Nm.nm_clear_logs(sendMode, IPV6) print("Re-infecting default secure key on CPD for BPD....\n") Nm.nm_inject_security_key(sendMode, IPV6, DEFAULT_SECURITY_KEY, 1) # Take a read of stats before send: print "lls_nodeq data send statistic before send....\n" Nm.nm_check_lls_enabled(sendMode, IPV6) print "Sending Test PAYLOAD_1000 to BPD...\n" rc = Nm.nm_send_CPD_cmd(sendMode, IPV6, BPD_DUT, PAYLOAD_1000) self.assertTrue('Ok' in rc, "Did not get 'OK' message as expected") # TODO: Once Security is fully implemented, # Need to revisit this test and check and assert for SecLevel=6 # without requiring the [SecMode][Index] options. print "Sleep for set CPD-2-BPD POLLING INTERVAL SETTING OF: \'%s\' seconds ..." % ( CPD_2_BPD_POLLING_INTERVAL) time.sleep(CPD_2_BPD_POLLING_INTERVAL) # Take a read of stats after send: print "lls_nodeq data send statistic before send....\n" rc = Nm.nm_check_lls_enabled(sendMode, IPV6) self.assertTrue( BPD_DUT.lower() in rc, 'Did not get BPD under test Mac ID in lls_nodeq show all') #NOTE: Loac/inject security is no longer supported if Security is enable, since A3-Integration # Show current Secure Key: #print "Display current loaded secured key for BPD on CPD\n" #rc = Nm.nm_show_mac_sec_key(sendMode, IPV6, BPD_DUT, 1) #self.assertTrue(DEFAULT_SECURITY_KEY.lower() in rc, #'Did not get DEFAULT_SECURITY_KEY in mac_secmib show BPD_DUT') # Get event log for APP layer secure events: rc = Nm.nm_event( sendMode, IPV6) #Note: lls cmd is a link layer send, so wont see
def test06_load_CPD_2_BPD_secure_key(self): # ************************************************************************************************# # Test #6: Test ability to load and set default security key on CPD for BPD # *************************************************************# Nm.nm_clear_logs(sendMode, IPV6) print "Uploading default security key for BPD to CPD...\n" # Inject default security key between CPD and BPD rc = Nm.nm_inject_security_key(sendMode, IPV6, BPD_DUT, DEFAULT_SECURITY_KEY, 1) self.assertTrue('Ok' in rc, "Did not get 'OK' message as expected")