X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=tests%2Fintegration-ocloud%2Ftest_clientdriver_stx_sa.py;h=7ece56b9a6e823e03205c41acfde06890354304a;hb=84867b76a65efc4e9add52c86eae7e451c4a038d;hp=551a4c58e3aa87d8582f1bd686f9c9dfb4b6b9f2;hpb=23735ebe8b295ea1c77730896cd61a89536b13b6;p=pti%2Fo2.git diff --git a/tests/integration-ocloud/test_clientdriver_stx_sa.py b/tests/integration-ocloud/test_clientdriver_stx_sa.py index 551a4c5..7ece56b 100644 --- a/tests/integration-ocloud/test_clientdriver_stx_sa.py +++ b/tests/integration-ocloud/test_clientdriver_stx_sa.py @@ -14,10 +14,8 @@ import sys import pytest -from o2ims.adapter import ocloud_repository as repository -from o2ims.domain import ocloud -from o2ims import config -import uuid + +from o2common.config import config from o2ims.adapter.clients.ocloud_sa_client import StxSaClientImp from cgtsclient.client import get_client @@ -62,3 +60,28 @@ def test_get_pserver(real_stx_aio_client): host2 = stxSaClientImp.getPserver(host1.id) assert host1 != host2 assert host1.id == host2.id + +def test_get_k8s_list(real_stx_aio_client): + stxSaClientImp = StxSaClientImp(real_stx_aio_client) + assert stxSaClientImp is not None + k8slist = stxSaClientImp.getK8sList() + assert k8slist is not None + assert len(k8slist) > 0 + k8s1 = k8slist[0] + k8s2 = stxSaClientImp.getK8sDetail(k8s1.name) + assert k8s1 != k8s2 + assert k8s1.name == k8s2.name + assert k8s1.id == k8s2.id + +def test_get_cpu_list(real_stx_aio_client): + stxSaClientImp = StxSaClientImp(real_stx_aio_client) + assert stxSaClientImp is not None + hostlist = stxSaClientImp.getPserverList() + assert len(hostlist) > 0 + + cpulist = stxSaClientImp.getCpuList(hostid=hostlist[0].id) + assert len(cpulist) > 0 + cpu1 = cpulist[0] + cpu2 = stxSaClientImp.getCpu(cpu1.id) + assert cpu1 != cpu2 + assert cpu1.id == cpu2.id