summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xtest/test-controller.py4
-rwxr-xr-xtest/test-nbft.py2
-rwxr-xr-xtest/test-nbft_conf.py3
-rwxr-xr-xtest/test-service.py3
-rwxr-xr-xtest/test-transport_id.py3
-rwxr-xr-xtest/test-udev.py47
6 files changed, 60 insertions, 2 deletions
diff --git a/test/test-controller.py b/test/test-controller.py
index d33a6a2..54e4349 100755
--- a/test/test-controller.py
+++ b/test/test-controller.py
@@ -118,6 +118,7 @@ class Test(TestCase):
'trsvcid': '8009',
'host-traddr': '1.2.3.4',
'host-iface': 'wlp0s20f3',
+ 'host-nqn': 'nqn.1988-11.com.dell:poweredge:1234',
}
)
@@ -186,6 +187,7 @@ class Test(TestCase):
'host-iface': 'wlp0s20f3',
'subsysnqn': 'nqn.1988-11.com.dell:SFSS:2:20220208134025e8',
'device': 'nvme?',
+ 'host-nqn': 'nqn.1988-11.com.dell:poweredge:1234',
},
)
@@ -198,6 +200,7 @@ class Test(TestCase):
'trsvcid': '8009',
'host-traddr': '1.2.3.4',
'host-iface': 'wlp0s20f3',
+ 'host-nqn': 'nqn.1988-11.com.dell:poweredge:1234',
'device': 'nvme?',
'connect attempts': '1',
'retry connect timer': '60.0s [off]',
@@ -215,6 +218,7 @@ class Test(TestCase):
'trsvcid': '8009',
'host-traddr': '1.2.3.4',
'host-iface': 'wlp0s20f3',
+ 'host-nqn': 'nqn.1988-11.com.dell:poweredge:1234',
'subsysnqn': 'nqn.1988-11.com.dell:SFSS:2:20220208134025e8',
'device': 'nvme?',
'connect attempts': '1',
diff --git a/test/test-nbft.py b/test/test-nbft.py
index cf62214..3f0fa97 100755
--- a/test/test-nbft.py
+++ b/test/test-nbft.py
@@ -39,7 +39,7 @@ NBFT_DATA = {
"host_nqn_configured": True,
"id": "44454c4c-3400-1036-8038-b2c04f313233",
"nqn": "nqn.1988-11.com.dell:PowerEdge.R760.1234567",
- "primary_admin_host_flag": "not " "indicated",
+ "primary_admin_host_flag": "not indicated",
},
"subsystem": [
{
diff --git a/test/test-nbft_conf.py b/test/test-nbft_conf.py
index 85cb35d..072c3db 100755
--- a/test/test-nbft_conf.py
+++ b/test/test-nbft_conf.py
@@ -11,6 +11,7 @@ EXPECTED_DCS = [
'traddr': '100.71.103.50',
'transport': 'tcp',
'trsvcid': '8009',
+ 'host-nqn': 'nqn.1988-11.com.dell:PowerEdge.R760.1234567',
}
]
EXPECTED_IOCS = [
@@ -21,6 +22,7 @@ EXPECTED_IOCS = [
'traddr': '100.71.103.48',
'transport': 'tcp',
'trsvcid': '4420',
+ 'host-nqn': 'nqn.1988-11.com.dell:PowerEdge.R760.1234567',
},
{
'data-digest': False,
@@ -29,6 +31,7 @@ EXPECTED_IOCS = [
'traddr': '100.71.103.49',
'transport': 'tcp',
'trsvcid': '4420',
+ 'host-nqn': 'nqn.1988-11.com.dell:PowerEdge.R760.1234567',
},
]
diff --git a/test/test-service.py b/test/test-service.py
index ef1cb6e..567d592 100755
--- a/test/test-service.py
+++ b/test/test-service.py
@@ -58,9 +58,10 @@ class Test(TestCase):
transport='tcp',
traddr='10.10.10.10',
trsvcid='8009',
+ subsysnqn='nqn.1988-11.com.dell:SFSS:2:20220208134025e8',
host_traddr='1.2.3.4',
host_iface='wlp0s20f3',
- subsysnqn='nqn.1988-11.com.dell:SFSS:2:20220208134025e8',
+ host_nqn='nqn.2014-08.org.nvmexpress:uuid:01234567-0123-0123-0123-0123456789ab',
),
None,
)
diff --git a/test/test-transport_id.py b/test/test-transport_id.py
index 36953dd..d0386ec 100755
--- a/test/test-transport_id.py
+++ b/test/test-transport_id.py
@@ -13,6 +13,7 @@ class Test(unittest.TestCase):
TRSVCID = '8009'
HOST_TRADDR = '1.2.3.4'
HOST_IFACE = 'wlp0s20f3'
+ HOST_NQN = 'nqn.1988-11.com.dell:12345'
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@@ -23,6 +24,7 @@ class Test(unittest.TestCase):
'trsvcid': Test.TRSVCID,
'host-traddr': Test.HOST_TRADDR,
'host-iface': Test.HOST_IFACE,
+ 'host-nqn': Test.HOST_NQN,
}
self.other_cid = {
'transport': Test.TRANSPORT,
@@ -31,6 +33,7 @@ class Test(unittest.TestCase):
'trsvcid': Test.TRSVCID,
'host-traddr': Test.HOST_TRADDR,
'host-iface': Test.HOST_IFACE,
+ 'host-nqn': Test.HOST_NQN,
}
self.tid = trid.TID(self.cid)
diff --git a/test/test-udev.py b/test/test-udev.py
index 71e5f8a..9508de4 100755
--- a/test/test-udev.py
+++ b/test/test-udev.py
@@ -33,6 +33,7 @@ def get_tids_to_test(family, src_ip, ifname):
'subsysnqn': 'hello',
'host-traddr': src_ip,
'host-iface': ifname,
+ 'host-nqn': '',
}
),
True,
@@ -47,6 +48,7 @@ def get_tids_to_test(family, src_ip, ifname):
'subsysnqn': 'hello',
'host-traddr': src_ip,
'host-iface': ifname,
+ 'host-nqn': '',
}
),
False,
@@ -61,6 +63,7 @@ def get_tids_to_test(family, src_ip, ifname):
'subsysnqn': 'hello',
'host-traddr': src_ip,
'host-iface': ifname,
+ 'host-nqn': '',
}
),
False,
@@ -75,6 +78,7 @@ def get_tids_to_test(family, src_ip, ifname):
'subsysnqn': 'hello',
'host-traddr': src_ip,
'host-iface': ifname,
+ 'host-nqn': '',
}
),
False,
@@ -89,6 +93,7 @@ def get_tids_to_test(family, src_ip, ifname):
'subsysnqn': 'hello',
'host-traddr': '255.255.255.255',
'host-iface': ifname,
+ 'host-nqn': '',
}
),
False,
@@ -103,6 +108,7 @@ def get_tids_to_test(family, src_ip, ifname):
'subsysnqn': 'hello',
'host-traddr': src_ip,
'host-iface': 'blah',
+ 'host-nqn': '',
}
),
False,
@@ -117,6 +123,7 @@ def get_tids_to_test(family, src_ip, ifname):
'subsysnqn': 'bob',
'host-traddr': src_ip,
'host-iface': ifname,
+ 'host-nqn': '',
}
),
False,
@@ -130,6 +137,7 @@ def get_tids_to_test(family, src_ip, ifname):
'trsvcid': '8009',
'subsysnqn': 'hello',
'host-iface': ifname,
+ 'host-nqn': '',
}
),
True,
@@ -143,6 +151,7 @@ def get_tids_to_test(family, src_ip, ifname):
'trsvcid': '8009',
'subsysnqn': 'hello',
'host-traddr': src_ip,
+ 'host-nqn': '',
}
),
True,
@@ -155,6 +164,7 @@ def get_tids_to_test(family, src_ip, ifname):
'traddr': traddr(family),
'trsvcid': '8009',
'subsysnqn': 'hello',
+ 'host-nqn': '',
}
),
True,
@@ -169,6 +179,7 @@ def get_tids_to_test(family, src_ip, ifname):
'subsysnqn': 'hello',
'host-traddr': src_ip,
'host-iface': ifname,
+ 'host-nqn': '',
}
),
True,
@@ -182,6 +193,7 @@ def get_tids_to_test(family, src_ip, ifname):
'trsvcid': '8009',
'subsysnqn': 'hello',
'host-iface': ifname,
+ 'host-nqn': '',
}
),
True,
@@ -296,6 +308,7 @@ class Test(unittest.TestCase):
'host-traddr': src_ipv4,
'host-iface': ifname,
'src-addr': src_ipv4,
+ 'host-nqn': '',
}
cid_legacy = {
'transport': 'tcp',
@@ -305,6 +318,7 @@ class Test(unittest.TestCase):
'host-traddr': src_ipv4,
'host-iface': ifname,
'src-addr': '', # Legacy
+ 'host-nqn': '',
}
for case_id, tid, match in get_tids_to_test(4, src_ipv4, ifname):
self.assertEqual(match, udev.UDEV._cid_matches_tid(tid, cid), msg=f'Test Case {case_id} failed')
@@ -321,6 +335,7 @@ class Test(unittest.TestCase):
'host-traddr': '',
'host-iface': '',
'src-addr': '', # Legacy
+ 'host-nqn': '',
}
tid = trid.TID(
{
@@ -329,6 +344,7 @@ class Test(unittest.TestCase):
'trsvcid': '8009',
'subsysnqn': 'hello',
'host-traddr': '1.1.1.1',
+ 'host-nqn': '',
}
)
self.assertEqual(True, udev.UDEV._cid_matches_tid(tid, cid_legacy), msg=f'Legacy Test Case A4.1 failed')
@@ -341,6 +357,7 @@ class Test(unittest.TestCase):
'host-traddr': '',
'host-iface': ifname,
'src-addr': '', # Legacy
+ 'host-nqn': '',
}
tid = trid.TID(
{
@@ -348,6 +365,7 @@ class Test(unittest.TestCase):
'traddr': traddr(4),
'trsvcid': '8009',
'subsysnqn': 'hello',
+ 'host-nqn': '',
}
)
self.assertEqual(True, udev.UDEV._cid_matches_tid(tid, cid_legacy), msg=f'Legacy Test Case A4.2 failed')
@@ -363,6 +381,7 @@ class Test(unittest.TestCase):
'host-traddr': src_ipv4,
'host-iface': '',
'src-addr': '', # Legacy
+ 'host-nqn': '',
}
tid = trid.TID(
{
@@ -371,6 +390,7 @@ class Test(unittest.TestCase):
'trsvcid': '8009',
'subsysnqn': 'hello',
'host-traddr': '1.1.1.1',
+ 'host-nqn': '',
}
)
self.assertEqual(False, udev.UDEV._cid_matches_tid(tid, cid_legacy), msg=f'Legacy Test Case B4 failed')
@@ -382,6 +402,7 @@ class Test(unittest.TestCase):
'trsvcid': '8009',
'subsysnqn': 'hello',
'host-iface': 'blah',
+ 'host-nqn': '',
}
)
self.assertEqual(False, udev.UDEV._cid_matches_tid(tid, cid_legacy), msg=f'Legacy Test Case C4 failed')
@@ -393,6 +414,7 @@ class Test(unittest.TestCase):
'trsvcid': '8009',
'subsysnqn': 'hello',
'host-iface': ifname,
+ 'host-nqn': '',
}
)
self.assertEqual(True, udev.UDEV._cid_matches_tid(tid, cid_legacy), msg=f'Legacy Test Case D4 failed')
@@ -405,6 +427,7 @@ class Test(unittest.TestCase):
'host-traddr': '',
'host-iface': ifname,
'src-addr': '', # Legacy
+ 'host-nqn': '',
}
tid = trid.TID(
{
@@ -414,6 +437,7 @@ class Test(unittest.TestCase):
'subsysnqn': 'hello',
'host-traddr': '1.1.1.1',
'host-iface': 'blah',
+ 'host-nqn': '',
}
)
self.assertEqual(False, udev.UDEV._cid_matches_tid(tid, cid_legacy), msg=f'Legacy Test Case E4 failed')
@@ -425,6 +449,7 @@ class Test(unittest.TestCase):
'trsvcid': '8009',
'subsysnqn': 'hello',
'host-traddr': '1.1.1.1',
+ 'host-nqn': '',
}
)
self.assertEqual(False, udev.UDEV._cid_matches_tid(tid, cid_legacy), msg=f'Legacy Test Case F4 failed')
@@ -436,6 +461,7 @@ class Test(unittest.TestCase):
'trsvcid': '8009',
'subsysnqn': 'hello',
'host-traddr': ipv4_addrs[0],
+ 'host-nqn': '',
}
)
match = len(ipv4_addrs) == 1 and iputil.get_ipaddress_obj(
@@ -456,6 +482,7 @@ class Test(unittest.TestCase):
'host-traddr': src_ipv6,
'host-iface': ifname,
'src-addr': src_ipv6,
+ 'host-nqn': '',
}
cid_legacy = {
'transport': 'tcp',
@@ -465,6 +492,7 @@ class Test(unittest.TestCase):
'host-traddr': src_ipv6,
'host-iface': ifname,
'src-addr': '', # Legacy
+ 'host-nqn': '',
}
for case_id, tid, match in get_tids_to_test(6, src_ipv6, ifname):
self.assertEqual(match, udev.UDEV._cid_matches_tid(tid, cid), msg=f'Test Case {case_id} failed')
@@ -480,6 +508,7 @@ class Test(unittest.TestCase):
'host-traddr': '',
'host-iface': '',
'src-addr': '', # Legacy
+ 'host-nqn': '',
}
tid = trid.TID(
{
@@ -488,6 +517,7 @@ class Test(unittest.TestCase):
'trsvcid': '8009',
'subsysnqn': 'hello',
'host-traddr': 'AAAA::FFFF',
+ 'host-nqn': '',
}
)
self.assertEqual(True, udev.UDEV._cid_matches_tid(tid, cid_legacy), msg=f'Legacy Test Case A6.1 failed')
@@ -500,6 +530,7 @@ class Test(unittest.TestCase):
'host-traddr': '',
'host-iface': ifname,
'src-addr': '', # Legacy
+ 'host-nqn': '',
}
tid = trid.TID(
{
@@ -507,6 +538,7 @@ class Test(unittest.TestCase):
'traddr': traddr(6),
'trsvcid': '8009',
'subsysnqn': 'hello',
+ 'host-nqn': '',
}
)
self.assertEqual(True, udev.UDEV._cid_matches_tid(tid, cid_legacy), msg=f'Legacy Test Case A6.2 failed')
@@ -522,6 +554,7 @@ class Test(unittest.TestCase):
'host-traddr': src_ipv6,
'host-iface': '',
'src-addr': '', # Legacy
+ 'host-nqn': '',
}
tid = trid.TID(
{
@@ -530,6 +563,7 @@ class Test(unittest.TestCase):
'trsvcid': '8009',
'subsysnqn': 'hello',
'host-traddr': 'AAAA::FFFF',
+ 'host-nqn': '',
}
)
self.assertEqual(False, udev.UDEV._cid_matches_tid(tid, cid_legacy), msg=f'Legacy Test Case B6 failed')
@@ -541,6 +575,7 @@ class Test(unittest.TestCase):
'trsvcid': '8009',
'subsysnqn': 'hello',
'host-iface': 'blah',
+ 'host-nqn': '',
}
)
self.assertEqual(False, udev.UDEV._cid_matches_tid(tid, cid_legacy), msg=f'Legacy Test Case C6 failed')
@@ -552,6 +587,7 @@ class Test(unittest.TestCase):
'trsvcid': '8009',
'subsysnqn': 'hello',
'host-iface': ifname,
+ 'host-nqn': '',
}
)
self.assertEqual(True, udev.UDEV._cid_matches_tid(tid, cid_legacy), msg=f'Legacy Test Case D6 failed')
@@ -564,6 +600,7 @@ class Test(unittest.TestCase):
'host-traddr': '',
'host-iface': ifname,
'src-addr': '', # Legacy
+ 'host-nqn': '',
}
tid = trid.TID(
{
@@ -573,6 +610,7 @@ class Test(unittest.TestCase):
'subsysnqn': 'hello',
'host-traddr': 'AAA::BBBB',
'host-iface': 'blah',
+ 'host-nqn': '',
}
)
self.assertEqual(False, udev.UDEV._cid_matches_tid(tid, cid_legacy), msg=f'Legacy Test Case E6 failed')
@@ -584,6 +622,7 @@ class Test(unittest.TestCase):
'trsvcid': '8009',
'subsysnqn': 'hello',
'host-traddr': 'AAA::BBB',
+ 'host-nqn': '',
}
)
self.assertEqual(False, udev.UDEV._cid_matches_tid(tid, cid_legacy), msg=f'Legacy Test Case F6 failed')
@@ -595,6 +634,7 @@ class Test(unittest.TestCase):
'trsvcid': '8009',
'subsysnqn': 'hello',
'host-traddr': ipv6_addrs[0],
+ 'host-nqn': '',
}
)
match = len(ipv6_addrs) == 1 and iputil.get_ipaddress_obj(
@@ -612,6 +652,7 @@ class Test(unittest.TestCase):
'host-traddr': 'AAA::BBBB',
'host-iface': '',
'src-addr': '',
+ 'host-nqn': '',
}
tid = trid.TID(
{
@@ -620,6 +661,7 @@ class Test(unittest.TestCase):
'trsvcid': '',
'subsysnqn': 'hello',
'host-traddr': 'AAA::BBBB',
+ 'host-nqn': '',
}
)
self.assertEqual(True, udev.UDEV._cid_matches_tid(tid, cid), msg=f'Test Case FC-1 failed')
@@ -631,6 +673,7 @@ class Test(unittest.TestCase):
'trsvcid': '',
'subsysnqn': 'hello',
'host-traddr': 'BBBB::AAA',
+ 'host-nqn': '',
}
)
self.assertEqual(False, udev.UDEV._cid_matches_tid(tid, cid), msg=f'Test Case FC-2 failed')
@@ -645,6 +688,7 @@ class Test(unittest.TestCase):
'host-traddr': '5.4.3.2',
'host-iface': '',
'src-addr': '',
+ 'host-nqn': '',
}
tid = trid.TID(
{
@@ -653,6 +697,7 @@ class Test(unittest.TestCase):
'trsvcid': '4444',
'subsysnqn': 'hello',
'host-traddr': '5.4.3.2',
+ 'host-nqn': '',
}
)
self.assertEqual(True, udev.UDEV._cid_matches_tid(tid, cid), msg=f'Test Case RDMA-1 failed')
@@ -664,6 +709,7 @@ class Test(unittest.TestCase):
'trsvcid': '4444',
'subsysnqn': 'hello',
'host-traddr': '5.5.6.6',
+ 'host-nqn': '',
}
)
self.assertEqual(False, udev.UDEV._cid_matches_tid(tid, cid), msg=f'Test Case RDMA-2 failed')
@@ -674,6 +720,7 @@ class Test(unittest.TestCase):
'traddr': '2.3.4.5',
'trsvcid': '4444',
'subsysnqn': 'hello',
+ 'host-nqn': '',
}
)
self.assertEqual(True, udev.UDEV._cid_matches_tid(tid, cid), msg=f'Test Case RDMA-3 failed')