Skip to content

Commit

Permalink
Adapt gencert parameters according to XCP-ng version
Browse files Browse the repository at this point in the history
- A new param has been added: `cert_gid` between 8.2 and 8.3
See: xapi-project/xen-api@c59ac16

Signed-off-by: BenjiReis <[email protected]>
  • Loading branch information
benjamreis committed Sep 28, 2023
1 parent 0d076de commit 5b6ff9f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/xapi/tls_verification/test_tls_verification.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import logging
import pytest

from packaging import version

from lib.commands import SSHCommandFailed

# Requirements:
Expand Down Expand Up @@ -69,7 +71,12 @@ def test_break_cert(self, hostA1, hostA2_with_saved_cert):
hostA2 = hostA2_with_saved_cert
logging.info(f"Replace the certificate on host {hostA2}")
hostA2.ssh(['rm', XAPI_POOL_PEM_FILEPATH])
hostA2.ssh(['/opt/xensource/libexec/gencert', XAPI_POOL_PEM_FILEPATH, 'xapi:pool'])
gencert_cmd = []
if hostA2.xcp_version >= version.parse("8.3"):
gencert_cmd = ['/opt/xensource/libexec/gencert', XAPI_POOL_PEM_FILEPATH, '-1', 'xapi:pool']
else:
gencert_cmd = ['/opt/xensource/libexec/gencert', XAPI_POOL_PEM_FILEPATH, 'xapi:pool']
hostA2.ssh(gencert_cmd)
hostA2.ssh(['systemctl', 'reload-or-restart stunnel@xapi'])
# Restart toolstack on client host to clear any existing TLS connection
hostA1.restart_toolstack(True)
Expand Down

0 comments on commit 5b6ff9f

Please sign in to comment.