[CVP] Get drivetrain_version parameter from reclass
Related-PROD: PROD-21801
Change-Id: I628480b053e7b03c09c55d5b997e9dc74aa98c90
diff --git a/cvp-sanity/cvp_checks/tests/test_drivetrain.py b/cvp-sanity/cvp_checks/tests/test_drivetrain.py
index 20c90d1..3c486c0 100644
--- a/cvp-sanity/cvp_checks/tests/test_drivetrain.py
+++ b/cvp-sanity/cvp_checks/tests/test_drivetrain.py
@@ -258,9 +258,22 @@
def test_drivetrain_components_and_versions(local_salt_client):
config = utils.get_configuration()
- version = config['drivetrain_version'] or []
- if not version or version == '':
- pytest.skip("drivetrain_version is not defined. Skipping")
+ if not config['drivetrain_version']:
+ version = \
+ local_salt_client.cmd(
+ 'I@salt:master',
+ 'pillar.get',
+ ['_param:mcp_version'],
+ expr_form='compound').values()[0] or \
+ local_salt_client.cmd(
+ 'I@salt:master',
+ 'pillar.get',
+ ['_param:apt_mk_version'],
+ expr_form='compound').values()[0]
+ if not version:
+ pytest.skip("drivetrain_version is not defined. Skipping")
+ else:
+ version = config['drivetrain_version']
salt_output = local_salt_client.cmd(
'I@gerrit:client',
'cmd.run',