@@ -90,9 +90,9 @@ load "${SCRIPTS_DIR}/util.sh"
90
90
91
91
local server_names=(${certificates[my-cert]} )
92
92
[ ${# server_names[@]} -eq 3 ]
93
- [ " ${server_names[0]} " == " another. example.org" ]
94
- [ " ${server_names[1]} " == " example.org" ]
95
- [ " ${server_names[2]} " == " www .example.org" ]
93
+ [ " ${server_names[0]} " == " example.org" ]
94
+ [ " ${server_names[1]} " == " www. example.org" ]
95
+ [ " ${server_names[2]} " == " another .example.org" ]
96
96
}
97
97
98
98
@test " parse_config_file works for single server block, multiple certificate names, single server name" {
@@ -129,9 +129,9 @@ load "${SCRIPTS_DIR}/util.sh"
129
129
130
130
local server_names=(${certificates[my-cert]} )
131
131
[ ${# server_names[@]} -eq 3 ]
132
- [ " ${server_names[0]} " == " another. example.org" ]
133
- [ " ${server_names[1]} " == " example.org" ]
134
- [ " ${server_names[2]} " == " www .example.org" ]
132
+ [ " ${server_names[0]} " == " example.org" ]
133
+ [ " ${server_names[1]} " == " www. example.org" ]
134
+ [ " ${server_names[2]} " == " another .example.org" ]
135
135
}
136
136
137
137
@test " parse_config_file works for multiple server blocks, multiple certificate names, multiple server names" {
@@ -147,17 +147,17 @@ load "${SCRIPTS_DIR}/util.sh"
147
147
148
148
local server_names_cert1=(${certificates[my-cert1]} )
149
149
[ ${# server_names_cert1[@]} -eq 4 ]
150
- [ " ${server_names_cert1[0]} " == " anew. example.org" ]
151
- [ " ${server_names_cert1[1]} " == " another .example.org" ]
152
- [ " ${server_names_cert1[2]} " == " example.org" ]
153
- [ " ${server_names_cert1[3]} " == " www .example.org" ]
150
+ [ " ${server_names_cert1[0]} " == " example.org" ]
151
+ [ " ${server_names_cert1[1]} " == " www .example.org" ]
152
+ [ " ${server_names_cert1[2]} " == " another. example.org" ]
153
+ [ " ${server_names_cert1[3]} " == " anew .example.org" ]
154
154
155
155
local server_names_cert2=(${certificates[my-cert2]} )
156
156
[ ${# server_names_cert2[@]} -eq 4 ]
157
- [ " ${server_names_cert1 [0]} " == " anew. example.org" ]
158
- [ " ${server_names_cert1 [1]} " == " another .example.org" ]
159
- [ " ${server_names_cert1 [2]} " == " example.org" ]
160
- [ " ${server_names_cert1 [3]} " == " www .example.org" ]
157
+ [ " ${server_names_cert2 [0]} " == " example.org" ]
158
+ [ " ${server_names_cert2 [1]} " == " www .example.org" ]
159
+ [ " ${server_names_cert2 [2]} " == " another. example.org" ]
160
+ [ " ${server_names_cert2 [3]} " == " anew .example.org" ]
161
161
162
162
}
163
163
@@ -189,8 +189,8 @@ load "${SCRIPTS_DIR}/util.sh"
189
189
local server_names=(${certificates[my-cert]} )
190
190
[ ${# server_names[@]} -eq 3 ]
191
191
[ " ${server_names[0]} " == " *.example.org" ]
192
- [ " ${server_names[1]} " == " *.sub. example.org" ]
193
- [ " ${server_names[2]} " == " example.org" ]
192
+ [ " ${server_names[1]} " == " example.org" ]
193
+ [ " ${server_names[2]} " == " *.sub. example.org" ]
194
194
}
195
195
196
196
@test " parse_config_file ignores regex names" {
@@ -206,11 +206,11 @@ load "${SCRIPTS_DIR}/util.sh"
206
206
local server_names=(${certificates[my-cert]} )
207
207
echo " ${certificates[@]} "
208
208
[ ${# server_names[@]} -eq 5 ]
209
- [ " ${server_names[0]} " == " 192.168.0.1 " ]
210
- [ " ${server_names[1]} " == " 1:2:3:4:5:6:7:8 " ]
209
+ [ " ${server_names[0]} " == " example.org " ]
210
+ [ " ${server_names[1]} " == " www.example.org " ]
211
211
[ " ${server_names[2]} " == " _" ]
212
- [ " ${server_names[3]} " == " example.org " ]
213
- [ " ${server_names[4]} " == " www.example.org " ]
212
+ [ " ${server_names[3]} " == " 192.168.0.1 " ]
213
+ [ " ${server_names[4]} " == " 1:2:3:4:5:6:7:8 " ]
214
214
}
215
215
216
216
@test " parse_config_file works over multiple files (with duplicates)" {
@@ -227,20 +227,20 @@ load "${SCRIPTS_DIR}/util.sh"
227
227
228
228
local server_names_cert1=(${certificates[my-cert1]} )
229
229
[ ${# server_names_cert1[@]} -eq 3 ]
230
- [ " ${server_names_cert1[0]} " == " anew. example.org" ]
231
- [ " ${server_names_cert1[1]} " == " example.org" ]
232
- [ " ${server_names_cert1[2]} " == " www .example.org" ]
230
+ [ " ${server_names_cert1[0]} " == " example.org" ]
231
+ [ " ${server_names_cert1[1]} " == " www. example.org" ]
232
+ [ " ${server_names_cert1[2]} " == " anew .example.org" ]
233
233
234
234
local server_names_cert2=(${certificates[my-cert2]} )
235
235
[ ${# server_names_cert2[@]} -eq 3 ]
236
- [ " ${server_names_cert2[0]} " == " * .example.com " ]
237
- [ " ${server_names_cert2[1]} " == " anew. example.org " ]
238
- [ " ${server_names_cert2[2]} " == " example.com" ]
236
+ [ " ${server_names_cert2[0]} " == " anew .example.org " ]
237
+ [ " ${server_names_cert2[1]} " == " example.com " ]
238
+ [ " ${server_names_cert2[2]} " == " *. example.com" ]
239
239
240
240
local server_names_cert3=(${certificates[my-cert3]} )
241
241
[ ${# server_names_cert3[@]} -eq 4 ]
242
- [ " ${server_names_cert3[0]} " == " *. example.net" ]
243
- [ " ${server_names_cert3[1]} " == " example.net" ]
244
- [ " ${server_names_cert3[2]} " == " new .example.net" ]
245
- [ " ${server_names_cert3[3]} " == " www .example.net" ]
242
+ [ " ${server_names_cert3[0]} " == " example.net" ]
243
+ [ " ${server_names_cert3[1]} " == " *. example.net" ]
244
+ [ " ${server_names_cert3[2]} " == " www .example.net" ]
245
+ [ " ${server_names_cert3[3]} " == " new .example.net" ]
246
246
}
0 commit comments