Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
slapos.core
Commits
763cfe57
Commit
763cfe57
authored
Apr 03, 2023
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_jio: update test_Base_getComputeNodeToken to new API
parent
0aa6334a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
6 deletions
+23
-6
master/bt5/slapos_jio/TestTemplateItem/portal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
...ortal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
+23
-6
No files found.
master/bt5/slapos_jio/TestTemplateItem/portal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
View file @
763cfe57
...
...
@@ -1029,18 +1029,35 @@ class TestBase_getComputeNodeToken(TestSlapOSHalJsonStyleMixin):
self
.
login
(
person
.
getUserId
())
token_dict
=
json
.
loads
(
base
.
Base_getComputeNodeToken
())
self
.
assertSameSet
(
token_dict
.
keys
(),
[
'access_token'
,
'command_line'
,
'slapos_master_web'
,
'slapos_master_api'
])
self
.
assertSameSet
(
token_dict
.
keys
(),
[
'compute_node_id'
,
'certificate_url_access'
,
'initialisation_comand'
,
'$schema'
,
'access_token'
,
'command_line'
,
'slapos_master_api'
,
'slapos_master_web'
,
]
)
self
.
assertEqual
(
token_dict
[
'initialisation_comand'
],
"wget https://deploy.erp5.net/slapos ; bash slapos"
)
self
.
assertEqual
(
token_dict
[
'command_line'
],
"wget https://deploy.erp5.net/slapos ; bash slapos"
)
self
.
assertIn
(
"%s-"
%
(
DateTime
().
strftime
(
"%Y%m%d"
))
,
token_dict
[
'
access_token
'
])
self
.
assertIn
(
"%s-"
%
(
DateTime
().
strftime
(
"%Y%m%d"
))
,
token_dict
[
'
certificate_url_access
'
])
self
.
assertEqual
(
token_dict
[
'slapos_master_api'
],
"https://slap.vifib.com"
)
self
.
assertEqual
(
token_dict
[
'slapos_master_web'
],
slapos_master_web_url
)
compute_node
=
self
.
portal
.
compute_node_module
.
restrictedTraverse
(
token_dict
[
"access_token"
].
split
(
"/"
)[
-
2
].
encode
())
self
.
assertEqual
(
token_dict
[
'compute_node_id'
],
compute_node
.
getReference
())
self
.
assertTrue
(
token_dict
[
'$schema'
].
endswith
(
"portal_types/Compute%20Node/getTextContent"
))
self
.
login
()
token
=
self
.
portal
.
access_token_module
[
token_dict
[
"access_token"
]]
token
=
self
.
portal
.
access_token_module
[
token_dict
[
"access_token"
]
.
split
(
"/"
)[
-
1
]
]
self
.
assertIn
(
"/Person_requestComputer"
,
token
.
getUrlString
())
self
.
assertIn
(
"%s/ComputeNode_approveComputer"
%
compute_node
.
getRelativeUrl
(),
token
.
getUrlString
()
)
self
.
assertEqual
(
token
.
getAgentValue
(),
person
)
self
.
assertEqual
(
"One Time Restricted Access Token"
,
token
.
getPortalType
())
...
...
Write
Preview
Markdown
is supported
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