Skip to content

Commit 150f382

Browse files
committed
test: [#236] verify dynamic ports are rendered in docker-compose.yml
- Add assertions to check default ports (6969 UDP, 7070 HTTP, 1212 API) are rendered - Verify hardcoded port 6868 is NOT present in output - Ensures template correctly uses Tera variables instead of hardcoded values - Phase 5 complete: Testing and verification added
1 parent b902262 commit 150f382

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/application/steps/rendering/docker_compose_templates.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,5 +284,25 @@ mod tests {
284284
// Verify it contains expected content from embedded template
285285
assert!(output_content.contains("torrust/tracker"));
286286
assert!(output_content.contains("./storage/tracker/lib:/var/lib/torrust/tracker"));
287+
288+
// Verify dynamic ports are rendered (default TrackerConfig has 6969 UDP, 7070 HTTP, 1212 API)
289+
assert!(
290+
output_content.contains("6969:6969/udp"),
291+
"Should contain UDP tracker port 6969"
292+
);
293+
assert!(
294+
output_content.contains("7070:7070"),
295+
"Should contain HTTP tracker port 7070"
296+
);
297+
assert!(
298+
output_content.contains("1212:1212"),
299+
"Should contain HTTP API port 1212"
300+
);
301+
302+
// Verify hardcoded ports are NOT present
303+
assert!(
304+
!output_content.contains("6868:6868"),
305+
"Should not contain hardcoded UDP port 6868"
306+
);
287307
}
288308
}

0 commit comments

Comments
 (0)