Skip to content

Commit 4c2b190

Browse files
committed
Fix so test_01 is run and works with Panorama.
1 parent 895ee09 commit 4c2b190

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/test_xapi_fw_pano_import.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,19 @@ def test_01(self):
5151
self.api.import_file(category='certificate',
5252
file=cert,
5353
extra_qs={
54-
'certificate-name': 'test00',
54+
'certificate-name': cert_name,
5555
'format': 'pem',
5656
})
5757
self.assertEqual(self.api.status, 'success')
58+
# PAN-OS
5859
path = ("/config/shared/certificate/entry[@name='%s']" %
5960
cert_name)
6061
x = self.api.get(xpath=path)
62+
if self.api.status_code == '7':
63+
# Panorama
64+
path = ("/config/panorama/certificate/entry[@name='%s']" %
65+
cert_name)
66+
x = self.api.get(xpath=path)
6167
self.assertEqual(self.api.status, 'success')
6268
self.assertEqual(self.api.status_code, '19')
6369
x = self.api.delete(xpath=path)
@@ -70,8 +76,6 @@ def test_01(self):
7076
self.assertIsNotNone(x)
7177
self.assertEqual(len(x), 0)
7278

73-
74-
class PanXapiTest(xapi_mixin.Mixin, unittest.TestCase):
7579
def test_02(self):
7680
self.api.show()
7781
self.assertEqual(self.api.status, 'success')

0 commit comments

Comments
 (0)