mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Add back v1.3 directory
This commit is contained in:
54
old/v1.3/testIP.py
Normal file
54
old/v1.3/testIP.py
Normal file
@@ -0,0 +1,54 @@
|
||||
import unittest
|
||||
import sys
|
||||
|
||||
class TestIP(unittest.TestCase):
|
||||
def test_ignore(self):
|
||||
"""
|
||||
Test that we are correctly ignoring an IP address
|
||||
"""
|
||||
sys.path.append('testdata/')
|
||||
from integrationCommon import isInIgnoredSubnets
|
||||
self.assertEqual(isInIgnoredSubnets("192.168.1.1"),True)
|
||||
|
||||
def test_not_ignore(self):
|
||||
"""
|
||||
Test that we are not ignoring an IP address
|
||||
"""
|
||||
sys.path.append('testdata/')
|
||||
from integrationCommon import isInIgnoredSubnets
|
||||
self.assertEqual(isInIgnoredSubnets("10.0.0.1"),False)
|
||||
|
||||
def test_allowed(self):
|
||||
"""
|
||||
Test that we are correctly permitting an IP address
|
||||
"""
|
||||
sys.path.append('testdata/')
|
||||
from integrationCommon import isInAllowedSubnets
|
||||
self.assertEqual(isInAllowedSubnets("100.64.1.1"),True)
|
||||
|
||||
def test_not_allowed(self):
|
||||
"""
|
||||
Test that we are correctly not permitting an IP address
|
||||
"""
|
||||
sys.path.append('testdata/')
|
||||
from integrationCommon import isInAllowedSubnets
|
||||
self.assertEqual(isInAllowedSubnets("101.64.1.1"),False)
|
||||
|
||||
def test_is_permitted(self):
|
||||
"""
|
||||
Test the combined isIpv4Permitted function for true
|
||||
"""
|
||||
sys.path.append('testdata/')
|
||||
from integrationCommon import isIpv4Permitted
|
||||
self.assertEqual(isIpv4Permitted("100.64.1.1"),True)
|
||||
|
||||
def test_is_not_permitted(self):
|
||||
"""
|
||||
Test the combined isIpv4Permitted function for false
|
||||
"""
|
||||
sys.path.append('testdata/')
|
||||
from integrationCommon import isIpv4Permitted
|
||||
self.assertEqual(isIpv4Permitted("101.64.1.1"),False)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user