File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99from SoftLayer .CLI import exceptions
1010from SoftLayer .CLI import helpers
1111
12- RECORD_REGEX = re .compile (r"""^((?P<domain>([\w-]+(\.)?)*|\@)?\s+
12+ RECORD_REGEX = re .compile (r"""^((?P<domain>(( [\w-]+|\*) (\.)?)*|\@)?\s+
1313 (?P<ttl>\d+)?\s+
1414 (?P<class>\w+)?)?\s+
1515 (?P<type>\w+)\s+
Original file line number Diff line number Diff line change @@ -115,6 +115,8 @@ def test_parse_zone_file(self):
115115dev.realtest.com IN TXT "This is just a test of the txt record"
116116 IN AAAA 2001:db8:10::1
117117spf IN TXT "v=spf1 ip4:192.0.2.0/24 ip4:198.51.100.123 a"
118+ *.testing 86400 IN A 127.0.0.2
119+ * 86400 IN A 127.0.0.3
118120
119121"""
120122 expected = [{'data' : 'ns1.softlayer.com.' ,
@@ -148,7 +150,15 @@ def test_parse_zone_file(self):
148150 {'data' : '"v=spf1 ip4:192.0.2.0/24 ip4:198.51.100.123 a"' ,
149151 'record' : 'spf' ,
150152 'type' : 'TXT' ,
151- 'ttl' : None }]
153+ 'ttl' : None },
154+ {'data' : '127.0.0.2' ,
155+ 'record' : '*.testing' ,
156+ 'type' : 'A' ,
157+ 'ttl' : '86400' },
158+ {'data' : '127.0.0.3' ,
159+ 'record' : '*' ,
160+ 'type' : 'A' ,
161+ 'ttl' : '86400' }]
152162 zone , records , bad_lines = zone_import .parse_zone_details (zone_file )
153163 self .assertEqual (zone , 'realtest.com' )
154164 self .assertEqual (records , expected )
You can’t perform that action at this time.
0 commit comments