def test_get_chanin_name(self):
     name = '0123456789' * 5
     # 28 chars is the maximum length of iptables chain name.
     self.assertEqual(iptables_manager.get_chain_name(name, wrap=False),
                      name[:28])
     # 11 chars is the maximum length of chain name of iptable_manager
     # if binary_name is prepended.
     self.assertEqual(iptables_manager.get_chain_name(name, wrap=True),
                      name[:11])
 def test_get_chanin_name(self):
     name = '0123456789' * 5
     # 28 chars is the maximum length of iptables chain name.
     self.assertEqual(iptables_manager.get_chain_name(name, wrap=False),
                      name[:28])
     # 11 chars is the maximum length of chain name of iptable_manager
     # if binary_name is prepended.
     self.assertEqual(iptables_manager.get_chain_name(name, wrap=True),
                      name[:11])
예제 #3
0
 def _port_chain_name(self, port, direction):
     return iptables_manager.get_chain_name(
         '%s%s' % (CHAIN_NAME_PREFIX[direction], port['device']))
예제 #4
0
 def _port_chain_name(self, port, direction):
     return iptables_manager.get_chain_name(
         '%s%s' % (CHAIN_NAME_PREFIX[direction], port['device']))
예제 #5
0
 def _port_chain_name(self, port, direction):
     return iptables_manager.get_chain_name("%s%s" % (CHAIN_NAME_PREFIX[direction], port["device"]))