def test00_Preliminary_Requesites_Check(self):
        IPV6 = CPD2_IPV6_FSU  #CPD1_IPV6_AP
        BPD_DUT = BPD2_BRICK_MAC_ID  # BPD1_BRICK_MAC_ID

        print "Get Image List...\n"
        Nm.nm_get_image_list(sendMode, IPV6)

        # get version str on device
        print "Get Version Str...\n"
        Nm.nm_get_version_str(sendMode, IPV6)

        # Configure CPD to be able to proxy for BPDS: :
        print "Configuring CPD for proper Proxy Mode on behalf of BPD...\n"
        Nm.nm_configure_cpd(sendMode, IPV6, BPD_DUT)

        # Display lls_nodeq:
        print "Getting Link Layer Nodeq for the CPD and BPDs...\n"
        rc = Nm.nm_show_BPD_LLS_Nodes(sendMode, IPV6)

        # Get Random 5-digits Required ID to start communication
        reqId = Nm.random_with_N_digits(5)
        blobFileIn = CERTS_PATH + BLOB_FILE
        privkeyFileIn = CERTS_PATH + PRIVKEY_FILE
        #IPV6 = CPD_IPV6_AP
        timeOut = 30
        replyType = 5  # BC=0x1 + Blob=0x4 for nm.nm_sec_assoc assoc
        replyType2 = '03'  # HMAC, ShA256 for secured send comands

        print "Validating & Checking certs ownership on devices... \'%s\'\n" % IPV6
        rc = Nm.nm_validate_certs_ownership(sendMode, IPV6,
                                            FULLY_DL_CHAINED_CERTS)
        self.assertTrue('PASSED' in rc, "FAILED Certs Chain Verification")

        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)

        # Clear both the event and nlog for APP layer secure events:
        rc = Nm.nm_clear_logs(sendMode, IPV6)
        print rc
示例#2
0
# Configure CPD to talk to BPD:
Nm.nm_configure_cpd(sendMode, IPV6)
#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