mirror of https://github.com/MISP/PyMISP
chg: [tests] Remove travis exceptions.
parent
55c2bff26b
commit
1ec7ec37d9
|
@ -33,13 +33,11 @@ except ImportError:
|
||||||
try:
|
try:
|
||||||
from keys import url, key
|
from keys import url, key
|
||||||
verifycert = False
|
verifycert = False
|
||||||
travis_run = True
|
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
print(e)
|
print(e)
|
||||||
url = 'https://localhost:8443'
|
url = 'https://localhost:8443'
|
||||||
key = 'K5yV0CcxdnklzDfCKlnPniIxrMX41utQ2dG13zZ3'
|
key = 'K5yV0CcxdnklzDfCKlnPniIxrMX41utQ2dG13zZ3'
|
||||||
verifycert = False
|
verifycert = False
|
||||||
travis_run = False
|
|
||||||
|
|
||||||
|
|
||||||
urllib3.disable_warnings()
|
urllib3.disable_warnings()
|
||||||
|
@ -479,8 +477,6 @@ class TestComprehensive(unittest.TestCase):
|
||||||
|
|
||||||
def test_default_distribution(self):
|
def test_default_distribution(self):
|
||||||
'''The default distributions on the VM are This community only for the events and Inherit from event for attr/obj)'''
|
'''The default distributions on the VM are This community only for the events and Inherit from event for attr/obj)'''
|
||||||
if travis_run:
|
|
||||||
return
|
|
||||||
first = self.create_simple_event()
|
first = self.create_simple_event()
|
||||||
del first.distribution
|
del first.distribution
|
||||||
o = first.add_object(name='file')
|
o = first.add_object(name='file')
|
||||||
|
@ -670,8 +666,6 @@ class TestComprehensive(unittest.TestCase):
|
||||||
self.assertEqual(events[0].id, second.id)
|
self.assertEqual(events[0].id, second.id)
|
||||||
self.assertEqual(len(events[0].attributes), 5)
|
self.assertEqual(len(events[0].attributes), 5)
|
||||||
|
|
||||||
if not travis_run:
|
|
||||||
# FIXME: This is failing on travis for no discernable reason...
|
|
||||||
events = self.user_misp_connector.search(eventid=second.id, enforce_warninglist=True, pythonify=True)
|
events = self.user_misp_connector.search(eventid=second.id, enforce_warninglist=True, pythonify=True)
|
||||||
self.assertEqual(len(events), 1)
|
self.assertEqual(len(events), 1)
|
||||||
self.assertEqual(events[0].id, second.id)
|
self.assertEqual(events[0].id, second.id)
|
||||||
|
@ -893,7 +887,6 @@ class TestComprehensive(unittest.TestCase):
|
||||||
first.add_attribute('ip-src', '8.8.8.8')
|
first.add_attribute('ip-src', '8.8.8.8')
|
||||||
try:
|
try:
|
||||||
first = self.user_misp_connector.add_event(first)
|
first = self.user_misp_connector.add_event(first)
|
||||||
if not travis_run:
|
|
||||||
stix = self.user_misp_connector.search(return_format='stix', eventid=first.id)
|
stix = self.user_misp_connector.search(return_format='stix', eventid=first.id)
|
||||||
found = re.findall('8.8.8.8', stix)
|
found = re.findall('8.8.8.8', stix)
|
||||||
self.assertTrue(found)
|
self.assertTrue(found)
|
||||||
|
@ -1129,7 +1122,6 @@ class TestComprehensive(unittest.TestCase):
|
||||||
for tax in taxonomies:
|
for tax in taxonomies:
|
||||||
if tax.namespace == list_name_test:
|
if tax.namespace == list_name_test:
|
||||||
break
|
break
|
||||||
if not travis_run:
|
|
||||||
r = self.admin_misp_connector.get_taxonomy(tax.id, pythonify=True)
|
r = self.admin_misp_connector.get_taxonomy(tax.id, pythonify=True)
|
||||||
self.assertEqual(r.namespace, list_name_test)
|
self.assertEqual(r.namespace, list_name_test)
|
||||||
self.assertTrue('enabled' in r)
|
self.assertTrue('enabled' in r)
|
||||||
|
@ -1192,7 +1184,6 @@ class TestComprehensive(unittest.TestCase):
|
||||||
self.assertFalse(r['Noticelist']['enabled'], r)
|
self.assertFalse(r['Noticelist']['enabled'], r)
|
||||||
|
|
||||||
def test_galaxies(self):
|
def test_galaxies(self):
|
||||||
if not travis_run:
|
|
||||||
# Make sure we're up-to-date
|
# Make sure we're up-to-date
|
||||||
r = self.admin_misp_connector.update_galaxies()
|
r = self.admin_misp_connector.update_galaxies()
|
||||||
self.assertEqual(r['name'], 'Galaxies updated.')
|
self.assertEqual(r['name'], 'Galaxies updated.')
|
||||||
|
@ -1212,7 +1203,6 @@ class TestComprehensive(unittest.TestCase):
|
||||||
first = self.create_simple_event()
|
first = self.create_simple_event()
|
||||||
try:
|
try:
|
||||||
first = self.user_misp_connector.add_event(first)
|
first = self.user_misp_connector.add_event(first)
|
||||||
if not travis_run:
|
|
||||||
r = self.admin_misp_connector.push_event_to_ZMQ(first.id)
|
r = self.admin_misp_connector.push_event_to_ZMQ(first.id)
|
||||||
self.assertEqual(r['message'], 'Event published to ZMQ')
|
self.assertEqual(r['message'], 'Event published to ZMQ')
|
||||||
finally:
|
finally:
|
||||||
|
|
Loading…
Reference in New Issue