-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Add ModelMesh test for CVE-2024-7557 #1861
Open
rnetser
wants to merge
43
commits into
red-hat-data-services:master
Choose a base branch
from
rnetser:auth-multi-modes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 42 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
8ce98fd
Add tests
rnetser 73b24a5
add modelmesh tests
rnetser 98c215d
Merge branch 'master' of https://github.com/red-hat-data-services/ods…
rnetser 8bb6f88
Merge branch 'master' of https://github.com/red-hat-data-services/ods…
rnetser 3f83bc6
add modelmesh tests
rnetser a7121e4
Merge branch 'master' of https://github.com/red-hat-data-services/ods…
rnetser b82028d
add modelmesh tests
rnetser d5feec2
Merge branch 'master' of https://github.com/red-hat-data-services/ods…
rnetser 8000cbb
add modelmesh tests
rnetser 2c0720d
add modelmesh tests
rnetser 118abdd
add modelmesh tests
rnetser cdbb779
Merge branch 'master' of https://github.com/red-hat-data-services/ods…
rnetser f7d526c
add modelmesh tests
rnetser 4048abf
add modelmesh tests
rnetser 4409b52
Merge branch 'master' of https://github.com/red-hat-data-services/ods…
rnetser 1e8f59b
add modelmesh tests
rnetser 4c2a0fa
Merge branch 'master' of https://github.com/red-hat-data-services/ods…
rnetser 15c0e39
add modelmesh tests
rnetser 35fe0d1
add modelmesh tests
rnetser 62cb00e
add modelmesh tests
rnetser db2230e
Merge branch 'master' of https://github.com/red-hat-data-services/ods…
rnetser ccd8051
add modelmesh tests
rnetser a8d618a
add modelmesh tests
rnetser 09f70d0
Merge branch 'master' of https://github.com/red-hat-data-services/ods…
rnetser bcabc3c
resolve robocop comments
rnetser dba77d1
fix comments
rnetser aad7b58
fix comments
rnetser a3b1727
fix assign
rnetser ad89501
add runtime to token from ui
rnetser d7bfab1
add runtime to token from ui
rnetser d4a4a38
add runtime to token from ui
rnetser 08f2918
add runtime to token from ui
rnetser 7891842
add runtime to token from ui
rnetser 4f57e46
add runtime to token from ui
rnetser c3a830d
update paths in project
rnetser 001b8c8
Merge branch 'master' of https://github.com/red-hat-data-services/ods…
rnetser 2db9d62
address robocop comments
rnetser 5827368
fix ui
rnetser dfe44cb
Merge branch 'master' of https://github.com/red-hat-data-services/ods…
rnetser 846f459
fix ui
rnetser 78fe13f
update 2.13
rnetser 2cfb81d
update 2.13
rnetser 6d29aef
update 2.13
rnetser File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,9 +31,15 @@ | |
*** Keywords *** | ||
Create Model Server | ||
[Documentation] Keyword to create a Model Server in a Data Science Project | ||
[Arguments] ${no_replicas}=1 ${server_size}=Small ${ext_route}=${TRUE} | ||
... ${token}=${TRUE} ${runtime}=OpenVINO Model Server ${server_name}=Model Serving Test | ||
... ${no_gpus}=0 ${existing_server}=${FALSE} | ||
[Arguments] ${no_replicas}=1 | ||
... ${server_size}=Small | ||
... ${ext_route}=${TRUE} | ||
... ${token}=${TRUE} | ||
... ${runtime}=OpenVINO Model Server | ||
... ${server_name}=Model Serving Test | ||
... ${no_gpus}=0 | ||
... ${existing_server}=${FALSE} | ||
... ${service_account_name}=${NONE} | ||
Move To Tab Models | ||
IF ${existing_server} | ||
${existing_server}= Run Keyword And Return Status Wait Until Page Contains Element //button[.="${server_name}"] | ||
|
@@ -63,8 +69,9 @@ | |
Log message=Token Auth should be enabled by default..(from v2.5) | ||
SeleniumLibrary.Checkbox Should Be Selected ${TOKEN_AUTH_CHECKBOX_XP} | ||
END | ||
ELSE IF ${token}==${TRUE} | ||
Enable Token Authentication | ||
END | ||
IF ${token} | ||
Enable Token Authentication service_account_name=${service_account_name} | ||
END | ||
SeleniumLibrary.Wait Until Element Is Enabled //button[contains(text(),"Add")] | ||
SeleniumLibrary.Click Button Add | ||
|
@@ -181,9 +188,10 @@ | |
[Documentation] Enables Token authentication to serving route | ||
[Arguments] ${service_account_name}=${NONE} | ||
SeleniumLibrary.Select Checkbox ${TOKEN_AUTH_CHECKBOX_XP} | ||
IF "${service_account_name}" != "${NONE}" | ||
Input Service Account Name ${service_account_name} | ||
IF "${service_account_name}" == "${NONE}" | ||
${service_account_name}= Set Variable default-name | ||
END | ||
Input Service Account Name ${service_account_name} | ||
|
||
Disable Token Authentication | ||
[Documentation] Disable Token authentication to serving route | ||
|
@@ -211,14 +219,30 @@ | |
Get Model Serving Access Token via UI | ||
[Documentation] Returns the token used for authentication to the serving route | ||
... TODO: There can be multiple tokens defined for each model server, handle this case as well | ||
[Arguments] ${service_account_name}=default-name ${single_model}=${FALSE} ${model_name}=${NONE} | ||
[Arguments] ${service_account_name}=default-name ${single_model}=${FALSE} | ||
... ${model_name}=${NONE} ${multi_model_servers}=${FALSE} | ||
|
||
IF ${single_model} | ||
# Expand the model | ||
SeleniumLibrary.Click Button xpath: //a[text()='${model_name}']/parent::div/parent::td[@data-label='Name']/preceding-sibling::td/button # robocop: off=line-too-long | ||
${token}= Get Single Model Token ${service_account_name} | ||
ELSE | ||
SeleniumLibrary.Wait Until Page Contains Element xpath://td[@data-label="Tokens"]/button | ||
SeleniumLibrary.Click Element xpath://td[@data-label="Tokens"]/button | ||
# TODO: ModelMesh requires passing model server name and not model name; | ||
# in particular when there are multiple model servers | ||
# in the same project. | ||
# This is a temporary workaround until the issue is fixed. | ||
# With one model server, the model name is not required. | ||
IF ${multi_model_servers} | ||
SeleniumLibrary.Click Button | ||
... xpath://*[@id="expand-table-row-${model_name}-1-undefined-1"]/../../td[@data-label='Tokens']//button | ||
ELSE | ||
SeleniumLibrary.Click Element xpath://td[@data-label="Tokens"]/button | ||
END | ||
# TODO: service account name is required; remove from all places that pass `None` | ||
IF "${service_account_name}" == "${NONE}" | ||
${service_account_name}= Set Variable default-name | ||
END | ||
|
||
${token}= SeleniumLibrary.Get Element Attribute | ||
... xpath://div[.="${service_account_name} "]/../../td[@data-label="Token Secret"]//input value | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Xpath can be inproved There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mwaykole please advise how |
||
END | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check notice
Code scanning / Robocop
There is too many arguments per continuation line ({{ arguments_count }} / {{ max_arguments_count }}) Note test