X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=tests%2Fintegration-ocloud%2Ftest_clientdriver_stx.py;h=a9f404bf09bebc3b80071cc932336612214ed60c;hb=79323988bfb68d23a9d781843c0b73f3fa463809;hp=9c0c3943dfc45368150b88e3d35e1a6acf087a8c;hpb=576ad21504bb3e50546b349c63ebec7bd0c805ab;p=pti%2Fo2.git diff --git a/tests/integration-ocloud/test_clientdriver_stx.py b/tests/integration-ocloud/test_clientdriver_stx.py index 9c0c394..a9f404b 100644 --- a/tests/integration-ocloud/test_clientdriver_stx.py +++ b/tests/integration-ocloud/test_clientdriver_stx.py @@ -81,6 +81,27 @@ def test_get_k8s_list(real_stx_aio_client): assert k8s1.name == k8s2.name assert k8s1.id == k8s2.id + if len(k8slist) > 1: + k8s3 = k8slist[1] + k8s4 = stxClientImp.getK8sDetail(k8s3.name) + assert k8s3 != k8s4 + assert k8s3.name == k8s4.name + assert k8s3.id == k8s4.id + + +def test_get_label_list(real_stx_aio_client): + stxClientImp = StxClientImp(real_stx_aio_client) + assert stxClientImp is not None + hostlist = stxClientImp.getPserverList() + assert len(hostlist) > 0 + + print(hostlist[0].id) + + labellist = stxClientImp.getLabelList(hostid=hostlist[0].id) + assert len(labellist) > 0 + label1 = labellist[0] + assert label1.id == "test" + def test_get_cpu_list(real_stx_aio_client): stxClientImp = StxClientImp(real_stx_aio_client) @@ -155,9 +176,35 @@ def test_get_if_port_list(real_stx_aio_client): assert port1.id == port2.id -def test_get_subcloud_list(real_stx_aio_client, real_stx_dc_client): - # dcClientImp = StxClientImp(real_stx_dc_client) - dcClientImp = StxClientImp( - stx_client=real_stx_aio_client, dc_client=real_stx_dc_client) - sa = dcClientImp.getSubcloudList() - assert len(sa) == 0 +def test_get_device_list(real_stx_aio_client): + stxClientImp = StxClientImp(real_stx_aio_client) + assert stxClientImp is not None + hostlist = stxClientImp.getPserverList() + assert len(hostlist) > 0 + + devicelist = stxClientImp.getDeviceList(hostid=hostlist[0].id) + assert len(devicelist) > 0 + dev1 = devicelist[0] + dev2 = stxClientImp.getDevice(dev1.id) + assert dev1 != dev2 + assert dev1.id == dev2.id + + +def test_get_res_pool_list(real_stx_aio_client, real_stx_dc_client): + stxClientImp = StxClientImp(real_stx_aio_client, real_stx_dc_client) + assert stxClientImp is not None + reslist = stxClientImp.getResourcePoolList() + assert reslist is not None + assert len(reslist) > 0 + res1 = reslist[0] + res2 = stxClientImp.getResourcePoolDetail(res1.id) + assert res1 != res2 + assert res1.name == res2.name + assert res1.id == res2.id + + if len(reslist) > 1: + res3 = reslist[1] + res4 = stxClientImp.getResourcePoolDetail(res3.id) + assert res3 != res4 + assert res3.name == res4.name + assert res3.id == res4.id