Browse Source

Merge "Properly quote TXT/SPF sample data"

Zuul 1 month ago
parent
commit
c1708fc0c8

+ 2
- 2
designate_tempest_plugin/data_utils.py View File

@@ -169,7 +169,7 @@ def rand_mx_recordset(zone_name, pref=None, host=None, **kwargs):
169 169
 
170 170
 
171 171
 def rand_spf_recordset(zone_name, data=None, **kwargs):
172
-    data = data or "v=spf1 +all"
172
+    data = data or '"v=spf1 +all"'
173 173
     return rand_recordset_data('SPF', zone_name, records=[data], **kwargs)
174 174
 
175 175
 
@@ -193,7 +193,7 @@ def rand_sshfp_recordset(zone_name, algorithm_number=None,
193 193
 
194 194
 
195 195
 def rand_txt_recordset(zone_name, data=None, **kwargs):
196
-    data = data or "v=spf1 +all"
196
+    data = data or '"v=spf1 +all"'
197 197
     return rand_recordset_data('TXT', zone_name, records=[data], **kwargs)
198 198
 
199 199
 

+ 1
- 1
designate_tempest_plugin/tests/api/v2/invalid_txt_dataset.json View File

@@ -1,5 +1,5 @@
1 1
 {
2 2
   "trailing_slash": {"data": "\\"},
3 3
   "trailing_double_slash": {"data": "\\\\"},
4
-  "trailing_slash_after_text": {"data": "v=spf1 +all\\"}
4
+  "trailing_slash_after_text": {"data": "testtext\\"}
5 5
 }

+ 1
- 1
designate_tempest_plugin/tests/api/v2/recordset_data.json View File

@@ -47,6 +47,6 @@
47 47
     "TXT": {
48 48
         "name": "www",
49 49
         "type": "TXT",
50
-        "records": ["Any Old Text Goes Here"]
50
+        "records": ["\"Any Old Text Goes Here\""]
51 51
     }
52 52
 }

+ 4
- 4
designate_tempest_plugin/tests/api/v2/recordset_wildcard_data.json View File

@@ -33,21 +33,21 @@
33 33
     "SPF at APEX": {
34 34
         "name": "*",
35 35
         "type": "SPF",
36
-        "records": ["v=spf1; a -all"]
36
+        "records": ["\"v=spf1; a -all\""]
37 37
     },
38 38
     "SPF under APEX": {
39 39
         "name": "*.sub",
40 40
         "type": "SPF",
41
-        "records": ["v=spf1; a -all"]
41
+        "records": ["\"v=spf1; a -all\""]
42 42
     },
43 43
     "TXT at APEX": {
44 44
         "name": "*",
45 45
         "type": "TXT",
46
-        "records": ["Can you read me?"]
46
+        "records": ["\"Can you read me?\""]
47 47
     },
48 48
     "TXT under APEX": {
49 49
         "name": "*.sub",
50 50
         "type": "TXT",
51
-        "records": ["Can you read me?"]
51
+        "records": ["\"Can you read me?\""]
52 52
     }
53 53
 }

+ 1
- 1
designate_tempest_plugin/tests/api/v2/test_recordset_validation.py View File

@@ -134,7 +134,7 @@ class RecordsetValidationTest(base.BaseDnsV2Test):
134 134
         self.assertRaisesDns(
135 135
             exceptions.BadRequest, 'invalid_object', 400,
136 136
             self.recordset_client.create_recordset,
137
-            self.zone['id'], post_model,
137
+            self.zone['id'], post_model
138 138
         )
139 139
 
140 140
     @decorators.idempotent_id('03e4f811-0c37-4ce2-8b16-662c824f8f18')

+ 3
- 3
designate_tempest_plugin/tests/api/v2/valid_txt_dataset.json View File

@@ -1,5 +1,5 @@
1 1
 {
2
-  "slash_with_one_trailing_space": {"data": "\\ "},
3
-  "slash_with_many_trailing_space": {"data": "\\    "},
4
-  "text_with_slash_and_trailing_space": {"data": "the txts    "}
2
+  "slash_with_one_trailing_space": {"data": "\"\\ \""},
3
+  "slash_with_many_trailing_space": {"data": "\"\\    \""},
4
+  "text_with_slash_and_trailing_space": {"data": "\"the txts    \""}
5 5
 }

+ 1
- 1
designate_tempest_plugin/tests/base.py View File

@@ -22,7 +22,7 @@ from designate_tempest_plugin import clients
22 22
 CONF = config.CONF
23 23
 
24 24
 
25
-class AssertRaisesDns(object):
25
+class AssertRaisesDns(test.BaseTestCase):
26 26
     def __init__(self, test_class, exc, type_, code):
27 27
         self.test_class = test_class
28 28
         self.exc = exc

Loading…
Cancel
Save