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
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Rafael Monnerat
slapos.core
Commits
3723acdd
Commit
3723acdd
authored
Nov 14, 2023
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: Change for certificate authority (source_reference to csr_id)
parent
791d1f9b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
38 deletions
+37
-38
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudComputeNodeSlapInterfaceWorkflow.py
...t.erp5.testSlapOSCloudComputeNodeSlapInterfaceWorkflow.py
+29
-29
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudInstanceSlapInterfaceWorkflow.py
...test.erp5.testSlapOSCloudInstanceSlapInterfaceWorkflow.py
+5
-6
master/bt5/slapos_jio/TestTemplateItem/portal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
...ortal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
+3
-3
No files found.
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudComputeNodeSlapInterfaceWorkflow.py
View file @
3723acdd
...
@@ -61,7 +61,7 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
...
@@ -61,7 +61,7 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
certificate_login
=
certificate_login_list
[
0
]
certificate_login
=
certificate_login_list
[
0
]
self
.
assertEqual
(
certificate_login
.
getValidationState
(),
'validated'
)
self
.
assertEqual
(
certificate_login
.
getValidationState
(),
'validated'
)
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
get
SourceReference
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
get
CsrId
(),
None
)
ssl_certificate
=
x509
.
load_pem_x509_certificate
(
compute_node_certificate
)
ssl_certificate
=
x509
.
load_pem_x509_certificate
(
compute_node_certificate
)
self
.
assertEqual
(
len
(
ssl_certificate
.
subject
),
2
)
self
.
assertEqual
(
len
(
ssl_certificate
.
subject
),
2
)
...
@@ -69,7 +69,7 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
...
@@ -69,7 +69,7 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
self
.
assertEqual
(
certificate_login
.
getReference
().
decode
(
"UTF-8"
),
cn
)
self
.
assertEqual
(
certificate_login
.
getReference
().
decode
(
"UTF-8"
),
cn
)
# TODO: Should we check for csr_id
# TODO: Should we check for csr_id
#self.assertTrue(certificate_login.get
SourceReference
() in compute_node_certificate)
#self.assertTrue(certificate_login.get
CsrId
() in compute_node_certificate)
def
test_generateCertificate_twice
(
self
):
def
test_generateCertificate_twice
(
self
):
self
.
login
(
self
.
compute_node
.
getUserId
())
self
.
login
(
self
.
compute_node
.
getUserId
())
...
@@ -85,7 +85,7 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
...
@@ -85,7 +85,7 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
certificate_login
=
certificate_login_list
[
0
]
certificate_login
=
certificate_login_list
[
0
]
self
.
assertEqual
(
certificate_login
.
getValidationState
(),
'validated'
)
self
.
assertEqual
(
certificate_login
.
getValidationState
(),
'validated'
)
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
get
SourceReference
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
get
CsrId
(),
None
)
ssl_certificate
=
x509
.
load_pem_x509_certificate
(
compute_node_certificate
)
ssl_certificate
=
x509
.
load_pem_x509_certificate
(
compute_node_certificate
)
self
.
assertEqual
(
len
(
ssl_certificate
.
subject
),
2
)
self
.
assertEqual
(
len
(
ssl_certificate
.
subject
),
2
)
...
@@ -93,7 +93,7 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
...
@@ -93,7 +93,7 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
self
.
assertEqual
(
certificate_login
.
getReference
().
decode
(
"UTF-8"
),
cn
)
self
.
assertEqual
(
certificate_login
.
getReference
().
decode
(
"UTF-8"
),
cn
)
# TODO: Should we check for csr_id
# TODO: Should we check for csr_id
#self.assertTrue(certificate_login.get
SourceReference
() in compute_node_certificate)
#self.assertTrue(certificate_login.get
CsrId
() in compute_node_certificate)
self
.
assertRaises
(
ValueError
,
self
.
compute_node
.
generateCertificate
)
self
.
assertRaises
(
ValueError
,
self
.
compute_node
.
generateCertificate
)
self
.
assertEqual
(
None
,
self
.
portal
.
REQUEST
.
get
(
'compute_node_key'
))
self
.
assertEqual
(
None
,
self
.
portal
.
REQUEST
.
get
(
'compute_node_key'
))
...
@@ -283,7 +283,7 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
...
@@ -283,7 +283,7 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
certificate_login
=
certificate_login_list
[
0
]
certificate_login
=
certificate_login_list
[
0
]
self
.
assertEqual
(
certificate_login
.
getValidationState
(),
'validated'
)
self
.
assertEqual
(
certificate_login
.
getValidationState
(),
'validated'
)
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
get
SourceReference
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
get
CsrId
(),
None
)
ssl_certificate
=
x509
.
load_pem_x509_certificate
(
compute_node_certificate
)
ssl_certificate
=
x509
.
load_pem_x509_certificate
(
compute_node_certificate
)
self
.
assertEqual
(
len
(
ssl_certificate
.
subject
),
2
)
self
.
assertEqual
(
len
(
ssl_certificate
.
subject
),
2
)
...
@@ -291,7 +291,7 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
...
@@ -291,7 +291,7 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
self
.
assertEqual
(
certificate_login
.
getReference
().
decode
(
"UTF-8"
),
cn
)
self
.
assertEqual
(
certificate_login
.
getReference
().
decode
(
"UTF-8"
),
cn
)
# TODO: Should we check for csr_id
# TODO: Should we check for csr_id
#self.assertTrue(certificate_login.get
SourceReference
() in compute_node_certificate)
#self.assertTrue(certificate_login.get
CsrId
() in compute_node_certificate)
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
self
.
compute_node
.
getReference
())
self
.
compute_node
.
getReference
())
...
@@ -323,7 +323,7 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
...
@@ -323,7 +323,7 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
certificate_login
=
certificate_login_list
[
0
]
certificate_login
=
certificate_login_list
[
0
]
self
.
assertEqual
(
certificate_login
.
getValidationState
(),
'validated'
)
self
.
assertEqual
(
certificate_login
.
getValidationState
(),
'validated'
)
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
get
SourceReference
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
get
CsrId
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
self
.
compute_node
.
getReference
())
self
.
compute_node
.
getReference
())
...
@@ -333,7 +333,7 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
...
@@ -333,7 +333,7 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
self
.
assertEqual
(
certificate_login
.
getReference
().
decode
(
"UTF-8"
),
cn
)
self
.
assertEqual
(
certificate_login
.
getReference
().
decode
(
"UTF-8"
),
cn
)
# TODO: Should we check for csr_id
# TODO: Should we check for csr_id
#self.assertTrue(certificate_login.get
SourceReference
() in compute_node_certificate)
#self.assertTrue(certificate_login.get
CsrId
() in compute_node_certificate)
self
.
compute_node
.
revokeCertificate
()
self
.
compute_node
.
revokeCertificate
()
self
.
assertEqual
(
None
,
self
.
portal
.
REQUEST
.
get
(
'compute_node_key'
))
self
.
assertEqual
(
None
,
self
.
portal
.
REQUEST
.
get
(
'compute_node_key'
))
...
@@ -359,11 +359,11 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
...
@@ -359,11 +359,11 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
certificate_login_list
=
self
.
compute_node
.
objectValues
(
portal_type
=
"Certificate Login"
)
certificate_login_list
=
self
.
compute_node
.
objectValues
(
portal_type
=
"Certificate Login"
)
self
.
assertEqual
(
len
(
certificate_login_list
),
1
)
self
.
assertEqual
(
len
(
certificate_login_list
),
1
)
certificate_login
=
certificate_login_list
[
0
]
certificate_login
=
certificate_login_list
[
0
]
source_reference
=
certificate_login
.
get
SourceReference
()
source_reference
=
certificate_login
.
get
CsrId
()
self
.
assertEqual
(
certificate_login
.
getValidationState
(),
'validated'
)
self
.
assertEqual
(
certificate_login
.
getValidationState
(),
'validated'
)
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
get
SourceReference
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
get
CsrId
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
self
.
compute_node
.
getReference
())
self
.
compute_node
.
getReference
())
...
@@ -373,7 +373,7 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
...
@@ -373,7 +373,7 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
self
.
assertEqual
(
certificate_login
.
getReference
().
decode
(
"UTF-8"
),
cn
)
self
.
assertEqual
(
certificate_login
.
getReference
().
decode
(
"UTF-8"
),
cn
)
# TODO: Should we check for csr_id
# TODO: Should we check for csr_id
#self.assertTrue(certificate_login.get
SourceReference
() in compute_node_certificate)
#self.assertTrue(certificate_login.get
CsrId
() in compute_node_certificate)
self
.
assertNotEqual
(
None
,
source_reference
)
self
.
assertNotEqual
(
None
,
source_reference
)
self
.
compute_node
.
revokeCertificate
()
self
.
compute_node
.
revokeCertificate
()
...
@@ -385,7 +385,7 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
...
@@ -385,7 +385,7 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
self
.
assertNotEqual
(
compute_node_certificate
,
self
.
portal
.
REQUEST
.
get
(
'compute_node_certificate'
))
self
.
assertNotEqual
(
compute_node_certificate
,
self
.
portal
.
REQUEST
.
get
(
'compute_node_certificate'
))
self
.
assertEqual
(
certificate_login
.
getValidationState
(),
'invalidated'
)
self
.
assertEqual
(
certificate_login
.
getValidationState
(),
'invalidated'
)
self
.
assertEqual
(
certificate_login
.
get
SourceReference
(),
source_reference
)
self
.
assertEqual
(
certificate_login
.
get
CsrId
(),
source_reference
)
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
None
)
certificate_login_list
=
self
.
compute_node
.
objectValues
(
portal_type
=
"Certificate Login"
)
certificate_login_list
=
self
.
compute_node
.
objectValues
(
portal_type
=
"Certificate Login"
)
...
@@ -393,15 +393,15 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
...
@@ -393,15 +393,15 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
new_certificate_login
=
[
i
for
i
in
certificate_login_list
\
new_certificate_login
=
[
i
for
i
in
certificate_login_list
\
if
i
.
getId
()
!=
certificate_login
.
getId
()][
0
]
if
i
.
getId
()
!=
certificate_login
.
getId
()][
0
]
source_reference
=
certificate_login
.
get
SourceReference
()
source_reference
=
certificate_login
.
get
CsrId
()
self
.
assertEqual
(
new_certificate_login
.
getValidationState
(),
'validated'
)
self
.
assertEqual
(
new_certificate_login
.
getValidationState
(),
'validated'
)
self
.
assertNotEqual
(
new_certificate_login
.
getReference
(),
None
)
self
.
assertNotEqual
(
new_certificate_login
.
getReference
(),
None
)
self
.
assertNotEqual
(
new_certificate_login
.
getReference
(),
self
.
assertNotEqual
(
new_certificate_login
.
getReference
(),
certificate_login
.
getReference
())
certificate_login
.
getReference
())
self
.
assertNotEqual
(
new_certificate_login
.
get
SourceReference
(),
None
)
self
.
assertNotEqual
(
new_certificate_login
.
get
CsrId
(),
None
)
self
.
assertNotEqual
(
new_certificate_login
.
get
SourceReference
(),
self
.
assertNotEqual
(
new_certificate_login
.
get
CsrId
(),
certificate_login
.
get
SourceReference
())
certificate_login
.
get
CsrId
())
compute_node_certificate
=
self
.
portal
.
REQUEST
.
get
(
'compute_node_certificate'
)
compute_node_certificate
=
self
.
portal
.
REQUEST
.
get
(
'compute_node_certificate'
)
ssl_certificate
=
x509
.
load_pem_x509_certificate
(
compute_node_certificate
)
ssl_certificate
=
x509
.
load_pem_x509_certificate
(
compute_node_certificate
)
...
@@ -411,7 +411,7 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
...
@@ -411,7 +411,7 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
self
.
assertNotEqual
(
certificate_login
.
getReference
().
decode
(
"UTF-8"
),
cn
)
self
.
assertNotEqual
(
certificate_login
.
getReference
().
decode
(
"UTF-8"
),
cn
)
# TODO: Should we check for csr_id
# TODO: Should we check for csr_id
#self.assertIn(certificate_login.get
SourceReference
(), compute_node_certificate)
#self.assertIn(certificate_login.get
CsrId
(), compute_node_certificate)
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
self
.
compute_node
.
getReference
())
self
.
compute_node
.
getReference
())
...
@@ -427,11 +427,11 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
...
@@ -427,11 +427,11 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
certificate_login_list
=
self
.
compute_node
.
objectValues
(
portal_type
=
"Certificate Login"
)
certificate_login_list
=
self
.
compute_node
.
objectValues
(
portal_type
=
"Certificate Login"
)
self
.
assertEqual
(
len
(
certificate_login_list
),
1
)
self
.
assertEqual
(
len
(
certificate_login_list
),
1
)
certificate_login
=
certificate_login_list
[
0
]
certificate_login
=
certificate_login_list
[
0
]
source_reference
=
certificate_login
.
get
SourceReference
()
source_reference
=
certificate_login
.
get
CsrId
()
self
.
assertEqual
(
certificate_login
.
getValidationState
(),
'validated'
)
self
.
assertEqual
(
certificate_login
.
getValidationState
(),
'validated'
)
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
get
SourceReference
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
get
CsrId
(),
None
)
ssl_certificate
=
x509
.
load_pem_x509_certificate
(
compute_node_certificate
)
ssl_certificate
=
x509
.
load_pem_x509_certificate
(
compute_node_certificate
)
self
.
assertEqual
(
len
(
ssl_certificate
.
subject
),
2
)
self
.
assertEqual
(
len
(
ssl_certificate
.
subject
),
2
)
...
@@ -450,7 +450,7 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
...
@@ -450,7 +450,7 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
self
.
assertNotEqual
(
compute_node_certificate
,
self
.
portal
.
REQUEST
.
get
(
'compute_node_certificate'
))
self
.
assertNotEqual
(
compute_node_certificate
,
self
.
portal
.
REQUEST
.
get
(
'compute_node_certificate'
))
self
.
assertEqual
(
certificate_login
.
getValidationState
(),
'invalidated'
)
self
.
assertEqual
(
certificate_login
.
getValidationState
(),
'invalidated'
)
self
.
assertEqual
(
certificate_login
.
get
SourceReference
(),
source_reference
)
self
.
assertEqual
(
certificate_login
.
get
CsrId
(),
source_reference
)
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
None
)
certificate_login_list
=
self
.
compute_node
.
objectValues
(
portal_type
=
"Certificate Login"
)
certificate_login_list
=
self
.
compute_node
.
objectValues
(
portal_type
=
"Certificate Login"
)
...
@@ -458,15 +458,15 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
...
@@ -458,15 +458,15 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
new_certificate_login
=
[
i
for
i
in
certificate_login_list
\
new_certificate_login
=
[
i
for
i
in
certificate_login_list
\
if
i
.
getId
()
!=
certificate_login
.
getId
()][
0
]
if
i
.
getId
()
!=
certificate_login
.
getId
()][
0
]
source_reference
=
certificate_login
.
get
SourceReference
()
source_reference
=
certificate_login
.
get
CsrId
()
self
.
assertEqual
(
new_certificate_login
.
getValidationState
(),
'validated'
)
self
.
assertEqual
(
new_certificate_login
.
getValidationState
(),
'validated'
)
self
.
assertNotEqual
(
new_certificate_login
.
getReference
(),
None
)
self
.
assertNotEqual
(
new_certificate_login
.
getReference
(),
None
)
self
.
assertNotEqual
(
new_certificate_login
.
getReference
(),
self
.
assertNotEqual
(
new_certificate_login
.
getReference
(),
certificate_login
.
getReference
())
certificate_login
.
getReference
())
self
.
assertNotEqual
(
new_certificate_login
.
get
SourceReference
(),
None
)
self
.
assertNotEqual
(
new_certificate_login
.
get
CsrId
(),
None
)
self
.
assertNotEqual
(
new_certificate_login
.
get
SourceReference
(),
self
.
assertNotEqual
(
new_certificate_login
.
get
CsrId
(),
certificate_login
.
get
SourceReference
())
certificate_login
.
get
CsrId
())
compute_node_certificate
=
self
.
portal
.
REQUEST
.
get
(
'compute_node_certificate'
)
compute_node_certificate
=
self
.
portal
.
REQUEST
.
get
(
'compute_node_certificate'
)
ssl_certificate
=
x509
.
load_pem_x509_certificate
(
compute_node_certificate
)
ssl_certificate
=
x509
.
load_pem_x509_certificate
(
compute_node_certificate
)
...
@@ -486,7 +486,7 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
...
@@ -486,7 +486,7 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
self
.
assertNotEqual
(
compute_node_certificate
,
self
.
portal
.
REQUEST
.
get
(
'compute_node_certificate'
))
self
.
assertNotEqual
(
compute_node_certificate
,
self
.
portal
.
REQUEST
.
get
(
'compute_node_certificate'
))
self
.
assertEqual
(
new_certificate_login
.
getValidationState
(),
'invalidated'
)
self
.
assertEqual
(
new_certificate_login
.
getValidationState
(),
'invalidated'
)
self
.
assertNotEqual
(
new_certificate_login
.
get
SourceReference
(),
source_reference
)
self
.
assertNotEqual
(
new_certificate_login
.
get
CsrId
(),
source_reference
)
self
.
assertNotEqual
(
new_certificate_login
.
getReference
(),
None
)
self
.
assertNotEqual
(
new_certificate_login
.
getReference
(),
None
)
certificate_login_list
=
self
.
compute_node
.
objectValues
(
portal_type
=
"Certificate Login"
)
certificate_login_list
=
self
.
compute_node
.
objectValues
(
portal_type
=
"Certificate Login"
)
...
@@ -495,15 +495,15 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
...
@@ -495,15 +495,15 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
third_certificate_login
=
[
i
for
i
in
certificate_login_list
\
third_certificate_login
=
[
i
for
i
in
certificate_login_list
\
if
i
.
getId
()
not
in
[
certificate_login
.
getId
(),
new_certificate_login
.
getId
()]][
0
]
if
i
.
getId
()
not
in
[
certificate_login
.
getId
(),
new_certificate_login
.
getId
()]][
0
]
source_reference
=
new_certificate_login
.
get
SourceReference
()
source_reference
=
new_certificate_login
.
get
CsrId
()
self
.
assertEqual
(
third_certificate_login
.
getValidationState
(),
'validated'
)
self
.
assertEqual
(
third_certificate_login
.
getValidationState
(),
'validated'
)
self
.
assertNotEqual
(
third_certificate_login
.
getReference
(),
None
)
self
.
assertNotEqual
(
third_certificate_login
.
getReference
(),
None
)
self
.
assertNotEqual
(
third_certificate_login
.
getReference
(),
self
.
assertNotEqual
(
third_certificate_login
.
getReference
(),
certificate_login
.
getReference
())
certificate_login
.
getReference
())
self
.
assertNotEqual
(
third_certificate_login
.
get
SourceReference
(),
None
)
self
.
assertNotEqual
(
third_certificate_login
.
get
CsrId
(),
None
)
self
.
assertNotEqual
(
third_certificate_login
.
get
SourceReference
(),
self
.
assertNotEqual
(
third_certificate_login
.
get
CsrId
(),
new_certificate_login
.
get
SourceReference
())
new_certificate_login
.
get
CsrId
())
compute_node_certificate
=
self
.
portal
.
REQUEST
.
get
(
'compute_node_certificate'
)
compute_node_certificate
=
self
.
portal
.
REQUEST
.
get
(
'compute_node_certificate'
)
...
...
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudInstanceSlapInterfaceWorkflow.py
View file @
3723acdd
...
@@ -1339,8 +1339,7 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin):
...
@@ -1339,8 +1339,7 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin):
self
.
assertEqual
(
certificate_login
.
getValidationState
(),
'validated'
)
self
.
assertEqual
(
certificate_login
.
getValidationState
(),
'validated'
)
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
getCsrId
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
getSourceReference
(),
None
)
ssl_certificate
=
x509
.
load_pem_x509_certificate
(
self
.
software_instance
.
getSslCertificate
())
ssl_certificate
=
x509
.
load_pem_x509_certificate
(
self
.
software_instance
.
getSslCertificate
())
self
.
assertEqual
(
len
(
ssl_certificate
.
subject
),
2
)
self
.
assertEqual
(
len
(
ssl_certificate
.
subject
),
2
)
cn
=
[
i
.
value
for
i
in
ssl_certificate
.
subject
if
i
.
oid
==
NameOID
.
COMMON_NAME
][
0
]
cn
=
[
i
.
value
for
i
in
ssl_certificate
.
subject
if
i
.
oid
==
NameOID
.
COMMON_NAME
][
0
]
...
@@ -1373,7 +1372,7 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin):
...
@@ -1373,7 +1372,7 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin):
certificate_login
=
certificate_login_list
[
0
]
certificate_login
=
certificate_login_list
[
0
]
self
.
assertEqual
(
certificate_login
.
getValidationState
(),
'validated'
)
self
.
assertEqual
(
certificate_login
.
getValidationState
(),
'validated'
)
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
get
SourceReference
(),
None
)
self
.
assertNotEqual
(
certificate_login
.
get
CsrId
(),
None
)
self
.
assertNotEqual
(
self
.
software_instance
.
getSslKey
(),
self
.
assertNotEqual
(
self
.
software_instance
.
getSslKey
(),
ssl_key
)
ssl_key
)
...
@@ -1400,11 +1399,11 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin):
...
@@ -1400,11 +1399,11 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin):
self
.
assertEqual
(
another_certificate_login
.
getValidationState
(),
'validated'
)
self
.
assertEqual
(
another_certificate_login
.
getValidationState
(),
'validated'
)
self
.
assertNotEqual
(
another_certificate_login
.
getReference
(),
None
)
self
.
assertNotEqual
(
another_certificate_login
.
getReference
(),
None
)
self
.
assertNotEqual
(
another_certificate_login
.
get
SourceReference
(),
None
)
self
.
assertNotEqual
(
another_certificate_login
.
get
CsrId
(),
None
)
self
.
assertEqual
(
certificate_login
.
getValidationState
(),
'invalidated'
)
self
.
assertEqual
(
certificate_login
.
getValidationState
(),
'invalidated'
)
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
self
.
assertNotEqual
(
certificate_login
.
getReference
(),
another_certificate_login
.
getReference
())
another_certificate_login
.
getReference
())
self
.
assertNotEqual
(
certificate_login
.
get
SourceReference
(),
self
.
assertNotEqual
(
certificate_login
.
get
CsrId
(),
another_certificate_login
.
get
SourceReference
())
another_certificate_login
.
get
CsrId
())
master/bt5/slapos_jio/TestTemplateItem/portal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
View file @
3723acdd
...
@@ -618,7 +618,7 @@ class TestPerson_get_Certificate(TestSlapOSHalJsonStyleMixin):
...
@@ -618,7 +618,7 @@ class TestPerson_get_Certificate(TestSlapOSHalJsonStyleMixin):
self
.
assertSameSet
(
response_dict
.
keys
(),
[
"common_name"
,
"certificate"
,
"id"
,
"key"
])
self
.
assertSameSet
(
response_dict
.
keys
(),
[
"common_name"
,
"certificate"
,
"id"
,
"key"
])
self
.
assertEqual
(
response_dict
[
"id"
],
login
.
get
SourceReference
())
self
.
assertEqual
(
response_dict
[
"id"
],
login
.
get
CsrId
())
self
.
assertEqual
(
json
.
dumps
(
response_dict
[
"common_name"
]),
json
.
dumps
(
login
.
getReference
()))
self
.
assertEqual
(
json
.
dumps
(
response_dict
[
"common_name"
]),
json
.
dumps
(
login
.
getReference
()))
self
.
assertEqual
(
self
.
portal
.
REQUEST
.
RESPONSE
.
getStatus
(),
200
)
self
.
assertEqual
(
self
.
portal
.
REQUEST
.
RESPONSE
.
getStatus
(),
200
)
...
@@ -632,11 +632,11 @@ class TestPerson_get_Certificate(TestSlapOSHalJsonStyleMixin):
...
@@ -632,11 +632,11 @@ class TestPerson_get_Certificate(TestSlapOSHalJsonStyleMixin):
self
.
assertEqual
(
"validated"
,
login
.
getValidationState
())
self
.
assertEqual
(
"validated"
,
login
.
getValidationState
())
self
.
assertEqual
(
"validated"
,
new_login
.
getValidationState
())
self
.
assertEqual
(
"validated"
,
new_login
.
getValidationState
())
self
.
assertNotEqual
(
login
.
getReference
(),
new_login
.
getReference
())
self
.
assertNotEqual
(
login
.
getReference
(),
new_login
.
getReference
())
self
.
assertNotEqual
(
login
.
get
SourceReference
(),
new_login
.
getSourceReference
())
self
.
assertNotEqual
(
login
.
get
CsrId
(),
new_login
.
getCsrId
())
self
.
assertSameSet
(
new_response_dict
.
keys
(),
[
"common_name"
,
"certificate"
,
"id"
,
"key"
])
self
.
assertSameSet
(
new_response_dict
.
keys
(),
[
"common_name"
,
"certificate"
,
"id"
,
"key"
])
self
.
assertEqual
(
json
.
dumps
(
new_response_dict
[
"common_name"
]),
json
.
dumps
(
new_login
.
getReference
()))
self
.
assertEqual
(
json
.
dumps
(
new_response_dict
[
"common_name"
]),
json
.
dumps
(
new_login
.
getReference
()))
self
.
assertEqual
(
new_response_dict
[
"id"
],
new_login
.
get
SourceReference
())
self
.
assertEqual
(
new_response_dict
[
"id"
],
new_login
.
get
CsrId
())
self
.
assertNotEqual
(
new_response_dict
[
"common_name"
],
response_dict
[
"common_name"
])
self
.
assertNotEqual
(
new_response_dict
[
"common_name"
],
response_dict
[
"common_name"
])
self
.
assertNotEqual
(
new_response_dict
[
"id"
],
response_dict
[
"id"
])
self
.
assertNotEqual
(
new_response_dict
[
"id"
],
response_dict
[
"id"
])
...
...
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