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 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
Exemplo n.º 3
0
#Nm.nm_configure_cpd(sendMode, BPD1_IPV6_AP)
#Nm.nm_configure_cpd(sendMode, BPD2_IPV6_AP)
#Nm.nm_restart_now(sendMode, IPV6)    #Dont want to restart now

#Check Certs Ownership level of device:
#print "Validating & Checking certs ownership on devices... \'%s\'" % BPD1_IPV6_AP
#Nm.nm_validate_certs_ownership(sendMode, BPD1_IPV6_AP, FULLY_DL_CHAINED_CERTS)

#print "Validating & Checking certs ownership on devices... \'%s\'" % BPD2_IPV6_AP
#Nm.nm_validate_certs_ownership(sendMode, BPD2_IPV6_AP, FULLY_DL_CHAINED_CERTS)

print "Validating & Checking certs ownership on devices... \'%s\'" % CPD_IPV6_AP
Nm.nm_validate_certs_ownership(sendMode, CPD_IPV6_AP, FULLY_DL_CHAINED_CERTS)

#Check that lls_nodeq has both BPD devices under test:
Nm.nm_check_lls_enabled(sendMode, IPV6)

IPV6_ARRAY = [CPD_IPV6_AP]
BPD_ARRAY = [BPD1_BRICK_MAC_ID, BPD2_BRICK_MAC_ID]
ipv6 = CPD_IPV6_AP
"""
    # Upload Operator cert test:
    op_x509_path = CERTS_PATH + OP_CERT
    print "Uploading OP Cert...\n"
    Nm.nm_upload_op_cert(sendMode, CPD_IPV6_AP, op_x509_path)

    # Upload ECBOCA cert test:
    ecboca_x509_path = CERTS_PATH + SUB_CA_ECBOCA_CERT
    print "Uploading ECBOCA cert...\n"
    Nm.nm_upload_dl_cert(sendMode, CPD_IPV6_AP, ecboca_x509_path)