Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
barry cho
Rancher
Commits
55803e84
Commit
55803e84
authored
4 years ago
by
Jiaqi Luo
Committed by
Sangeetha Hariharan
4 years ago
Browse files
Options
Download
Email Patches
Plain Diff
add an environment variable to control whether run tests for RBAC v2 or not
parent
217656d1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/validation/tests/v3_api/common.py
+5
-0
tests/validation/tests/v3_api/common.py
tests/validation/tests/v3_api/test_rbac_2.py
+3
-1
tests/validation/tests/v3_api/test_rbac_2.py
with
8 additions
and
1 deletion
+8
-1
tests/validation/tests/v3_api/common.py
+
5
-
0
View file @
55803e84
...
...
@@ -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"
...
...
This diff is collapsed.
Click to expand it.
tests/validation/tests/v3_api/test_rbac_2.py
+
3
-
1
View file @
55803e84
...
...
@@ -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
)
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment