File tree Expand file tree Collapse file tree
tests/unit/utils/validate Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from salt .utils .validate import path
2+ from tests .support .unit import TestCase
3+
4+
5+ class ValidatePathTestCase (TestCase ):
6+ """
7+ TestCase for salt.utils.validate.path module
8+ """
9+
10+ def test_is_syslog_path (self ):
11+
12+ """
13+ Test syslog path
14+ """
15+
16+ valid_paths = [
17+ "file:///dev/log" ,
18+ "file:///dev/log/LOG_USER" ,
19+ "udp://loghost:10514" ,
20+ "udp://loghost:10514/LOG_USER" ,
21+ "udp://loghost/LOG_USER" ,
22+ "tcp://loghost:10514" ,
23+ "tcp://loghost:10514/LOG_USER" ,
24+ "tcp://loghost/USER"
25+ ]
26+
27+ invalid_paths = [
28+ "/dev/log" ,
29+ "file:///dev/log/USER" ,
30+ "udp://loghost/USER" ,
31+ "tcp://loghost/USER" ,
32+ "unix:///dev/log"
33+ ]
34+
35+ for addr in valid_paths :
36+ self .assertTrue (path .is_syslog_path (addr ))
37+
38+ for addr in invalid_paths :
39+ self .assertFalse (path .is_syslog_path (addr ))
You can’t perform that action at this time.
0 commit comments