Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.libnetworkcache
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Douglas
slapos.libnetworkcache
Commits
ed1b70fe
Commit
ed1b70fe
authored
Dec 14, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Proof that certificates allow to select given content.
parent
5e167391
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
slapos/libnetworkcachetests.py
slapos/libnetworkcachetests.py
+21
-0
No files found.
slapos/libnetworkcachetests.py
View file @
ed1b70fe
...
...
@@ -436,6 +436,27 @@ class OnlineTest(OnlineMixin, unittest.TestCase):
result
=
signed_nc
.
select
(
key
)
self
.
assertEqual
(
result
.
read
(),
self
.
test_string
)
def
test_select_signed_content_multiple
(
self
):
key
=
'somekey'
+
str
(
random
.
random
())
urlmd5
=
str
(
random
.
random
())
file_name
=
'my file'
test_data
=
tempfile
.
TemporaryFile
()
test_string
=
str
(
random
.
random
())
test_data
.
write
(
test_string
)
test_data
.
seek
(
0
)
key_file
=
tempfile
.
NamedTemporaryFile
()
key_file
.
write
(
self
.
key
)
key_file
.
flush
()
key_file
.
seek
(
0
)
signed_nc
=
slapos
.
libnetworkcache
.
NetworkcacheClient
(
self
.
shacache
,
self
.
shadir
,
key_file
.
name
,
[
self
.
certificate
])
signed_nc
.
upload
(
self
.
test_data
,
key
,
urlmd5
=
urlmd5
,
file_name
=
file_name
)
signed_nc
.
upload
(
self
.
test_data
,
key
,
urlmd5
=
urlmd5
,
file_name
=
file_name
)
result
=
signed_nc
.
select
(
key
)
self
.
assertEqual
(
result
.
read
(),
self
.
test_string
)
def
test_upload_signed_content_openssl_not_available
(
self
):
key
=
'somekey'
+
str
(
random
.
random
())
urlmd5
=
str
(
random
.
random
())
...
...
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