Skip to content

Commit c7d5b5d

Browse files
committed
debug vault daemon in CI
1 parent ba8a0dd commit c7d5b5d

2 files changed

Lines changed: 28 additions & 5 deletions

File tree

.github/workflows/build_and_test.yaml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,17 @@ jobs:
1919
include:
2020
- python-version-short: "3.9"
2121
python-version: 3.9.21
22+
consul-version: "1.22.7-1"
2223
vault-version: "2.0.0-1"
2324
hvac-gh-tag: "v2.4.0"
2425
- python-version-short: "3.10"
2526
python-version: 3.10.16
27+
consul-version: "1.22.7-1"
2628
vault-version: "2.0.0-1"
2729
hvac-gh-tag: "v2.4.0"
2830
- python-version-short: "3.11"
2931
python-version: 3.11.11
32+
consul-version: "1.22.7-1"
3033
vault-version: "2.0.0-1"
3134
hvac-gh-tag: "v2.4.0"
3235
steps:
@@ -68,13 +71,31 @@ jobs:
6871
-o APT::Get::List-Cleanup="0" \
6972
-o Dir::Etc::sourcelist="sources.list.d/hashicorp.list"
7073
71-
sudo apt install consul vault=${{ matrix.vault-version }}
74+
sudo apt install consul=${{ matrix.consul-version }} vault=${{ matrix.vault-version }}
7275
7376
# We disble cap_ipc_lock here as its generally incompatabile with GitHub
7477
# Actions' runtime environments.
7578
sudo setcap cap_ipc_lock= /usr/bin/vault
76-
sudo systemctl restart consul vault
77-
sudo systemctl status consul vault
79+
80+
# Consul needs to be explicitly configured to start in the CI/CD environment.
81+
sudo mkdir -p /srv/consul && sudo chown -R consul:consul /srv/consul
82+
sudo tee /etc/consul.d/consul.hcl >/dev/null <<EOF
83+
enable_debug = false
84+
datacenter = "cicd"
85+
data_dir = "/srv/consul"
86+
ui_config{
87+
enabled = false
88+
}
89+
server = true
90+
bind_addr = "127.0.0.1"
91+
client_addr = "127.0.0.1"
92+
advertise_addr = "127.0.0.1"
93+
retry_join = ["localhost"]
94+
bootstrap_expect = 0
95+
encrypt = "katpv2wgyY5Za8bGAHh7+URaeLJWh4g+gK0GBjmvQXA="
96+
EOF
97+
sudo systemctl restart consul
98+
sudo systemctl restart vault
7899
79100
- name: Setup hvac symlinks
80101
shell: bash

tests/vault_action_tests_base.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from st2tests.base import BaseActionTestCase
22

3-
from tests.utils import get_config_file_path
3+
# #from tests.utils import get_config_file_path
44
from tests.utils.hvac_integration_test_case import HvacIntegrationTestCase
55

66

@@ -59,7 +59,9 @@ def tearDown(self):
5959

6060
def build_dummy_pack_config(self, url="https://localhost:8200"):
6161
# based on create_client() in hvac/tests/utils/__init__.py
62-
server_cert_path = get_config_file_path("server-cert.pem")
62+
# CI/CD only has a self-signed cert.
63+
# #server_cert_path = get_config_file_path("server-cert.pem")
64+
server_cert_path = False
6365

6466
token_result = self.client.auth.token.create(ttl=self.default_token_lease)
6567
token = token_result["auth"]["client_token"]

0 commit comments

Comments
 (0)