Skip to content

Commit 5c4e7a4

Browse files
committed
Dynamically calculate password hash for TP v2 end-to-end tests
1 parent 4cecf8c commit 5c4e7a4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/tpv2.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,14 @@ jobs:
207207
- name: Install dependencies
208208
run: sudo apt-get update && sudo apt-get install postgresql-client gettext-base
209209
- name: Create admin user
210-
run: |
211-
psql -c "INSERT INTO tm_user (username, role, tenant_id, local_passwd) VALUES ('admin', 1, 1, 'SCRYPT:16384:8:1:p0Bppp/6IBeYxSwdLuYddsdMLBU/BNSlLY6fSIF7H1XW4eTbNVeMPVm7TuTEG4FM8PbqLlVwi8sPy8ZJznAlaQ==:sRcHWGe43mm/uEmXTIw37GcLEQZTlWAdf4vJqK8f0MDh8P+8gXoNx+nxWyb3r/0Bh+yyg0g/dUvti/ePZJL+Jw==');"
210+
run: |2
211+
to_admin_password=twelve
212+
password_hash="$(<<PYTHON_COMMANDS PYTHONPATH="${GITHUB_WORKSPACE}/traffic_ops/install/bin" python
213+
import _postinstall
214+
print(_postinstall.hash_pass('${to_admin_password}'))
215+
PYTHON_COMMANDS
216+
)"
217+
psql -c "INSERT INTO tm_user (username, role, tenant_id, local_passwd) VALUES ('admin', 1, 1, '${password_hash}');"
212218
- name: Create SSL Certificates and AES key
213219
run: |
214220
openssl rand 32 | base64 | tee "${GITHUB_WORKSPACE}/aes.key"

0 commit comments

Comments
 (0)