Commit 7d2ccdb2 authored by Łukasz Nowak's avatar Łukasz Nowak

Prove that list of certificates work.

parent 81efb300
...@@ -538,6 +538,126 @@ Buildout can download the content using the new certificate, because it still av ...@@ -538,6 +538,126 @@ Buildout can download the content using the new certificate, because it still av
Downloading hello.txt from network cache. Downloading hello.txt from network cache.
download: Downloaded http://localhost/hello.txt download: Downloaded http://localhost/hello.txt
Lets clean networkcache:
>>> rmdir(nc_data)
>>> mkdir(nc_data)
Of course two certificates can be used in order to check downloaded content. This supports a case, when more then one key was used to sign content.
Lets create another file on remote server:
>>> write(remote_server_data, 'hello-signed.txt', 'Hello my signed friend')
Main certificate will be used to upload hello.txt:
>>> write(sample_buildout, 'buildout.cfg',
... '''
... [buildout]
...
... networkcache-section = networkcache
... develop = download
... parts = download
...
... [download]
... recipe = download
... url = %(remote_server_url)shello.txt
...
... [networkcache]
... download-cache-url = %(nc_url)sshacache
... download-dir-url = %(nc_url)sshadir
... upload-cache-url = %(nc_url)sshacache
... upload-dir-url = %(nc_url)sshadir
... signature-private-key-file = %(main_key_file)s
... ''' % globals())
>>> print system(buildout)
Networkcache enabled.
Networkcache download cache: 'http://localhost/shacache', directory 'http://localhost/shadir'
Networkcache upload cache: 'http://localhost/shacache', directory 'http://localhost/shadir'
Develop: '/sample-buildout/download'
Updating download.
Downloading http://localhost/hello.txt
Downloading hello.txt from network cache.
Failed to download from network cache hello.txt: ...404...
Uploading http://localhost/hello.txt into network cache.
download: Downloaded http://localhost/hello.txt
Additional certificate will be used to upload hello-signed.txt:
>>> write(sample_buildout, 'buildout.cfg',
... '''
... [buildout]
...
... networkcache-section = networkcache
... develop = download
... parts = download
...
... [download]
... recipe = download
... url = %(remote_server_url)shello-signed.txt
...
... [networkcache]
... download-cache-url = %(nc_url)sshacache
... download-dir-url = %(nc_url)sshadir
... upload-cache-url = %(nc_url)sshacache
... upload-dir-url = %(nc_url)sshadir
... signature-private-key-file = %(additional_key_file)s
... ''' % globals())
>>> print system(buildout)
Networkcache enabled.
Networkcache download cache: 'http://localhost/shacache', directory 'http://localhost/shadir'
Networkcache upload cache: 'http://localhost/shacache', directory 'http://localhost/shadir'
Develop: '/sample-buildout/download'
Uninstalling download.
Installing download.
Downloading http://localhost/hello-signed.txt
Downloading hello-signed.txt from network cache.
Failed to download from network cache hello-signed.txt: ...404...
Uploading http://localhost/hello-signed.txt into network cache.
download: Downloaded http://localhost/hello-signed.txt
And if both certificates are used, both files will be trusted:
>>> write(sample_buildout, 'buildout.cfg',
... '''
... [buildout]
...
... networkcache-section = networkcache
... develop = download
... parts = download download-signed
...
... [download]
... recipe = download
... url = %(remote_server_url)shello.txt
...
... [download-signed]
... recipe = download
... url = %(remote_server_url)shello-signed.txt
...
... [networkcache]
... download-cache-url = %(nc_url)sshacache
... download-dir-url = %(nc_url)sshadir
... upload-cache-url = %(nc_url)sshacache
... upload-dir-url = %(nc_url)sshadir
... signature-certificate-list =
... %(main_certificate)s
... %(additional_certificate)s
... ''' % globals())
>>> print system(buildout)
Networkcache enabled.
Networkcache download cache: 'http://localhost/shacache', directory 'http://localhost/shadir'
Networkcache upload cache: 'http://localhost/shacache', directory 'http://localhost/shadir'
Develop: '/sample-buildout/download'
Uninstalling download.
Installing download.
Downloading http://localhost/hello.txt
Downloading hello.txt from network cache.
download: Downloaded http://localhost/hello.txt
Installing download-signed.
Downloading http://localhost/hello-signed.txt
Downloading hello-signed.txt from network cache.
download-signed: Downloaded http://localhost/hello-signed.txt
Of course eggs are also supported by networkcache: Of course eggs are also supported by networkcache:
>>> write(sample_buildout, 'buildout.cfg', >>> write(sample_buildout, 'buildout.cfg',
...@@ -564,6 +684,7 @@ Of course eggs are also supported by networkcache: ...@@ -564,6 +684,7 @@ Of course eggs are also supported by networkcache:
Networkcache download cache: 'http://localhost/shacache', directory 'http://localhost/shadir' Networkcache download cache: 'http://localhost/shacache', directory 'http://localhost/shadir'
Networkcache upload cache: 'http://localhost/shacache', directory 'http://localhost/shadir' Networkcache upload cache: 'http://localhost/shacache', directory 'http://localhost/shadir'
Develop: '/sample-buildout/download' Develop: '/sample-buildout/download'
Uninstalling download-signed.
Uninstalling download. Uninstalling download.
Installing eggs. Installing eggs.
Getting distribution for 'demoneeded==1.2c1'. Getting distribution for 'demoneeded==1.2c1'.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment