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
    def setUp(self):
        #self.certsTest = Widget('The widget')
        sendMode = '-d'

        timeOut = 60
        #Nm.nm_discover_thy_neighbor(sendMode, CPD_MAC_ID, 30)

        reqId = Nm.random_with_N_digits(5)
        blobFileIn = CERTS_PATH + BLOB_FILE
        privkeyFileIn = CERTS_PATH + PRIVKEY_FILE
        IPV6 = CPD_IPV6_AP
        replyType = 5  # BC=0x1 + Blob=0x4 for nm.nm_sec_assoc assoc
        replyType2 = '03'  # HMAC, ShA256 for secured send comands

        # Configure CPD to talk to BPD:
        Nm.nm_configure_cpd(sendMode, IPV6)

        # Establihsing ALS connection and sendig first command via secured ALS
        (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)
        self.assertTrue(self, (assocId !=0 or ss != ''), "Wrong response for ")
Exemplo n.º 3
0
print "NIC info"
sendMode = '-d'

timeOut = 60
#Nm.nm_discover_thy_neighbor(sendMode, CPD_MAC_ID, 30)

# 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
replyType = 5  # BC=0x1 + Blob=0x4 for nm.nm_sec_assoc assoc
replyType2 = '03'  # HMAC, ShA256 for secured send comands

# 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: