-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: move certificate discovery to a separate module
- Loading branch information
1 parent
318b114
commit b167df0
Showing
3 changed files
with
20 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import os | ||
|
||
|
||
def get_ssl_certificate(name): | ||
root = os.path.join(os.path.dirname(__file__), "..") | ||
cert_dir = os.path.abspath(os.path.join(root, "docker", "stunnel", "keys")) | ||
if not os.path.isdir(cert_dir): # github actions package validation case | ||
cert_dir = os.path.abspath( | ||
os.path.join(root, "..", "docker", "stunnel", "keys") | ||
) | ||
if not os.path.isdir(cert_dir): | ||
raise IOError(f"No SSL certificates found. They should be in {cert_dir}") | ||
|
||
return os.path.join(cert_dir, name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters