Skip to content

Commit

Permalink
Added testing code for https server
Browse files Browse the repository at this point in the history
  • Loading branch information
m-blaha committed Apr 26, 2019
1 parent 0d7bfd0 commit b0bb1a0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions dnf-behave-tests/features/steps/fixtures/httpd.py
Expand Up @@ -95,3 +95,21 @@ def shutdown(self):
"""
for _, process in self.servers.values():
process.terminate()


if __name__ == '__main__':
import os
ctx = HttpServerContext()
certpath = '../../../fixtures/certificates/testcerts'
cacert = os.path.realpath(os.path.join(certpath, 'ca/cert.pem'))
host, port = ctx.new_https_server(
'../../../fixtures/repos/',
cacert,
os.path.realpath(os.path.join(certpath, 'server/cert.pem')),
os.path.realpath(os.path.join(certpath, 'server/key.pem')),
False)
curl = 'curl --cacert {} https://{}:{}/'.format(cacert, host, port)
#curl = 'wget --ca-certificate {} https://{}:{}/'.format(cacert, host, port)
print(curl)
print(os.system(curl))
ctx.shutdown()

0 comments on commit b0bb1a0

Please sign in to comment.