Пример #1
0
    def is_expected_version(self):
        """
        Return True if the version is as expected, otherwise assert.
        :return: True if the version is as expected.
        """
        idm_cfg = IDMConfig()

        logger.info("Get software version of the OpenIDM instance")
        headers = idm_cfg.get_admin_headers(
            {'Content-Type': 'application/json'})
        response = get(verify=idm_cfg.ssl_verify,
                       url=idm_cfg.idm_url + '/info/version',
                       headers=headers)
        rest.check_http_status(http_result=response, expected_status=200)

        logger.info('Check IDM version information')
        assert response.json()['productVersion'] == self.manifest['version'], 'Expected IDM version %s, but found %s' \
                                                                              % (self.manifest['version'],
                                                                                 response.json()['productVersion'])
        assert response.json()['productRevision'] == self.manifest['revision'], \
            'Expected IDM build revision %s, but found %s' % (self.manifest['revision'],
                                                              response.json()['productRevision'])
        assert response.json()['productBuildDate'] == self.manifest['date'], 'Expected IDM build date %s, but found %s' \
                                                                             % (self.manifest['date'],
                                                                                response.json()['productBuildDate'])
        return True
Пример #2
0
def get_idm_version_info():
    idm_cfg = IDMConfig()

    logger.info("Get software version of the OpenIDM instance")
    headers = idm_cfg.get_admin_headers({'Content-Type': 'application/json'})
    response = get(verify=idm_cfg.ssl_verify, url=idm_cfg.idm_url + '/info/version', headers=headers)
    rest.check_http_status(http_result=response, expected_status=200)
    version_info = "{} (build: {}, revision: {})".format(response.json()['productVersion'],
                                                         response.json()['productBuildDate'],
                                                         response.json()['productRevision'])
    return version_info
Пример #3
0
    def version(self):
        """
        Return the product version information.
        :return: Dictionary
        """
        idm_cfg = IDMConfig()

        logger.info("Get software version of the OpenIDM instance")
        headers = idm_cfg.get_admin_headers({'Content-Type': 'application/json'})
        response = get(verify=idm_cfg.ssl_verify, url=idm_cfg.idm_url + '/info/version', headers=headers)
        rest.check_http_status(http_result=response, expected_status=200)

        return {'TITLE': self.product_type,
                'DESCRIPTION': self.name,
                'VERSION': response.json()['productVersion'],
                'REVISION': response.json()['productRevision'],
                'DATE': response.json()['productBuildDate']}