def testNetemWorks(self): ''' Check if system configured to run sudo tc without password If this test fail add the following in visudo: username ALL=NOPASSWD: /usr/sbin/tc This allow user 'username' to run 'sudo tc' without password prompt that is needed for netem module ''' console.terse("{0}\n".format(self.testNetemWorks.__doc__)) self.assertTrue(netem.delay()) self.assertEqual(netem.check(), 1)
def testDelayOneToOneToMaster(self): ''' One slave sends messages to one master with network delays ''' console.terse("{0}\n".format(self.testDelayOneToOneToMaster.__doc__)) self.assertTrue(netem.delay(time=200, jitter=100, correlation=30)) self.assertEqual(netem.check(), 1) self.messagingMultiPeers(masterCount=1, minionCount=1, msgSize=testing.MSG_SIZE_MED, msgCount=testing.MSG_COUNT_MED, duration=100.0, direction=testing.DIR_TO_MASTER)
def testDelayManyToManyBidirectional(self): ''' Bidirectional messaging between many masters and many slaves with network delay ''' console.terse("{0}\n".format(self.testDelayManyToManyBidirectional.__doc__)) self.assertTrue(netem.delay(time=200, jitter=100, correlation=30)) self.assertEqual(netem.check(), 1) self.messagingMultiPeers(masterCount=testing.MULTI_MASTER_COUNT, minionCount=testing.MULTI_MINION_COUNT, msgSize=testing.MSG_SIZE_MED, msgCount=testing.MSG_COUNT_MED, duration=100.0, direction=testing.DIR_BIDIRECTIONAL)
def testDelayManyToManyBidirectional(self): ''' Bidirectional messaging between many masters and many slaves with network delay ''' console.terse("{0}\n".format( self.testDelayManyToManyBidirectional.__doc__)) self.assertTrue(netem.delay(time=200, jitter=100, correlation=30)) self.assertEqual(netem.check(), 1) self.messagingMultiPeers(masterCount=testing.MULTI_MASTER_COUNT, minionCount=testing.MULTI_MINION_COUNT, msgSize=testing.MSG_SIZE_MED, msgCount=testing.MSG_COUNT_MED, duration=100.0, direction=testing.DIR_BIDIRECTIONAL)