Skip to content

Commit

Permalink
Add debug function for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
dkirov-dd committed Jan 30, 2025
1 parent f2fe62e commit 4f9cb31
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/fips-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ jobs:
- name: Run tests
run: |
pytest -vv .github/workflows/fips/tests
pytest -s -vv .github/workflows/fips/tests
9 changes: 9 additions & 0 deletions .github/workflows/fips/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,12 @@ def parse_json(payload):
return parsed_json


def debug():
env_vars = [
"GOFIPS",
"OPENSSL_CONF",
"OPENSSL_MODULES",
]
for var in env_vars:
print(f"{var}: {os.getenv(var)}")

4 changes: 3 additions & 1 deletion .github/workflows/fips/tests/test_connections.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import json
import subprocess

from conftest import AGENT_FIPS_MODE, parse_json
Expand All @@ -18,4 +17,7 @@ def test_connections():
parsed_json = parse_json(result.stdout)
expected_json = FIPS_AGENT if AGENT_FIPS_MODE else REGULAR_AGENT

from conftest import debug
debug()

assert parsed_json == expected_json
5 changes: 4 additions & 1 deletion .github/workflows/fips/tests/test_libraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@


def test_libraries():
result = subprocess.run(["docker", "exec", "-e", "OPENSSL_CONF=/opt/datadog-agent/embedded/ssl/openssl.cnf", "-e", "OPENSSL_MODULES=/opt/datadog-agent/embedded/lib/ossl-modules", "compose-agent-1", "agent", "check", "libraries", "--json"], check=True, capture_output=True)
result = subprocess.run(["docker", "exec", "compose-agent-1", "agent", "check", "libraries", "--json"], check=True, capture_output=True)
parsed_json = parse_json(result.stdout)
expected_json = FIPS_AGENT if AGENT_FIPS_MODE else REGULAR_AGENT

from conftest import debug
debug()

assert parsed_json == expected_json

0 comments on commit 4f9cb31

Please sign in to comment.