-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4b08a12
commit b9d7fdb
Showing
6 changed files
with
42 additions
and
27 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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
cert | ||
output | ||
cert/ | ||
token.sh | ||
|
@@ -9,3 +8,4 @@ example.manifest.json | |
.idea | ||
dist | ||
foobar.json | ||
tests/__pycache__/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
CERT_NAME="$SCRIPT_DIR/oci-sign" | ||
|
||
|
||
openssl req -x509 -newkey rsa -pkeyopt rsa_keygen_bits:4096 -days 3650 -nodes -keyout $CERT_NAME.key -out $CERT_NAME.crt -subj "/CN=Garden Linux test signing key for oci" | ||
|
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,5 @@ | ||
from .helper import call_command | ||
|
||
def pytest_sessionstart(session): | ||
call_command("./cert/gencert.sh") | ||
|
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,20 @@ | ||
import subprocess | ||
import shlex | ||
|
||
def spawn_background_process(command): | ||
process = subprocess.Popen(command) | ||
return process | ||
|
||
|
||
def call_command(cmd): | ||
try: | ||
args = shlex.split(cmd) | ||
result = subprocess.run( | ||
args, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE | ||
) | ||
output = result.stdout.decode("utf-8") | ||
return output | ||
|
||
except subprocess.CalledProcessError as e: | ||
error_message = e.stderr.decode("utf-8") | ||
return f"An error occurred: {error_message}" |
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