def test11_send_lls_nodeq_cmd_with_payload_to_request_FW_Version(self): # ************************************************************************************************# # Test #11: Test using lls_nodeq cmd at the Link Layer with payload that requests FW version # Verify imu_data last_read and fw version read back. # *************************************************************# Nm.nm_clear_logs(sendMode, IPV6) print "Testing BPD send raw payload for FW Version at LLS level...\n" rc = Nm.nm_send_CPD_cmd(sendMode, IPV6, BPD_DUT, PAYLOAD_FW_VER) print("Displaying the current BPD node security key...\n") Nm.nm_show_mac_sec_key(sendMode, IPV6, BPD_DUT, 1) # 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') 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) # Get resonse: rc = Nm.nm_get_latest_IMU_data_response(sendMode, IPV6) print "Response Data for BPD's FW Version is: \n\%s\'\n" % rc self.assertTrue(BPD_FW_VERSION in rc, "Did not get FW Version as expected")
def test07_delete_CPD_2_BPD_secure_key(self): # ************************************************************************************************# # Test #7: Test ability to remove/ddete/ default security key on CPD for BPD # *************************************************************# print "Showing default security key for BPD to CPD...\n" Nm.nm_clear_logs(sendMode, IPV6) rc = Nm.nm_show_mac_sec_key(sendMode, IPV6, BPD_DUT, 1) self.assertTrue('Key' in rc, "Secured Key for BPD should have been loaded...\n") print "Trying to establish ALS to delete old key" # Establihsing ALS connection and sendig first command via secured ALS reqId = Nm.random_with_N_digits(5) blobFileIn = CERTS_PATH + BLOB_FILE privkeyFileIn = CERTS_PATH + PRIVKEY_FILE # IPV6 = CPD_IPV6_AP timeOut = 30 replyType2 = '03' # HMAC, ShA256 for secured send comands (seqNum, assocId, ss) = Nm.nm_establish_ALS_connection(sendMode, IPV6, timeOut=60, reqId=12345, \ replyType=5, replyType2='03', blobFileIn=CERTS_PATH + BLOB_FILE, privkeyFileIn=CERTS_PATH + PRIVKEY_FILE) # Making a second secured command request via ALS cmdString = " mac_secmib delete " + str(BPD_DUT) + " 1" (seqNum, assocId, ss) = Nm.nm_als_secured_commands_send(sendMode, cmdString, seqNum, assocId, ss, IPV6, timeOut, replyType2) print "Return for next command request for: seqNum;\'%d\', assocId:\'%s\', and sharedsecret:\'%s\' \n" % ( seqNum, assocId, ss) # Bug: FIRMW-19441 rc = Nm.nm_show_mac_sec_key(sendMode, IPV6, BPD_DUT, 1) self.assertFalse( 'Key' in rc, "Key should of been deleted as expected, but delete is failing") 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)