Use archiveArtifact() for Ping+IPerf

This commit is contained in:
Robert Schmidt
2025-08-05 09:41:31 +02:00
parent 62ae72925b
commit da9cec0bff
3 changed files with 33 additions and 49 deletions

View File

@@ -9,11 +9,13 @@ import os
os.system(f'rm -rf cmake_targets')
os.system(f'mkdir -p cmake_targets/log')
import unittest
import tempfile
sys.path.append('./') # to find OAI imports below
import cls_oai_html
from cls_ci_helper import TestCaseCtx
import cls_oaicitest
import cls_containerize
import cls_cmd
class TestPingIperf(unittest.TestCase):
def setUp(self):
@@ -22,7 +24,10 @@ class TestPingIperf(unittest.TestCase):
self.ci = cls_oaicitest.OaiCiTest()
self.ci.ue_ids = ["test"]
self.ci.nodes = ["localhost"]
self.cont = cls_containerize.Containerize()
self.ctx = TestCaseCtx.Default(tempfile.mkdtemp())
def tearDown(self):
with cls_cmd.LocalCmd() as c:
c.run(f'rm -rf {self.ctx.logPath}')
def test_ping(self):
self.ci.ping_args = "-c3"
@@ -30,7 +35,7 @@ class TestPingIperf(unittest.TestCase):
self.ci.svr_id = "test"
infra_file = "tests/config/infra_ping_iperf.yaml"
# TODO Should need nothing but options and UE(s) to use
success = self.ci.Ping(self.html, self.cont, infra_file=infra_file)
success = self.ci.Ping(self.ctx, self.html, infra_file=infra_file)
self.assertTrue(success)
def test_iperf(self):
@@ -45,7 +50,7 @@ class TestPingIperf(unittest.TestCase):
self.ci.iperf_profile = "balanced"
infra_file = "tests/config/infra_ping_iperf.yaml"
# TODO Should need nothing but options and UE(s) to use
success = self.ci.Iperf(self.html, self.cont, infra_file=infra_file)
success = self.ci.Iperf(self.ctx, self.html, infra_file=infra_file)
self.assertTrue(success)
def test_iperf2_unidir(self):
@@ -57,7 +62,7 @@ class TestPingIperf(unittest.TestCase):
self.ci.iperf_profile = "balanced"
infra_file = "tests/config/infra_ping_iperf.yaml"
# TODO Should need nothing but options and UE(s) to use
success = self.ci.Iperf2_Unidir(self.html, self.cont, infra_file=infra_file)
success = self.ci.Iperf2_Unidir(self.ctx, self.html, infra_file=infra_file)
self.assertTrue(success)
if __name__ == '__main__':