Commit 55803e84 authored by Jiaqi Luo's avatar Jiaqi Luo Committed by Sangeetha Hariharan
Browse files

add an environment variable to control whether run tests for RBAC v2 or not

parent 217656d1
Showing with 8 additions and 1 deletion
+8 -1
......@@ -198,6 +198,11 @@ RANCHER_HOSTNAME_PREFIX = os.environ.get("RANCHER_HOSTNAME_PREFIX",
test_run_id)
# -----------------------------------------------------------------------------
# this is used for testing rbac v2
test_rbac_v2 = os.environ.get("RANCHER_TEST_RBAC_V2", "False")
if_test_rbac_v2 = pytest.mark.skipif(test_rbac_v2 != "True",
reason='test for rbac v2 is skipped')
def is_windows(os_type=TEST_OS):
return os_type == "windows"
......
......@@ -5,6 +5,7 @@ from .common import DATA_SUBDIR
from .common import get_user_client_and_cluster
from .common import test_reader
from .common import validate_cluster_role_rbac
from .common import if_test_rbac_v2
@pytest.fixture(scope='module', autouse="True")
......@@ -13,9 +14,10 @@ def create_project_client():
create_kubeconfig(cluster)
@if_test_rbac_v2
@pytest.mark.parametrize("cluster_role, command, authorization, name",
test_reader(os.path.join(
DATA_SUBDIR,
'rbac/monitoring/monitoring_rbac.json')))
def test_monitoring_v2_rbac(cluster_role, command, authorization, name):
def test_monitoring_rbac_v2(cluster_role, command, authorization, name):
validate_cluster_role_rbac(cluster_role, command, authorization, name)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment