コード例 #1
0
 def test_detect_jboss_fuse_present(self):
     """Test the detect_jboss_fuse method."""
     source = {
         'server_id': self.server_id,
         'source_name': 'source1',
         'source_type': 'network'
     }
     facts = {
         'eap_home_bin': {
             'opt/fuse/': ['jboss-fuse.jar']
         },
         'jboss_activemq_ver': ['redhat-630187']
     }
     product = detect_jboss_fuse(source, facts)
     expected = {
         'name': 'JBoss Fuse',
         'presence': 'present',
         'version': ['Fuse-6.3.0'],
         'metadata': {
             'server_id': self.server_id,
             'source_name': 'source1',
             'source_type': 'network',
             'raw_fact_key': 'eap_home_bin/jboss_activemq_ver'
         }
     }
     self.assertEqual(product, expected)
コード例 #2
0
 def test_detect_fuse_present(self):
     """Test the detect_jboss_fuse method."""
     source = {'source_id': 1, 'source_type': 'network'}
     facts = {
         'eap_home_bin': {
             'opt/fuse/': ['jboss-fuse.jar']
         },
         'fuse_camel_version': ['redhat-630187'],
         'jboss_fuse_on_eap_activemq_ver': [{
             'homedir': '/foo/bin',
             'version': ['redhat-630187']
         }],
         'jboss_cxf_ver': ['redhat-630187']
     }
     product = detect_jboss_fuse(source, facts)
     expected = {
         'name': 'JBoss Fuse',
         'presence': 'present',
         'version': ['Fuse-6.3.0'],
         'metadata': {
             'source_id':
             1,
             'source_name':
             None,
             'source_type':
             'network',
             'raw_fact_key':
             'eap_home_bin/fuse_camel_version/'
             'jboss_cxf_ver/'
             'jboss_fuse_on_eap_activemq_ver'
         }
     }
     self.assertEqual(product, expected)
コード例 #3
0
 def test_detect_activemq_fuse_absent(self):
     """Test the detect_jboss_fuse method with activemq version found."""
     source = {
         'server_id': self.server_id,
         'source_name': 'source1',
         'source_type': 'network'
     }
     facts = {
         'jboss_fuse_on_eap_activemq_ver': [{
             'homedir': '/foo/bin',
             'version': ['redhat-630187']
         }]
     }
     product = detect_jboss_fuse(source, facts)
     expected = {
         'name': 'JBoss Fuse',
         'presence': 'absent',
         'metadata': {
             'server_id': self.server_id,
             'source_name': 'source1',
             'source_type': 'network',
             'raw_fact_key': None
         }
     }
     self.assertEqual(product, expected)
コード例 #4
0
def add_products_to_fingerprint(source, raw_fact, fingerprint):
    """Create the fingerprint products with fact and metadata.

    :param source: Source used to gather raw facts.
    :param raw_fact: Raw fact used used to obtain value
    :param fingerprint: dict containing all fingerprint facts
    this fact.
    """
    eap = detect_jboss_eap(source, raw_fact)
    fuse = detect_jboss_fuse(source, raw_fact)
    brms = detect_jboss_brms(source, raw_fact)
    fingerprint['products'] = [eap, fuse, brms]
コード例 #5
0
 def test_detect_jboss_fuse_absent(self):
     """Test the detect_jboss_fuse method."""
     source = {'source_id': 1, 'source_type': 'satellite'}
     facts = {'entitlements': [{'name': 'Satellite Sub'}]}
     product = detect_jboss_fuse(source, facts)
     expected = {'name': 'JBoss Fuse',
                 'presence': 'absent',
                 'metadata': {
                     'source_id': 1,
                     'source_name': None,
                     'source_type': 'satellite',
                     'raw_fact_key': None}}
     self.assertEqual(product, expected)
コード例 #6
0
 def test_detect_jboss_fuse_potential_sub(self):
     """Test the detect_jboss_fuse method."""
     source = {'source_id': 1, 'source_type': 'network'}
     facts = {'subman_consumed': [{'name': 'JBoss Fuse Sub'}]}
     product = detect_jboss_fuse(source, facts)
     expected = {'name': 'JBoss Fuse',
                 'presence': 'potential',
                 'metadata': {
                     'source_id': 1,
                     'source_name': None,
                     'source_type': 'network',
                     'raw_fact_key': 'subman_consumed'}}
     self.assertEqual(product, expected)
コード例 #7
0
 def test_detect_jboss_fuse_potential_init(self):
     """Test the detect_jboss_fuse method."""
     source = {'source_id': 1, 'source_type': 'network'}
     facts = {'jboss_fuse_systemctl_unit_files': ['jboss_fuse_init']}
     product = detect_jboss_fuse(source, facts)
     expected = {'name': 'JBoss Fuse',
                 'presence': 'potential',
                 'metadata': {
                     'source_id': 1,
                     'source_name': None,
                     'source_type': 'network',
                     'raw_fact_key': 'jboss_fuse_systemctl_unit_files'}}
     self.assertEqual(product, expected)
コード例 #8
0
 def test_detect_jboss_fuse_potential_ent(self):
     """Test the detect_jboss_fuse method."""
     source = {'server_id': self.server_id,
               'source_name': 'source1', 'source_type': 'satellite'}
     facts = {'entitlements': [{'name': 'JBoss Fuse Sub'}]}
     product = detect_jboss_fuse(source, facts)
     expected = {'name': 'JBoss Fuse',
                 'presence': 'potential',
                 'metadata': {
                     'server_id': self.server_id,
                     'source_name': 'source1',
                     'source_type': 'satellite',
                     'raw_fact_key': 'entitlements'}}
     self.assertEqual(product, expected)