diff options
author | Paul Vinciguerra <pvinci@vinciconsulting.com> | 2019-05-17 09:48:15 -0400 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2019-05-17 21:03:29 +0000 |
commit | b7658201d958231ac7f5aeda6184d918893d2914 (patch) | |
tree | 97f053180e0e6c1a916ea37fb3494442480eb347 /test/test_syslog.py | |
parent | 0d144c78d7119a0af71eda6e67f29fa56da2614d (diff) |
Tests: Refactor. Remove copies of enums.
Use the enums provided from the api definitions instead.
Change-Id: I43b7591df920c984e439efc4b3ec3c4121c539d8
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'test/test_syslog.py')
-rw-r--r-- | test/test_syslog.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/test/test_syslog.py b/test/test_syslog.py index 90a0aef908f..0acf7c221eb 100644 --- a/test/test_syslog.py +++ b/test/test_syslog.py @@ -5,14 +5,18 @@ from framework import VppTestCase, VppTestRunner from util import ppp from scapy.packet import Raw from scapy.layers.inet import IP, UDP -from vpp_papi_provider import SYSLOG_SEVERITY from syslog_rfc5424_parser import SyslogMessage, ParseError from syslog_rfc5424_parser.constants import SyslogFacility, SyslogSeverity +from vpp_papi import VppEnum class TestSyslog(VppTestCase): """ Syslog Protocol Test Cases """ + @property + def SYSLOG_SEVERITY(self): + return VppEnum.vl_api_syslog_severity_t + @classmethod def setUpClass(cls): super(TestSyslog, cls).setUpClass() @@ -145,9 +149,11 @@ class TestSyslog(VppTestCase): msg) self.pg_enable_capture(self.pg_interfaces) - self.vapi.syslog_set_filter(SYSLOG_SEVERITY.WARN) + self.vapi.syslog_set_filter( + self.SYSLOG_SEVERITY.SYSLOG_API_SEVERITY_WARN) filter = self.vapi.syslog_get_filter() - self.assertEqual(filter.severity, SYSLOG_SEVERITY.WARN) + self.assertEqual(filter.severity, + self.SYSLOG_SEVERITY.SYSLOG_API_SEVERITY_WARN) self.syslog_generate(SyslogFacility.local7, SyslogSeverity.info, appname, |