Skip to content

Commit

Permalink
scripts updated
Browse files Browse the repository at this point in the history
  • Loading branch information
biplamal committed Jan 30, 2024
1 parent 227221c commit 4f75e71
Show file tree
Hide file tree
Showing 15 changed files with 595 additions and 156 deletions.
543 changes: 542 additions & 1 deletion tests/out.log

Large diffs are not rendered by default.

62 changes: 0 additions & 62 deletions tests/py/default/test_b2b_default_config.py

This file was deleted.

9 changes: 4 additions & 5 deletions tests/py/default/test_liveness_custom_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import utils
import time


@pytest.mark.sanity
def test_liveness_custom_config():
"""
Deploy b2b kne topology with default version,
Expand All @@ -13,11 +13,11 @@ def test_liveness_custom_config():
- custom liveness parameters for protocol engines
"""
namespace1 = 'ixia-c'
namespace1_config = 'ixia_c_default_config.txt'
namespace1_config = 'ixia_c_pd_topology.yaml'
expected_pods = [
'otg-controller',
'otg-port-eth1',
'otg-port-eth2'
'arista1'
]
container_extensions = [
'-protocol-engine',
Expand All @@ -36,8 +36,6 @@ def test_liveness_custom_config():
utils.check_liveness_data('gnmi', expected_pods[0], namespace1, False)
utils.check_liveness_data(expected_pods[1]+container_extensions[0], expected_pods[1], namespace1, True, 12, 10, 6)
utils.check_liveness_data(expected_pods[1]+container_extensions[1], expected_pods[1], namespace1, True, 1, 5, 6)
utils.check_liveness_data(expected_pods[2]+container_extensions[0], expected_pods[2], namespace1, True, 12, 10, 6)
utils.check_liveness_data(expected_pods[2]+container_extensions[1], expected_pods[2], namespace1, True, 1, 5, 6)
op_rscount = utils.ixia_c_operator_ok(op_rscount)

print("[Namespace:{}]Deleting KNE topology".format(
Expand All @@ -46,6 +44,7 @@ def test_liveness_custom_config():
utils.delete_kne_config(namespace1_config, namespace1)
utils.ixia_c_pods_ok(namespace1, [])
op_rscount = utils.ixia_c_operator_ok(op_rscount)
utils.reset_configmap()

finally:
utils.delete_kne_config(namespace1_config, namespace1)
Expand Down
15 changes: 5 additions & 10 deletions tests/py/default/test_liveness_default_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import utils
import time


@pytest.mark.sanity
def test_liveness_default_config():
"""
Deploy b2b kne topology with default version,
Expand All @@ -14,22 +14,20 @@ def test_liveness_default_config():
- no flakiness for default deployment of all components
"""
namespace1 = 'ixia-c'
namespace1_config = 'ixia_c_default_config.txt'
namespace1_config = 'ixia_c_pd_topology.yaml'
expected_pods = [
'otg-controller',
'otg-port-eth1',
'otg-port-eth2'
'arista1'
]
container_extensions = [
'-protocol-engine',
'-traffic-engine'
]
lic_path = 'docker-local-athena.artifactory.it.keysight.com/keng-license-server'
lic_tag = '0.0.1-32'
count = 30
count = 3
try:
op_rscount = utils.get_operator_restart_count()
utils.load_license_configmap("", lic_path, lic_tag)

for iter in range(count):
print("Iteration: {}".format(iter))
print("[Namespace:{}]Deploying KNE topology".format(
Expand All @@ -42,8 +40,6 @@ def test_liveness_default_config():
utils.check_liveness_data('license-server', expected_pods[0], namespace1, True, 1, 10, 6)
utils.check_liveness_data(expected_pods[1]+container_extensions[0], expected_pods[1], namespace1, True, 1, 10, 6)
utils.check_liveness_data(expected_pods[1]+container_extensions[1], expected_pods[1], namespace1, True, 1, 10, 6)
utils.check_liveness_data(expected_pods[2]+container_extensions[0], expected_pods[2], namespace1, True, 1, 10, 6)
utils.check_liveness_data(expected_pods[2]+container_extensions[1], expected_pods[2], namespace1, True, 1, 10, 6)
op_rscount = utils.ixia_c_operator_ok(op_rscount)

print("[Namespace:{}]Deleting KNE topology".format(
Expand All @@ -59,7 +55,6 @@ def test_liveness_default_config():
op_rscount = utils.ixia_c_operator_ok(op_rscount)

finally:
utils.reset_configmap()
utils.delete_kne_config(namespace1_config, namespace1)
utils.ixia_c_pods_ok(namespace1, [])

Expand Down
8 changes: 4 additions & 4 deletions tests/py/default/test_liveness_disabled_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import utils
import time


@pytest.mark.sanity
def test_liveness_disabled_config():
"""
Deploy b2b kne topology with default version,
Expand All @@ -13,11 +13,11 @@ def test_liveness_disabled_config():
- disabled liveness parameters for protocol engines
"""
namespace1 = 'ixia-c'
namespace1_config = 'ixia_c_default_config.txt'
namespace1_config = 'ixia_c_pd_topology.yaml'
expected_pods = [
'otg-controller',
'otg-port-eth1',
'otg-port-eth2'
'arista1'
]
container_extension = '-traffic-engine'
probe_params = {'traffic-engine':{'liveness-enable': False}}
Expand All @@ -30,7 +30,6 @@ def test_liveness_disabled_config():
utils.create_kne_config(namespace1_config, namespace1)
utils.ixia_c_pods_ok(namespace1, expected_pods)
utils.check_liveness_data(expected_pods[1]+container_extension, expected_pods[1], namespace1, False)
utils.check_liveness_data(expected_pods[2]+container_extension, expected_pods[2], namespace1, False)
op_rscount = utils.ixia_c_operator_ok(op_rscount)

print("[Namespace:{}]Deleting KNE topology".format(
Expand All @@ -39,6 +38,7 @@ def test_liveness_disabled_config():
utils.delete_kne_config(namespace1_config, namespace1)
utils.ixia_c_pods_ok(namespace1, [])
op_rscount = utils.ixia_c_operator_ok(op_rscount)
utils.reset_configmap()

finally:
utils.delete_kne_config(namespace1_config, namespace1)
Expand Down
9 changes: 4 additions & 5 deletions tests/py/default/test_min_resource_custom_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import utils
import time


@pytest.mark.sanity
def test_min_resource_custom_config():
"""
Deploy b2b kne topology with default version,
Expand All @@ -13,11 +13,11 @@ def test_min_resource_custom_config():
- default minimum resource for all components
"""
namespace1 = 'ixia-c'
namespace1_config = 'ixia_c_default_config.txt'
namespace1_config = 'ixia_c_pd_topology.yaml'
expected_pods = [
'otg-controller',
'otg-port-eth1',
'otg-port-eth2'
'arista1'
]
container_extensions = [
'-protocol-engine',
Expand All @@ -36,8 +36,6 @@ def test_min_resource_custom_config():
utils.check_min_resource_data('gnmi', expected_pods[0], namespace1, '90Mi', '70m')
utils.check_min_resource_data(expected_pods[1]+container_extensions[0], expected_pods[1], namespace1, '50Mi', '300m')
utils.check_min_resource_data(expected_pods[1]+container_extensions[1], expected_pods[1], namespace1, '170Mi', '50m')
utils.check_min_resource_data(expected_pods[2]+container_extensions[0], expected_pods[2], namespace1, '50Mi', '300m')
utils.check_min_resource_data(expected_pods[2]+container_extensions[1], expected_pods[2], namespace1, '170Mi', '50m')
op_rscount = utils.ixia_c_operator_ok(op_rscount)

print("[Namespace:{}]Deleting KNE topology".format(
Expand All @@ -46,6 +44,7 @@ def test_min_resource_custom_config():
utils.delete_kne_config(namespace1_config, namespace1)
utils.ixia_c_pods_ok(namespace1, [])
op_rscount = utils.ixia_c_operator_ok(op_rscount)
utils.reset_configmap()

finally:
utils.delete_kne_config(namespace1_config, namespace1)
Expand Down
8 changes: 3 additions & 5 deletions tests/py/default/test_min_resource_default_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import utils
import time


@pytest.mark.sanity
def test_min_resource_default_config():
"""
Deploy b2b kne topology with default version,
Expand All @@ -13,11 +13,11 @@ def test_min_resource_default_config():
- default minimum resource for all components
"""
namespace1 = 'ixia-c'
namespace1_config = 'ixia_c_default_config.txt'
namespace1_config = 'ixia_c_pd_topology.yaml'
expected_pods = [
'otg-controller',
'otg-port-eth1',
'otg-port-eth2'
'arista1'
]
container_extensions = [
'-protocol-engine',
Expand All @@ -34,8 +34,6 @@ def test_min_resource_default_config():
utils.check_min_resource_data('gnmi', expected_pods[0], namespace1, '15Mi', '10m')
utils.check_min_resource_data(expected_pods[1]+container_extensions[0], expected_pods[1], namespace1, '350Mi', '200m')
utils.check_min_resource_data(expected_pods[1]+container_extensions[1], expected_pods[1], namespace1, '60Mi', '200m')
utils.check_min_resource_data(expected_pods[2]+container_extensions[0], expected_pods[2], namespace1, '350Mi', '200m')
utils.check_min_resource_data(expected_pods[2]+container_extensions[1], expected_pods[2], namespace1, '60Mi', '200m')
op_rscount = utils.ixia_c_operator_ok(op_rscount)

print("[Namespace:{}]Deleting KNE topology".format(
Expand Down
2 changes: 1 addition & 1 deletion tests/py/lag/test_lag_min_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import utils
import time


@pytest.mark.sanity
def test_lag_min_resource():
"""
Deploy lag kne topology,
Expand Down
2 changes: 1 addition & 1 deletion tests/py/lag/test_lag_single_namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pytest
from deepdiff import DeepDiff


@pytest.mark.sanity
def test_lag_single_namespace():
"""
Deploy lag kne topology,
Expand Down
2 changes: 1 addition & 1 deletion tests/py/lag/test_two_lag_single_namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pytest
from deepdiff import DeepDiff


@pytest.mark.sanity
def test_two_lag_single_namespace():
"""
Deploy two lag kne topology,
Expand Down
11 changes: 4 additions & 7 deletions tests/py/mislaneous/test_args_cmd_env_override.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
import utils


@pytest.mark.sanity
def test_args_cmd_env_override():
"""
Deploy b2b kne topology with default version, but custom args, cmd and env
Expand All @@ -14,19 +14,18 @@ def test_args_cmd_env_override():
- individual pod description
"""
namespace1 = 'ixia-c'
namespace1_config = 'b2b_ixia_c_namespace.txt'
namespace1_config = 'ixia_c_pd_topology.yaml'
expected_svcs = [
'service-https-otg-controller',
'service-gnmi-otg-controller',
'service-grpc-otg-controller',
'service-otg-port-eth1',
'service-otg-port-eth2'
'service-arista1',
]

expected_pods = [
'otg-controller',
'otg-port-eth1',
'otg-port-eth2'
'arista1'
]
try:
op_rscount = utils.get_operator_restart_count()
Expand All @@ -48,9 +47,7 @@ def test_args_cmd_env_override():
utils.ixia_c_services_ok(namespace1, [])
op_rscount = utils.ixia_c_operator_ok(op_rscount)
utils.reset_configmap()
return
finally:
print("Done")
utils.delete_kne_config(namespace1_config, namespace1)
utils.ixia_c_pods_ok(namespace1, [])
utils.ixia_c_services_ok(namespace1, [])
Expand Down
8 changes: 4 additions & 4 deletions tests/py/mislaneous/test_init_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import utils
import time


@pytest.mark.sanity
def test_init_container():
"""
Deploy neg-vm kne topology,
Expand All @@ -14,11 +14,11 @@ def test_init_container():
- operator pod health
"""
namespace1 = 'ixia-c'
namespace1_config = 'b2b_ixia_c_namespace.txt'
namespace1_config = 'ixia_c_pd_topology.yaml'
expected_pods = [
'otg-controller',
'otg-port-eth1',
'otg-port-eth2'
'arista1'
]
try:
op_rscount = utils.get_operator_restart_count()
Expand All @@ -36,7 +36,7 @@ def test_init_container():
utils.delete_kne_config(namespace1_config, namespace1)
utils.ixia_c_pods_ok(namespace1, [])
op_rscount = utils.ixia_c_operator_ok(op_rscount)

utils.reset_configmap()
finally:
utils.delete_kne_config(namespace1_config, namespace1)
utils.ixia_c_pods_ok(namespace1, [])
Expand Down
9 changes: 4 additions & 5 deletions tests/py/performance/test_create_delete_ixia_c_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import utils
import time


@pytest.mark.sanity
def test_create_delete_ixia_c_performance():
"""
Deploy one arm kne topology,
Expand All @@ -20,19 +20,18 @@ def test_create_delete_ixia_c_performance():
- operator pod health
"""
namespace1 = 'ixia-c'
namespace1_config = 'b2b_ixia_c_namespace.txt'
namespace1_config = 'ixia_c_pd_topology.yaml'
expected_svcs = [
'service-http-otg-controller',
'service-gnmi-otg-controller',
'service-grpc-otg-controller',
'service-otg-port-eth1',
'service-otg-port-eth2'
'service-arista1'
]

expected_pods = [
'otg-controller',
'otg-port-eth1',
'otg-port-eth2'
'arista1'
]

ixia_c_pod_exp_creation_time = 25
Expand Down
Loading

0 comments on commit 4f75e71

Please sign in to comment.