@@ -165,52 +165,52 @@ func TestResolveAllowedDirectories(t *testing.T) {
165165 expected []string
166166 }{
167167 {
168- name : "Empty path" ,
168+ name : "Test 1: Empty path" ,
169169 configuredDirs : []string {"" },
170170 expected : []string {"/etc/nginx-agent" },
171171 },
172172 {
173- name : "Test 1 : Absolute path" ,
173+ name : "Test 2 : Absolute path" ,
174174 configuredDirs : []string {"/etc/agent/" },
175175 expected : []string {"/etc/nginx-agent" , "/etc/agent" },
176176 },
177177 {
178- name : "Test 2 : Absolute paths" ,
178+ name : "Test 3 : Absolute paths" ,
179179 configuredDirs : []string {"/etc/nginx/" },
180180 expected : []string {"/etc/nginx-agent" , "/etc/nginx" },
181181 },
182182 {
183- name : "Test 3 : Absolute path with multiple slashes" ,
183+ name : "Test 4 : Absolute path with multiple slashes" ,
184184 configuredDirs : []string {"/etc///////////nginx-agent/" },
185185 expected : []string {"/etc/nginx-agent" },
186186 },
187187 {
188- name : "Test 4 : Absolute path with directory traversal" ,
188+ name : "Test 5 : Absolute path with directory traversal" ,
189189 configuredDirs : []string {"/etc/nginx/../nginx-agent" },
190190 expected : []string {"/etc/nginx-agent" },
191191 },
192192 {
193- name : "Test 5 : Absolute path with repeat directory traversal" ,
193+ name : "Test 6 : Absolute path with repeat directory traversal" ,
194194 configuredDirs : []string {"/etc/nginx-agent/../../../../../nginx-agent" },
195195 expected : []string {"/etc/nginx-agent" },
196196 },
197197 {
198- name : "Test 6 : Absolute path with control characters" ,
198+ name : "Test 7 : Absolute path with control characters" ,
199199 configuredDirs : []string {"/etc/nginx-agent/\\ x08../tmp/" },
200200 expected : []string {"/etc/nginx-agent" },
201201 },
202202 {
203- name : "Test 7 : Absolute path with invisible characters" ,
203+ name : "Test 8 : Absolute path with invisible characters" ,
204204 configuredDirs : []string {"/etc/nginx-agent/ㅤㅤㅤ/tmp/" },
205205 expected : []string {"/etc/nginx-agent" },
206206 },
207207 {
208- name : "Test 8 : Absolute path with escaped invisible characters" ,
208+ name : "Test 9 : Absolute path with escaped invisible characters" ,
209209 configuredDirs : []string {"/etc/nginx-agent/\\ \\ ㅤ/tmp/" },
210210 expected : []string {"/etc/nginx-agent" },
211211 },
212212 {
213- name : "Test 9 : Mixed paths" ,
213+ name : "Test 10 : Mixed paths" ,
214214 configuredDirs : []string {
215215 "nginx-agent" ,
216216 "" ,
@@ -223,7 +223,7 @@ func TestResolveAllowedDirectories(t *testing.T) {
223223 expected : []string {"/etc/nginx-agent" , "/etc/nginx" },
224224 },
225225 {
226- name : "Test 10 : Relative path" ,
226+ name : "Test 11 : Relative path" ,
227227 configuredDirs : []string {"nginx-agent" },
228228 expected : []string {"/etc/nginx-agent" },
229229 },
0 commit comments