コード例 #1
0
ファイル: brcmmoca_test.py プロジェクト: prahlad574/my
 def testMocaInterfaceStatsNonexistent(self):
     netdev.PROC_NET_DEV = 'testdata/brcmmoca/proc/net/dev'
     moca = brcmmoca.BrcmMocaInterfaceStatsLinux26('doesnotexist0')
     exception_raised = False
     try:
         moca.ErrorsReceived
     except AttributeError:
         exception_raised = True
     self.assertTrue(exception_raised)
コード例 #2
0
ファイル: brcmmoca_test.py プロジェクト: prahlad574/my
    def testMocaInterfaceStatsGood(self):
        netdev.PROC_NET_DEV = 'testdata/brcmmoca/proc/net/dev'
        moca = brcmmoca.BrcmMocaInterfaceStatsLinux26('foo0')
        moca.ValidateExports()

        self.assertEqual(moca.BroadcastPacketsReceived, None)
        self.assertEqual(moca.BroadcastPacketsSent, None)
        self.assertEqual(moca.BytesReceived, '1')
        self.assertEqual(moca.BytesSent, '9')
        self.assertEqual(moca.DiscardPacketsReceived, '4')
        self.assertEqual(moca.DiscardPacketsSent, '11')
        self.assertEqual(moca.ErrorsReceived, '9')
        self.assertEqual(moca.ErrorsSent, '12')
        self.assertEqual(moca.MulticastPacketsReceived, '8')
        self.assertEqual(moca.MulticastPacketsSent, None)
        self.assertEqual(moca.PacketsReceived, '100')
        self.assertEqual(moca.PacketsSent, '10')
        self.assertEqual(moca.UnicastPacketsReceived, '92')
        self.assertEqual(moca.UnicastPacketsSent, '10')
        self.assertEqual(moca.UnknownProtoPacketsReceived, None)
コード例 #3
0
 def testMocaInterfaceStatsGood(self):
     moca = brcmmoca.BrcmMocaInterfaceStatsLinux26('foo0')
     tr.handle.ValidateExports(moca)
     self.assertEqual(moca.UnicastPacketsSent, 10)